Questions tagged [glulookat]

gluLookAt is a function in the OpenGL Utility Library (GLU) that defines a view transformation

The gluLookAt() function is a commonly used routine that defines a view transform and applies it to the OpenGL matrix stack. gluLookAt alloed the view to be specified in terms of an eye (or camera) coordinate and a center (or subject) coordinate that the camera should 'look at'.

The term gluLookAt may also refer to the underlying technique of defining a view matrix in terms of eye and center coordinates and an up vector.

The technique works by constructing a matrix equals to the product of an orthonormal basis matrix (a rotation matrix) and the eye coordinate. The orthonormal basis is defined in terms of the 'forward' vector between the eye and center coordinates, and the two vectors orthogonal to it, 'up' and 'side'.

http://www.opengl.org/archives/resources/faq/technical/viewing.htm

97 questions
2
votes
1 answer

OpenGL - set a good distance without glScalef

I try to set a good distance for the full view of a particles disk and in the same time have a valid line scale which represents the current value for the scale of the disk as a function of zooming with mouse. The scene has the following parameters…
user1773603
2
votes
1 answer

gluLookAt() not looking where it should

I don't understand what the glLookAt() function does exactly. I have an object at position x,y,z . I want to place the camera at position x+20,y+20,z+20 while the object is moving, so that it should look like stationary. However, this is not the…
Saiph
  • 510
  • 3
  • 16
2
votes
1 answer

Compatibility function for gluLookAt

I just got a new PC and now have to get my demo program running with SDL2/OpenGL. I used the program to try out various techniques and used gluLookAt (which, obviously, shouldn't be used any more or even never should have been used). Now I'm looking…
s3lph
  • 4,575
  • 4
  • 21
  • 38
2
votes
1 answer

OpenGL - FPS style Camera move with object fixed on camera

I am trying to move a camera in a 3d space. So far I have had success in moving and rotating the camera using this code: void specialKeyHandler(int key, int x, int y) { float fraction = 0.05f; switch (key) { case GLUT_KEY_LEFT : …
Jazib
  • 1,200
  • 1
  • 16
  • 39
2
votes
2 answers

Derivation of (glu)lookAt

I am trying to learn (modern) OpenGL and I am thoroughly confused about the various transformations... The viewing matrix have me confused so I need some clarification. Here's what I have understood about the (conventional) pipeline. Vertices are…
Sumanth
  • 71
  • 6
2
votes
1 answer

Normals inversion because of gluPerspercitve?

Just fooling around with opengl and glut. I was trying to make cube full visibe so I decided that I could make it with gluPerspective(); So here's the code #include #include #include using namespace std; float…
DanilGholtsman
  • 2,354
  • 4
  • 38
  • 69
2
votes
1 answer

Why before using gluLookAt I need to write glLoadIdentity

I found that if I don't use glLoadIdentity before gluLookAT, then I will see blank screen. I don't understand: why?
proggamer12
  • 192
  • 10
2
votes
1 answer

glutLookAt misunderstanding

Lets say I do have the following set up : glBegin(GL_TRIANGLE_STRIP); glTexCoord2f(0,0); glVertex3f(-10, 0, 0); glTexCoord2f(1,0); glVertex3f(10, 0, 0); glTexCoord2f(0,1); glVertex3f(-10, 0, 5); glTexCoord2f(1,1); glVertex3f(10, 0,…
Al_th
  • 1,174
  • 1
  • 12
  • 24
2
votes
1 answer

OpenGL 3D camera gluLookAt

I'm trying to set up a 3D camera with the gluLookAt method. So I have got a 10x10x10 cube and now i want to move the camera inside that cube. I have something like that: gluLookAt( camera->x,camera->y,camera->z, camera->eyeX, camera->eyeY,…
L3M0L
  • 429
  • 8
  • 23
2
votes
3 answers

OpenGL - Rotating around a cube using gluLookAt rotates very quickly

I'm trying to move around a cube centered at the origin using gluLookAt instead of performing the R*T transformation directly on the object. At first, I was not sure how to do this problem. Then I realized (after implementing half of a solution in…
soplu
  • 145
  • 1
  • 8
2
votes
0 answers

glu.LookAt for tilted overhead camera with arbitrary vertical axis orientation

[Edited 09/23/12] Imagine FPS controls (strafe, turn) from a top-down perspective. Now imagine when the player turns the entire screen rotates so they're always facing the top of the monitor. Now imagine the "camera" projecting this is always 10…
2
votes
1 answer

Rotating around a sphere using OpenGL and gluLookAt

Alright, so I'm trying to click and drag to rotate around an object using C++ and OpenGL. The way I have it is to use gluLookAt centered at the origin and I'm getting coordinates for the eye by using parametric equations for a sphere (eyex = 2*…
Billy R
  • 41
  • 6
1
vote
1 answer

OpenGL ES: glOrtho() shows object, but gluPerspective() doesn't

I am showing a textured sqad, centered around [0,0,-10], width and height = 10000. The camera is positioned at [0,0,0] and looks down the negative z-axis (eyepoint=[0,0,0], center=[0,0,-1]): GLU.gluLookAt(gl, 0f, 0f, 0f, 0f, 0f, -1f, 0f, 1f,…
manmal
  • 3,900
  • 2
  • 30
  • 42
1
vote
1 answer

OpenGL Android: X axis is mysteriously flipped

I am displaying a quad in a pseudo-2D canvas via OpenGL. To do so, I use orthographic projection via: gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); gl.glOrthof(-ratio, ratio, -1, 1, 0, 10000); The coordinates of the displayed quad…
manmal
  • 3,900
  • 2
  • 30
  • 42
1
vote
1 answer

how can we make spot lights

i need to draw street lights, but it is illuminating the entire environment, i couldnt make it seem like a spot light. The code below is the one i tried glEnable(GL_LIGHTING); glEnable(GL_LIGHT0) ; GLfloat color[4] = { 1.0, 1.0, 1.0, 1.0 }; …
brtb
  • 2,201
  • 6
  • 34
  • 53