Skip to content
Discussion options

You must be logged in to vote

Generally speaking, you would multiply the 3D point by the modelview and projection matrices and then scale that value to the viewport size.

pseudocode:

clip = projectionMatrix * viewMatrix * point3D;
ndc = (clip.xy + 1.0) * 0.5;
screen = viewport.xy + (ndc * viewport.size);

You can find the matrices and viewport in the vsg::Camera object.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@hasanshamsijeze
Comment options

Answer selected by hasanshamsijeze
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants