Projecting a 3D point to 2D screen coordinate OpenTK
Posted
by
sinsro
on Stack Overflow
See other posts from Stack Overflow
or by sinsro
Published on 2011-10-08T13:08:56Z
Indexed on
2012/10/06
15:37 UTC
Read the original article
Hit count: 439
Using Monotouch and OpenTK I am trying to get the screen coordinate of one 3D point. I have my world view projection matrix set up, and OpenGL makes sense of it and projects my 3D model perfectly, but how to use the same matrix to project just one point from 2D to 3D?
I thought I could simply use:
Vector3.Transform(ref input3Dpos, ref matWorldViewProjection, out projected2Dpos);
Then have the projected screen coordinate in projected2DPos. But the resulting Vector4 does not seem to represent the proper projected screen coordinate. And I do not know how to calculate it from there on.
© Stack Overflow or respective owner