Talk About Network

Google


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 > Re: perspective...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 638 of 680
Post > Topic >>

Re: perspective projection

by Tom Plunket <gamedev@[EMAIL PROTECTED] > Aug 17, 2007 at 09:08 PM

bob wrote:

> 	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;

(I'd suggest adding parentheses to make the order of operations
explicit.)

"Right" depends on what exactly you're trying to accomplish.  Certainly
this will transform points from one set of values to another.

Doing the algebra, (I think) this is the same as:

a2d.x = (((a.x * width) / a.z) + width) / 2

Is this what you intend, and what effect are you looking for?


-tom!

--
 




 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 Sat Jul 26 2:14:13 CDT 2008.