Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Sir Psycho

Really simple 3d question

This topic is 6415 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, im writing a 3d engine, and i have a REALLY STUPID problem. I have a function which you pass the 3d coordinates x y and z, then it returns the 2d coordinates to be drawn on the screen. Here is the calculation: LENS = 256 Distance = (LENS-Z); ScrX=(LENS*X/Distance)+(SCREEN_WIDTH/2) ScrY=(SCREEN_HEIGHT/2)-(LENS*Y/Distance) I have an aircraft which you pilot, and some terrain. But when you fly over the terrain, it goes comes shooting out at the top of the screen at twice the speed!!! whats going on ?!?!?!

Share this post


Link to post
Share on other sites
Advertisement
x_2D = center_x + LENS * ( x_3D / z_3D )
y_2D = center_y - LENS * ( y_3D / z_3D )

Hope this helps!



-------------------------------
I'll screw up whoever screws around with the gamedev forum!

..-=gLaDiAtOr=-..

Share this post


Link to post
Share on other sites
Dear GOD that makes no sense to me! Ahh well, I r new at this 3d crap.

Never argue with an idiot, they drag you down to their level and then beat you with experience.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!