PDA

View Full Version : Projection of 3D Object to a 2D Plain in a XYZ coordinate system



steveee
07-21-2004, 09:41 PM
Hello!

Does anybody of you have an idea how to project a 3D Object to a 2D Plain? My 3D Object consists of many tetraeders (with different colors) and therefore is a polyeder.
What I have is a polyeder that is in a XYZ coordinate system and that I want to project to a XY or YZ etc. plain (with the corresponding colors). I thought about drawing all triangles of the tetraeder of the polyeder in a certain row so that I finally have some kind of projection, but I dont know how I should sort the triangles before drawing them. Another but more complex idea is to find the collision point of a parallel ray (parallel to the not included Axis) with the polyeder - and project it to the corresponding plane, but honorly I have no idea how to realize it. Do you have any idea how to make it (if possible as easy as possible:)) - maybe you can give me a bit of a code? Thanx in advance,
Stefan

plasmonster
07-26-2004, 10:15 AM
Does anybody of you have an idea how to project a 3D Object to a 2D Plain?To project an arbitrary point P onto an arbitrary plain

P' = P + N * (D - dot(P,N))

where D is the plane's distance, and N is the plane's normal. Just slide P along the normal by the difference in distances.

The rest of your post sorta lost me. Could you explain some more? This might be better in the math forum...