Archived

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

world coords to pixel coords

This topic is 6279 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

1. Transform XYZ to camera space: multiply XYZ by camera matrix.
2. Project XYZ-in-camera-space on screen:

xScreen = ( x / z * focus ) + screenWidth/2;
yScreen = ( y / z * focus ) + screenHeight/2;

Where "focus" is some constant, usually close to screenWidth/2.
Or, more exact:

focus = (screenHeight/2) / tan( FOV/2 );

...
Or use projection matrix.


Edited by - Meduzza on October 3, 2000 11:30:39 AM

Share this post


Link to post
Share on other sites