Well I have the following code in my camera class
public void viewFrom(){
GLU.gluLookAt(_position._x,_position._y,_position._z,_view._x,_view._y,_view._z,_top.getX(),_top.getY(),_top.getZ());
//GL.glViewport(0,0,800,600);
GL.glMatrixMode(GL.GL_PROJECTION);
GL.glLoadIdentity();
GLU.gluPerspective(90,1.25,this._minDepth,this._maxDepth);
GL.glMatrixMode(GL.GL_MODELVIEW);
}
This makes me look at my system from above, now I want todo a selction so I have a selction method.
public void selection(){
// The Size Of The Viewport. [0] Is <x>, [1] Is <y>, [2] Is <width>, [3] Is <height>
IntBuffer viewPort = ByteBuffer.allocateDirect(4*8).order(ByteOrder.nativeOrder()).asIntBuffer();
// This Sets The Array <viewport> To The Size And Location Of The Screen Relative To The Window
GL.glGetInteger(GL.GL_VIEWPORT, viewPort);
System.out.println("view x,y,z" + viewPort.get(1) +","+ viewPort.get(2) +","+ viewPort.get(3) +","+ viewPort.get(4));
GL.glSelectBuffer(ibuf);
GL.glRenderMode(GL.GL_SELECT);
GL.glInitNames();
GL.glPushName(-1);
GL.glMatrixMode(GL.GL_PROJECTION); // Selects The Projection Matrix
GL.glPushMatrix(); // Push The Projection Matrix
GL.glLoadIdentity(); // Resets The Matrix
// This Creates A Matrix That Will Zoom Up To A Small Portion Of The Screen, Where The Mouse Is.
GLU.gluPickMatrix( (double)Mouse.dx, (double)(viewPort.get(3)-Mouse.dy), 5.0f, 5.0f, viewPort);
//GLU.gluPerspective(_camera.get_fow(), _camera.get_aspect(), _camera.get_minDepth(), _camera.get_maxDepth());
GL.glMatrixMode(GL.GL_MODELVIEW);
GL.glLoadIdentity();
//GLU.gluOrtho2D (0.0, 3.0, 0.0, 3.0);
drawSystem();
GL.glMatrixMode(GL.GL_PROJECTION); // Select The Projection Matrix
GL.glPopMatrix();// Pop The Projection Matrix
GL.glMatrixMode(GL.GL_MODELVIEW);
int hits =GL.glRenderMode(GL.GL_RENDER);
my problem is that the world rendered in GL_SELECT is NOT the same as my world seen from the camera class… How the hell do I do that???
