Archived

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

Bruno

world coords to pixel coords

Recommended Posts

Meduzza    122
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