Hello Users,
dunnow if this is the proper forum but this is the problem I have:
I have a set of 3D points in world coordinate.
I have defined this perspective view:
gluPerspective(60, 1.309, 0.00001, 1000000.0);
with a viewport of 872 x 666 pixel wide.
my dataset is visualized properly. I want to recover they position in PIXEL so that I used the glGetFloatv(GL_PROJECTION_MATRIX,…) and glGetFloatv(GL_MODELVIEW_MATRIX,…) to ricover the projection and modelview and simulating the OpenGL pipeline (following the specification). Now, I don’t get back the pixel points…because most of them are negative or and not in the screen size.
So give an PPw (point3D in worldCoordinate) I muliply this point as it follows to get the clipped version:
PPc = projection * modelview * PPw;
is that enough?!
This is the dataset:
{ 0, 0, 0,
-10, -10, -10,
0, -10, -10,
10, -10, -10,
-10, -10, 0,
0, -10, 0,
10, -10, 0,
-10, -10, 10,
0, -10, 10,
10, -10, 10,
-10, 0, 10,
0, 0, 10,
10, 0, 10,
-10, 10, 10,
0, 10, 10,
10, 10, 10,
10, 0, -10,
10, 0, 0,
10,10, -10,
10, 10, 0};
Thank you so much!!
Giancarlo amatigianc@googlemail.com