How to project 4d scenes in programs

Discuss interdimensional programming, Java applets and so forth.

How to project 4d scenes in programs

Postby bo198214 » Mon Aug 14, 2006 4:49 pm

This is splitted from Adanaxis Rendering Demo.

quickfur wrote:Wait, isn't cavalier projection just a kind of oblique projection? This can be done easily, of course. Now, understanding the result would be another matter, though. :-) Although, I did use oblique projections in my mind to visualize some of the tetracube-based uniform polychora (such as the runcinated/cantellated tesseracts, and other such cuties).

Dont know exactly about the naming, but for 3d->2d cavalier perspective is putting x and y as usual an z in 45 degrees between them. x and y has original length and z has half the length. So in 4d->3d you put x, y, z as usual and w in same angle to x,y,z. x,y,z in original length w in half the original length. This induces parallel lines remaining parallel after projection. I think its not even a parallel projection for any viewing angle. For an overview of axonometric projections look here.

Yes, cavalier perspective is how one usually draws a cube on paper. Two equally sized squares shifted half the edge length in 45 degrees. In 4d building blocks for example (where you can switch the 4d->3d projection type) the scene looks much more neatly with cavalier or similar projections where parallel lines remain parallel after projection.
In the next time I will add occlusion culling there, though I fear it will be quite slow.

Recently, much to my joy, I discovered that the "polytopes" hack in xscreensaver actually implements transparent surfaces for viewing the regular 4-polytopes!!

Will have a look at it, though linux is not my main system.

I also remember some guy named Tuvel, who used to post here, who had a website with animations of various polytopes using glass-like material for rendering polygons. Unfortunately, the website no longer exists, and I've been unable to find those animations anywhere else (except for the precious few I downloaded locally).


Damn, thats really a pitty. Can you make your (precious) downloaded ones available online? Am actually indeed intend to make a real world model of an impossible tesseract with glass or some transparent material. Would be interesting to know how much transparency helps understanding, or whether the transparency is rather irritating.

The other question about transparency is whether, one should really make the 3d facets transparent or only the 2d faces. Because making the 3d facets transparent could imho lead to something grey in grey (because every point in a 3d volume would then lower light intensity, contrary to only the points of its surface), and probably objects of complex scenes are no more discernable.
Though of course even opaque 2d faces are for a tetrionian kind of wireframe, so he would anyway look through.
bo198214
Tetronian
 
Posts: 692
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Re: How to project 4d scenes in programs

Postby quickfur » Mon Aug 14, 2006 6:50 pm

bo198214 wrote:[...]
Yes, cavalier perspective is how one usually draws a cube on paper. Two equally sized squares shifted half the edge length in 45 degrees. In 4d building blocks for example (where you can switch the 4d->3d projection type) the scene looks much more neatly with cavalier or similar projections where parallel lines remain parallel after projection.

OK, so essentially it's an oblique projection from a diagonal viewpoint.

In the next time I will add occlusion culling there, though I fear it will be quite slow.

I also remember some guy named Tuvel, who used to post here, who had a website with animations of various polytopes using glass-like material for rendering polygons. Unfortunately, the website no longer exists, and I've been unable to find those animations anywhere else (except for the precious few I downloaded locally).


Damn, thats really a pitty. Can you make your (precious) downloaded ones available online? Am actually indeed intend to make a real world model of an impossible tesseract with glass or some transparent material. Would be interesting to know how much transparency helps understanding, or whether the transparency is rather irritating.

OK, I found that I have only one animation where he actually uses transparent surfaces. The others I have are all wireframes, although he did use Povray (or some raytracer) to render the lines (non-zero width), so you can still see the 3D depth in them.

Here's the 5D cube with transparent 2-faces: http://eusebeia.dyndns.org/~hsteoh/tuvel/5d-hcube-Tuvel.avi

The other question about transparency is whether, one should really make the 3d facets transparent or only the 2d faces. Because making the 3d facets transparent could imho lead to something grey in grey (because every point in a 3d volume would then lower light intensity, contrary to only the points of its surface), and probably objects of complex scenes are no more discernable.
Though of course even opaque 2d faces are for a tetrionian kind of wireframe, so he would anyway look through.

I've thought about this before. Making the entire facet transparent isn't as simple as it sounds, because the kind of transparent solids that we're familiar with are things like glass or hollow objects filled with water, and the transparent appearance is due to the index of refraction which diffracts light in a way different from its surroundings. The problem with doing this to a 4D projection is that diffraction changes the direction of light, so you get a distorted view of the inside of a projection, which defeats the purpose of using transparency in the first place.

We can of course do a non-diffracting transparency where the diminishing of the light is proportional to the length of the intersection of the eye-ray with the object. But this doesn't actually correspond with any common real-world object that we're familar with, so our eye doesn't immediately catch on and perceive what it's supposed to be.

I think transparent ridges (2-faces) are a good compromise. Like you said, transparent 2-faces are like wireframes to a 4D viewer, so you should still be able to recover enough information to discern the facets.

At any rate, this is unexplored territory for me, so try it out with different approaches and see how well it works.
quickfur
Pentonian
 
Posts: 2953
Joined: Thu Sep 02, 2004 11:20 pm
Location: The Great White North

Re: How to project 4d scenes in programs

Postby bo198214 » Mon Aug 14, 2006 8:03 pm

quickfur wrote:OK, I found that I have only one animation where he actually uses transparent surfaces. The others I have are all wireframes, although he did use Povray (or some raytracer) to render the lines (non-zero width), so you can still see the 3D depth in them.

Here's the 5D cube with transparent 2-faces: http://eusebeia.dyndns.org/~hsteoh/tuvel/5d-hcube-Tuvel.avi

Wow, *thats* cool!

But I see already that too much ridges would make a scene quite misty. So poor trionians can handle only up to a certain complexity ... everything else becomes unclear.

I think transparent ridges (2-faces) are a good compromise.
hey, again concordance.

At any rate, this is unexplored territory for me
As it seems for everyone :P
bo198214
Tetronian
 
Posts: 692
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Re: How to project 4d scenes in programs

Postby quickfur » Mon Aug 14, 2006 8:20 pm

bo198214 wrote:
quickfur wrote:OK, I found that I have only one animation where he actually uses transparent surfaces. The others I have are all wireframes, although he did use Povray (or some raytracer) to render the lines (non-zero width), so you can still see the 3D depth in them.

Here's the 5D cube with transparent 2-faces: http://eusebeia.dyndns.org/~hsteoh/tuvel/5d-hcube-Tuvel.avi

Wow, *thats* cool!

But I see already that too much ridges would make a scene quite misty. So poor trionians can handle only up to a certain complexity ... everything else becomes unclear.

One idea I have, along the same line of thought that the center of a projection is where a tetronian's attention would be focused on, is to reduce the intensity of the ridges toward the limb of the projection, and increase the intensity as you approach the center of the projection. This way, you see the most important parts of the projection while still have some indication of what's around it.
quickfur
Pentonian
 
Posts: 2953
Joined: Thu Sep 02, 2004 11:20 pm
Location: The Great White North

Postby bo198214 » Mon Aug 14, 2006 8:55 pm

If your eye were tracked, you could apply this technique to the 3d->2d projection. I.e. where to you focus your eye, suddenly appears out of the mists :o Looking holes into the mist with the xray eye, yeah!
Its then more a slicing approach.
Apropos slicing approach, of course we can misuse the time as 4th dimension. And in a radar screen like way slice through the 4d object every some seconds.
bo198214
Tetronian
 
Posts: 692
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Postby quickfur » Mon Aug 14, 2006 9:35 pm

bo198214 wrote:If your eye were tracked, you could apply this technique to the 3d->2d projection. I.e. where to you focus your eye, suddenly appears out of the mists :o Looking holes into the mist with the xray eye, yeah!
Its then more a slicing approach.
Apropos slicing approach, of course we can misuse the time as 4th dimension. And in a radar screen like way slice through the 4d object every some seconds.

Well, this is not quite what I meant. I consider slicing as unusable because it dissects a coherent projected volume into cross-sections, which the viewer must then synthesize in his mind to recover the original shape. This is not feasible, as I explained here.

What I meant was a way of varying the transparency of the surfaces you render, so that surfaces close to the origin (the center of the 3D retina) are less transparent, and the surfaces farther away are more transparent. The intention is to "highlight" the center part of the projection, which contains the more important information, and not let it get obscured by too many layers of surfaces which lie around the periphery of the retina, which aren't very important.

The analogous situation in 3D -> 2D rendering is when you're looking down a corridor in 3D, and there are many decorations on the walls around the edge of the screen. These decorations are unimportant, because the area of interest lies in the center where you can see where the corridor is leading to and what's around it. But to a 2D viewer who looks from the side of the screen, these decorations show up in front, and so distracts him from the central area of the projection. My idea was to render these side decorations more lightly, so that they're still there, but not prominent and distracting, while the central area of the retina is rendered more "heavily", so that it draws attention to the right place.
quickfur
Pentonian
 
Posts: 2953
Joined: Thu Sep 02, 2004 11:20 pm
Location: The Great White North

Postby bo198214 » Tue Aug 15, 2006 12:07 am

Yes, but I see not the difference to what I said.
Except that the "slicing" was a bit misleading.
1. its no slicing but frustruming
2. its no frustruming but soft frustruming.

southa mentioned a HAC function, i.e. you value points in a certain area stronger then for example at the border. So they appear brighter than other points. Its a bit like a spotlight, you can see the spotted area more clearly.

Nonetheless, even if that all now sounds unclear... I understood you and meant the same :P

PS: So you dont like my radar slicing? :( Of course if you have something to do in time, this becomes difficult then you have to adjust the frequency quite high ... 50 slices in 1sec ... ;)
bo198214
Tetronian
 
Posts: 692
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany

Postby quickfur » Tue Aug 15, 2006 1:41 am

bo198214 wrote:Yes, but I see not the difference to what I said.
Except that the "slicing" was a bit misleading.
1. its no slicing but frustruming
2. its no frustruming but soft frustruming.

southa mentioned a HAC function, i.e. you value points in a certain area stronger then for example at the border. So they appear brighter than other points. Its a bit like a spotlight, you can see the spotted area more clearly.

Nonetheless, even if that all now sounds unclear... I understood you and meant the same :P

OK. :-)

PS: So you dont like my radar slicing? :( Of course if you have something to do in time, this becomes difficult then you have to adjust the frequency quite high ... 50 slices in 1sec ... ;)

Well, I really don't know. I guess we'll just have to implement it and try it out, to see whether it's useful. Like I said, this is unfamiliar territory to me, so I'm mainly going by gut feeling, which may not be correct.
quickfur
Pentonian
 
Posts: 2953
Joined: Thu Sep 02, 2004 11:20 pm
Location: The Great White North

Postby bo198214 » Tue Aug 15, 2006 11:59 am

southa wrote:
The point is that the player should be able to rotate the 3D view freely in order to ascertain what exactly is being seen, without changing his 4D viewpoint. It doesn't make sense that the 4D viewpoint needs to be rotated just so some poor 3D being can understand what the tetronian is seeing.

True, but the 4D viewer position doesn't have to change, only the orientation of the 4D viewer. So a change in the position of your 3D viewer is largely equivalent (even mathematically) to a change in orientation of the 4D viewer.

If you move your 3d viewpoint how will you achieve this by a rotation of the 4d viewpoint? I experience it also in the 4dbb that it is nice if I can look 3d around the scene (because even in wireframe some details may become hidden) to explore this projection, instead to have to manipulate the 4d view point. And I also doubt that most changes in 3d viewpoint can exactly achieved by changing the 4d viewpoint only, if we use double perspective projection.
A 3D depth buffer should do it (w buffer?), but that makes rendering expensive. Its cost is probably similar to using 3D textures for the hyperfaces, but it still looks easier than doing it analytically.


Hm, if the tetronians retina is given by the voxels in a cubic array, I would imagine rendering quite expensive. But in this case occlusion culling would be quite simple. We would overpaint each voxel according to the distance of the corresponding 4d point from the tetronians eye.

If otherwise the objects in 3d are given by polygons. Then we have to face the problem of cutting out one 3d object out of another. Because B overpaints A by cutting B out of A and then adding B. I dont know whether cutting out is a usual functionality in 3d graphics, but I would guess it is a rather unusual feature.

PS: I moved it away from the adanaxis demo thread because its not about adanaxis demo but about projecting.
bo198214
Tetronian
 
Posts: 692
Joined: Tue Dec 06, 2005 11:03 pm
Location: Berlin - Germany


Return to Programming

Who is online

Users browsing this forum: No registered users and 6 guests

cron