Advertisement

Anyone have any ideas on GTA style buildings

Started by June 05, 2001 07:42 PM
0 comments, last by Lacrosse2000 23 years, 8 months ago
I am interested in doing a game and I want the buildings to be like GTA (Grand Theft Auto). This portion of the code needs to go fast. What I was thinking was that, since I will never zoom out, there shouldn''t need to be any matrix math and that given the X, Y, and Z pos (in screen space, not world space), there should be a consistent equation to project it onto the screen. Can anyone think of any equation which might to this? My description probably sounds about as clear as mud. Thanks, Mike Henry
Two suggestions:

Use a perspective projection matrix. So you''re not going to need it for much, but on better cards, the transform should be handled by the card rather than the CPU (I think), which could potentially make this faster than anything you can code yourself.

If you have to do it yourself, make sure your "virtual Z coordinate" will always be positive (non-zero). Then do your drawing in reverse Z order (i.e. ground first, tops of buildings last). Before the last draw command, divide your X and Y values by the Z value. That _should_ be all you need to do. Oh, and you might want to divide by a scalar times the Z value, so things don''t look TOO distorted... or you could just adjust what Z values you use accordingly.

--Tr][aD--
--Tr][aD--

This topic is closed to new replies.

Advertisement