Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Gaming > Development Programming Algorithms > perspective pro...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 638 of 670
Post > Topic >>

perspective projection

by bob@[EMAIL PROTECTED] Aug 14, 2007 at 10:39 PM

I always see these complicated and poorly explained formulas for
 perspective projection, and I'm not sure if I'm doing it right.

Let's say I have the 3d point a.

Now let's say the new 2d screen coordinate is a2d.

Is this code correct for converting the 3d point to 2d?


	Vertex2d a2d;

	a2d.x = a.x / a.z * SCREENWIDTH;
	a2d.y =  -a.y / a.z * SCREENHEIGHT;

	a2d.x = a2d.x/2.0f + SCREENWIDTH/2.0;
	a2d.y = a2d.y/2.0f + SCREENHEIGHT/2.0;



If not, what's wrong with it?

Thank you.




 3 Posts in Topic:
perspective projection
bob@[EMAIL PROTECTED]   2007-08-14 22:39:03 
Re: perspective projection
"[Jongware]" &l  2007-08-16 00:30:16 
Re: perspective projection
Tom Plunket <gamedev@[  2007-08-17 21:08:41 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 20:47:37 CDT 2008.