   Object world coordinates using gluLookAt
  I have a game up and running that uses gluLookAt to basically look down on a terrain that you can fly over.  The function works well for what I need, however I have hit a problem, and I''m wondering if there is an easy solution.Basically, because gluLookAt arranges things such that the origin is where the camera is, it messes with translating objects to their world coordinates.  Say if the world coordinates of the view position are 100, 200, 100, after gluLookAt, that effectively becomes 0, 0, 0, and if I try to draw an object at 0,0,0 in world space, it''s rendered right where the viewpoint is at.I''ve read about how I can get the camera world coordinates, and from that I could translate things into the right positions probably, but I''m wondering if there is an easier way.Thanks 
  That is the process of clipping. ;  No, I''ve fixed the problem actually by not using gluLookAt.  The problem was not with clipping because it was not hard to get the object I wanted to display, it just was not being positioned correctly because gluLookAt alters the layout such that the camera is at 0,0,0.  So if you used gluLookAt to actually look at 0,0,0, the object would not be drawn there, it would be drawn wherever you tell it your camera is.  Basically, I didn''t want to have to fix things to show up where they should.  The fix was to stop using gluLookAt, and to just do the camera work myself. ;quote:Original post by Cor  So if you used gluLookAt to actually look at 0,0,0, the object would not be drawn there, it would be drawn wherever you tell it your camera is.  Basically, I didn''t want to have to fix things to show up where they should.  The fix was to stop using gluLookAt, and to just do the camera work myself.   you really shouldnt try to guess whats happening by looking at the result. glulookat in no way works the way you seem to thing. in fact, the "camera" is at the origin if you DONT call glulookat. its your decision if you consider the camera somewhere else or all other objects moved the other direction (mathematically thats whats happening). that means, the origin in your example is NOT at 100,200,100 but (if you only moved and didnt rotate the camera) at -100,-200,-100. i dont know what you did with glulookat, but: ALWAYS load the identity before calling it, call glulookat before you do anything else and NEVER call loadidentity after that (except you call glulookat again right after that).;quote:Original post by Cor  So if you used gluLookAt to actually look at 0,0,0, the object would not be drawn there, it would be drawn wherever you tell it your camera is.In other words, you had a bug in your own code and you gave up. gluLookAt works very well. For ex.:glMatrixMode(GL_MODELVIEW);glLoadIdentity();gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);drawCubeAt(0, 0, 0);  Will place your camera 10 units on the Z axis, directly looking at the front side of the cube.If your object is still placed at your camera''s position after gluLookAt, you''ve done something wrong. Please do not blame it on gluLookAt having a bug.Y.