View Full Version : 2D view of a 3D environment

11-01-2007, 10:31 AM
Hi, I have created a project where devices (represented as Cubes) is overlay ontop of a 3d Mesh. What i want to do is to view each Mesh plane (such as along the X - Y planes) to see where each devices are located. Something like a blueprint for lights. The problem i am running into is how to transform the 3D world into 2D meshplanes? Thanks for your help.

11-01-2007, 11:21 AM
I don't realy understand what you mean by "meshplanes".
What about a simple orthographic projection obtainable with gluOrtho* ?

[ www.trenki.net (http://www.trenki.net) | vector_math (3d math library) (http://www.trenki.net/content/view/16/36/) | software renderer (http://www.trenki.net/content/view/18/38/) ]

11-01-2007, 01:45 PM
I am sure to understand correctly what you want to do.
Can you draw a picture of what you have in mind ?

A suggestion : to flatten a wireframe mesh, do a glScale(1,1,0) ie to have a X/Y only plane.

11-02-2007, 01:32 PM
Here is an image of my Mesh Cube
The Red lines are the Mesh Wireframe
THe teal lines are the Lattice wireframe
the white square things are my devices
I have it in 3d but I do not know how can I make it 2D (I want to be able to switch it back and forth) Should I make an if statement inside my windows init / resize function to select either 2D or 3D?
http://img62.imageshack.us/img62/3631/meshag7.th.jpg (http://img62.imageshack.us/my.php?image=meshag7.jpg)

What I really want is to go through each X-Y Lattice plane and view what is located on this plane.

Edit: GLscale flattens all the planes into one. how can I set the depth of the planes?

Edit: okay playing around with glortho I got some sort of wireframe view but it is stretch now without my aspect ratio. Is there a function that keeps my aspect ratio when I rescale window? (I cant use glperspective now cause it will screw up glortho. I think)

Edit: OKAY I actually got it working. Thanks for your help