Getting rendered vertex coordinates

Started by
3 comments, last by Onk 18 years, 1 month ago
I am looking for a way to find out the coordinates on the window of a rendered vertex. I tried some stuff with gluProject, but ran into a dead end there, and looked through a list of glGet parameters but couldn't find anything that looked helpful. Thanks for any help.
Advertisement
gluProject() should work, given the correct parameters. What sort of problems did you run into?
In the setup I'm using, gluProject is defined as
public static extern int gluProject( double objx, double objy, double objz, double modelMatrix, double projMatrix, int viewport, ref double winx, ref double winy, ref double winz );

Everything I read says that modelMatrix, projMatrix, and viewport should all be arrays.

My code looks like
double[] projMat = new double[16];double[] modelMat = new double[16];int[] viewport = new int[4];GL.glGetDoublev(GL.GL_PROJECTION_MATRIX, projMat);GL.glGetDoublev(GL.GL_MODELVIEW_MATRIX, modelMat);GL.glGetIntegerv( GL.GL_VIEWPORT, viewport );double winX=0, winY=0, winZ=0;GLU.gluProject(0,0,0,modelMat,projMat,viewport,ref winX, ref winY, ref winZ);


As you can see, it's using arrays for those three arguments, so it won't compile.

I'm using c#.
I don't know c#, so I can't tell you why it won't compile. I'm sure somebody else can though. In any case, you should give gluProject() a chance before pursuing other solutions; it really should work.
I just changed that "bridge" file to want arrays instead, and everything worked. Thanks!

This topic is closed to new replies.

Advertisement