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
0
votes
1 answer

FPS weapon with gluLookAt

I'm developing a 3D maze-like game, just for learning(and of course for fun :) ). I have made the maze, I can move between the walls in First-Person mode. My only problem is, that I want some kind of weapon for my First-Person view( like an FPS…
Slenkra
  • 820
  • 1
  • 8
  • 14
0
votes
1 answer

does gluLookAt has impact on glRotate/glTranslate/glScale?

I have following code : glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt (0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 0.1, 20.0); glRotatef ((GLfloat) 45, 0.0, 1.0, 0.0); glRectf(-1,-1,1,1); the rectangle will be rotated around…
suitianshi
  • 3,300
  • 1
  • 17
  • 34
0
votes
1 answer

Isometric Projection with gluLookAt

I have this house centered in the origin at (0,0,0) with dimensions 10x10x20. I want to make an isometric projection but the house is not displayed.Here is the code for the house: glBegin(GL_TRIANGLES); //roof glColor3f(1,1,0.35); glVertex3f(-5,…
user1851735
0
votes
1 answer

GL_INVALID_OPERATION when calling gluLookAt

I've been getting into OpenGL on OS X lately (tl;dr: I'm a OpenGL noob) and got some code working that draws a cube. However, I don't see any of the faces (besides the front) since my view isn't translated. I try to use the gluLookAt function to do…
Tristan
  • 3,058
  • 6
  • 40
  • 68
0
votes
1 answer

Emulating gluLookAt with glm::Quat(ernions)

I've been trying to emulate gluLookAt functionality, but with Quaternions. Each of my game object have a TranslationComponent. This component stores the object's position (glm::vec3), rotation (glm::quat) and scale (glm::vec3). The camera calculates…
Brett
  • 159
  • 1
  • 8
0
votes
1 answer

Freedom of movement

I am a little stuck with making freedom of movement with the mouse in OpenGL, what I want is to have the controls of a 3D model making program. I am using Windows. Here is my viewport structure, pretty standard: struct viewport { float x; …
Jimmay
  • 959
  • 3
  • 13
  • 27
0
votes
1 answer

opengl glulookat strange behavior

can someone please explain me why is the camera in my code moving on every onIdle callback? I am not changing any parameters so it seems to me that it should display the same all the time. Still cannot figure it out by myself, thanks for…
0
votes
1 answer

how to convert modelview matrix to gluLookAt parameters?

I had a requirement in Bullet physics with Opengl where I have modelview matrix but need to get the same matrix by calling gluLookAt. Thanks in advance.
0
votes
2 answers

Please can you explain my gluLookAt() misconception?

I have learned from reading many sources and by re-implementing the function and studying the matrices myself, that gluLookAt() is equivalent to a rotation followed by a translation to the inverse eye coordinate. The implementation is similar in…
0
votes
1 answer

How to set the camera within a cube?

I have cube which has different color to each side-lock - public void display(GLAutoDrawable drawable) { final GL gl = drawable.getGL(); gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); ///// SET CAMERA …
URL87
  • 10,667
  • 35
  • 107
  • 174
0
votes
1 answer

Loading ModelViewMatrix using glulookat

I have defined a matrix that contains the position and orientation of the camera similar to the GL_MODELVIEW matrix: (m3 = 0; m7 = 0; m11 = 0; m15 = 1) I'm trying to load this data into the ModelViewMatrix. I'm thinking in this two…
Dani Corretja
  • 311
  • 1
  • 7
0
votes
1 answer

gluLookAt and MODELVIEW MATRIX

I feel like I understand the usage of the modelview matrix and gluLookAt. That is, by declaring gluLookAt(ex,ey,ez,lx,ly,lz,ux,uy,uz), one can easily set up a way to look at a certain point directly. My question is - since gluLookAt postmultiplies…
geogaddi
  • 565
  • 1
  • 8
  • 18
0
votes
1 answer

Rotate camera NOT scene without gluLookAt

I'm created a grid to represent ground to walk on. I've got my arrow keys linked up to rotate/move the view: switch(currentKey) { case sf::Key::Up: z_trans+=1; break; case sf::Key::Down: …
Dezachu
  • 153
  • 1
  • 2
  • 10
0
votes
1 answer

Why isn't this square in the middle of the screen?

I wrote some code, expecting to see a square in the middle of the screen, instead the square appears higher up, in some aspect ratios near the top of the screen, and slightly to the left. With another aspect ratio: Here's the relevant part of my…
bobbaluba
  • 3,584
  • 2
  • 31
  • 45
0
votes
1 answer

glulookat "resets" after movement (with android)

here's my problem: I'm making a pool game in android and I want to make the camera rotate freely around the center of the table. The thing is that when I stop my movement it looks like the glulookat resets itself because I only see the same thing…