joem@sugar.hackercorp.com (Joe Mullally) (06/04/91)
Note: I posted this for a user who doesn't have post access. Send all
replies to HIM, not me.
-------------------------- message ----------------------------------
Well, I took the auto-message's advice and used the fabled "divide
by depth" system to create 3D perspective. However, there are
several problems.
1) Say I want to make a 100x100x100 cube. If I divided the x and y
by what I want for the depth, I get 1 and 1, which produces a
rectangle that stretches all the way to the 0,0. To conventional
artists the origin in this case is called the "vanishing point."
How do I convert my units (pixels) into "depth units" (for lack
of a better term)? And how do I calculate my viewpoint's
distance from the origin? Or how do I establish my viewpoint?
2) If I want to slide along the x or z axis, all I need to do is shift
all the pixel definitions left or forward, but how do I rotate along
the y axis? (I'm defining x & y as the x & y on a screen, with z
being depth) I'm thinking of rotating the origin with a constant
radius around my viewpoint (0,0,?) and using a secondary origin at
a right angle from the original origin (initially 0,0,0 and 0,-?,?)
and when my rotation hits 45deg, switching my control origin to
the one which (at that point{) is -45deg and continuing to 0.
Any suggestions? Any fast algorithms for such? I tried the books
on the auto-message's list, but I couldn't find any of them
(Bookstop was out) and the graphics books I did find were totally
unintelligible to a layman/high-school math guy like me...
PLEASE respond in E-mail, my news system doesn't allow threading...
peterc@sugar.neosoft.com "Listen, there's a hell of a good
peterc@sugar.hackercorp.com universe next door. Let's go!"
(take your pick) -e e cummings