Gelero
05-12-2004, 09:47 AM
Hi everyone... Can somebody help me?
Im trying to find 3d coord on mouse click event.
And i'm getting a weird error.. viewport, mvmatrix, projmatrix are null after those callings...
int viewPort[] = null;
double mvMatrix[] = null;
double projMatrix[] = null;
double objX[] = null;
double objY[] = null;
double objZ[] = null;
gl.glGetIntegerv( GL_VIEWPORT, viewPort );
gl.glGetDoublev( GL_MODELVIEW_MATRIX, mvMatrix );
gl.glGetDoublev( GL_PROJECTION_MATRIX, projMatrix );
float realY = viewPort[3] - (int)evt.getY() - 1;
glu.gluUnProject( (double)evt.getX(), (double)realY, (double)0.0, mvMatrix, projMatrix, viewPort, objX, objY, objZ );by the way.. this code only run when mouse click event is found. and I'm using gluLookAt.
Why is that null?
and im working with java(jbuilderX)
thank you thank you aaaaand thank you
Im trying to find 3d coord on mouse click event.
And i'm getting a weird error.. viewport, mvmatrix, projmatrix are null after those callings...
int viewPort[] = null;
double mvMatrix[] = null;
double projMatrix[] = null;
double objX[] = null;
double objY[] = null;
double objZ[] = null;
gl.glGetIntegerv( GL_VIEWPORT, viewPort );
gl.glGetDoublev( GL_MODELVIEW_MATRIX, mvMatrix );
gl.glGetDoublev( GL_PROJECTION_MATRIX, projMatrix );
float realY = viewPort[3] - (int)evt.getY() - 1;
glu.gluUnProject( (double)evt.getX(), (double)realY, (double)0.0, mvMatrix, projMatrix, viewPort, objX, objY, objZ );by the way.. this code only run when mouse click event is found. and I'm using gluLookAt.
Why is that null?
and im working with java(jbuilderX)
thank you thank you aaaaand thank you