graphics scales and the x, y, z, plain
Any advice is greatly appreciated.
In other words, the screen will never be anything other than x & y axes. To get the Z axis figured in requires math.
All the objects in a 3D world have local coordinates which apply to their vertices (points). Prior to rendering, these local coordinates are converted to World coordinates, which are then converted to camera coordinates. All of these use x, y & z axes. When it comes time to render to the screen however, you can either drop the z value and render the final x & y coordinates
(parallel projection), in which case the object will always be the same size, or you can use Perspective projection, meaning the object will shrink or grow according to the z value, giving the illusion of depth.
The basic formula to get the correct x & y values for perspective projetcion is:
x_perspective = viewing_distance *x/z
y_perspective = viewing_distance *y/z
To actually use these coordinates you also need to figure the width & height of the screen. You may also need to figure in an aspect ratio. But they are ultimately derived from the objects local coordinates, which means you have to do all the conversions, too.
This comes from things I've studied. I've never programmed my own engine. I just use what's available (and rarely).
[This message has been edited by Aldacron (edited October 29, 1999).]
--- Official D Blog | Learning D | The One With D | D Bits