I'm trying to set up a VBA program that will take a list of x,y,z plot points (points of a 3D object) and draw them on a 2-dimensional plane (excel) based on a certain perspective/angle and distance from the viewer.
How the heck do I do this?
I've read some things on perspective projection (such as: http://www.math.utah.edu/~treiberg/Perspect/Perspect.htm), which seems to be the concept that I'm looking for, but I get lost in all the mathematical stuff and am not sure how to translate it into VBA.
So lets say x, y, z is the coordinate (in 3D space) of one of the corner points of that cube.
a, b, c is the coordinate (in the same 3D space) of the viewer. What is the formula (in VBA compatible terms) to get the u, v coordinate (2D plot point on the 'drawing plane') that would be seen from the viewers perspective? Given the 3D space that the drawing plane is in (distance from the object and the viewer and angle -- I'm not sure exactly how to factor these in...).
Thanks for any help!
How the heck do I do this?
I've read some things on perspective projection (such as: http://www.math.utah.edu/~treiberg/Perspect/Perspect.htm), which seems to be the concept that I'm looking for, but I get lost in all the mathematical stuff and am not sure how to translate it into VBA.
So lets say x, y, z is the coordinate (in 3D space) of one of the corner points of that cube.
a, b, c is the coordinate (in the same 3D space) of the viewer. What is the formula (in VBA compatible terms) to get the u, v coordinate (2D plot point on the 'drawing plane') that would be seen from the viewers perspective? Given the 3D space that the drawing plane is in (distance from the object and the viewer and angle -- I'm not sure exactly how to factor these in...).
Thanks for any help!