4D Mesh Viewer [ROTATE THROUGH TIME]

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
xXxMoNkEyMaNxXx
Party member
Posts: 206
Joined: Thu Jan 10, 2013 6:16 am
Location: Canada

4D Mesh Viewer [ROTATE THROUGH TIME]

Post by xXxMoNkEyMaNxXx »

I was going to make a 3D mesh viewer, but since images can store four values per pixel, I thought "Why not?"
I don't actually know if this would work if I had any properly formatted meshes, because the one I tried to make failed miserably. Instead, I use some images that I randomly generated instead of carefully plotted actual meshes. My format has one image for textures, one with information about the size and location of the textures, one for events (four-dimensional vertices), one to pair up textures and events to be considered the same object at different events & to interpolate between them, and finally one that describes a set of three event pairs and one texture pair that make up a triangular prism in four dimensions.
I am thinking about making a simpler 3D mesh viewer, because this got a bit out of hand.
I also made some great modular vector and matrix mini-libraries.

Controls:
E&Q = +&- w axis (time)
W&S = +&- z axis
Space&LShift = +&- y axis
D&A = +&- x axis

Y&H = Rotate XW axis
U&J = Rotate YW axis
I&K = Rotate ZW axis

Right click = rotate camera on x and y axis

When the program starts, hold the E key to change the time slice of the random 4D mesh in view (note that it does not exist at t=0).
Attachments
Meshv2.2.love
Four dimensional objects can get pretty trippy. Beware.
(8.15 MiB) Downloaded 304 times
Last edited by xXxMoNkEyMaNxXx on Wed Apr 03, 2013 12:29 am, edited 1 time in total.
User avatar
vitaminx
Citizen
Posts: 95
Joined: Fri Oct 19, 2012 7:16 am
Location: international
Contact:

Re: 4D Mesh Viewer

Post by vitaminx »

weird, on my intel gfx card on Linux I see only a black screen, and when randomly hitting WASD keys after a while this error is thrown:

Code: Select all

Mesa 8.0.5 implementation error: Failed to compile fragment shader: FS compile failed: no register to spill

Please report at bugs.freedesktop.org
Error: [string "graphics.lua"]:1346: Invalid operation:
- Trying to send the wrong value type to shader variable, or
- Trying to send array values with wrong dimension, or
- Invalid variable name.
stack traceback:
	[C]: in function 'sendFloat'
	[string "graphics.lua"]:1346: in function 'send'
	lib/mesh4d.lua:42: in function 'updateCamera'
	main.lua:85: in function 'update'
	[string "boot.lua"]:407: in function <[string "boot.lua"]:373>
	[C]: in function 'xpcall'

On my NVidia card I see at least the coordinates in the upper left corner of the window but nothing else, no crash occurs.
User avatar
anorak
Prole
Posts: 11
Joined: Mon Mar 25, 2013 8:10 am

Re: 4D Mesh Viewer

Post by anorak »

vitaminx wrote:weird, on my intel gfx card on Linux I see only a black screen
I had the same experience, and then tried pressing the e key for a while when it first starts up, and I see some weird stuff show up. It does appear to move the way the controls suggest, but I have no idea what it's supposed to be.
User avatar
vitaminx
Citizen
Posts: 95
Joined: Fri Oct 19, 2012 7:16 am
Location: international
Contact:

Re: 4D Mesh Viewer

Post by vitaminx »

looks quite trippy though :)
Attachments
screenshot from nvidia gfx
screenshot from nvidia gfx
screenshot.png (46.37 KiB) Viewed 3980 times
User avatar
xXxMoNkEyMaNxXx
Party member
Posts: 206
Joined: Thu Jan 10, 2013 6:16 am
Location: Canada

Re: 4D Mesh Viewer

Post by xXxMoNkEyMaNxXx »

It's a bunch of random four dimensional triangular prisms, which when only shown at a certain timeslice, look like polygons :D
User avatar
xXxMoNkEyMaNxXx
Party member
Posts: 206
Joined: Thu Jan 10, 2013 6:16 am
Location: Canada

Re: 4D Mesh Viewer [ROTATE THROUGH TIME]

Post by xXxMoNkEyMaNxXx »

Most recent version.

wasd qe lshift space for axial translation,
right mouse & yuihjk for rotation on time and non-time axes.
numpad 123456 to rotate the model through time.
Attachments
Meshv2.2.love
(8.15 MiB) Downloaded 170 times
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: 4D Mesh Viewer [ROTATE THROUGH TIME]

Post by josefnpat »

Code: Select all

~/Downloads♠ love Meshv2.2.love 
Error: [string "graphics.lua"]:1368: Cannot compile shader:
Line 190: error: too little data in initialization
Line 190: error: OpenGL does not allow C style initializers
Line 190: error: too little data in initialization
Line 331: error: ambiguous overloaded function reference "min(int, int)"
Line 339: error: ambiguous overloaded function reference "min(int, int)"
stack traceback:
	[C]: in function 'newPixelEffect'
	[string "graphics.lua"]:1368: in function 'newPixelEffect'
	lib/mesh4d.lua:17: in main chunk
	[C]: in function 'require'
	main.lua:4: in main chunk
	[C]: in function 'require'
	[string "boot.lua"]:331: in function <[string "boot.lua"]:227>
	[C]: in function 'xpcall'
:(
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Post Reply

Who is online

Users browsing this forum: No registered users and 212 guests