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

Calculating the front vector and look at vector

I have got a homogeneous matrix of shape 4x4. How do I retrieve the front vector and the look at vector from the homogeneous matrix? Following is my homogeneous matrix, pose = np.array([…
user1241241
  • 664
  • 5
  • 20
0
votes
0 answers

pyOpenGL Is it necessary to draw an object every time when call glReadPixels?

I want to get depth buffer images that have been captured from different views of a 3D object. To do this with pyOpenGL I use the following code def get_depth(LookAt_x, LookAt_y, LookAt_z) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) …
HYY
  • 1
  • 1
0
votes
1 answer

Is it possible to use gluLookAt with a Vertex Shader?

After a fairly long Google Session I have enough from it! I had a python/opengl application with some simple Quad's where I used gluLookAt to move around on the scene. Then I needed just 1 Texture on one of those Quad's, so I obviously use a shader…
noscript
  • 77
  • 1
  • 12
0
votes
0 answers

How to rotate camera and move forward to the direction (glulookat)

switch(key) { case 'w': // W - Go forward x += lx * movement; z += lz * movement; break; case 's': // S - Go back x -= lx * movement; z -= lz * movement; break; case 'd': // D - Turn right angle += 0.05; lx =…
Streetakos
  • 25
  • 3
0
votes
1 answer

How do I deal with OpenGL's function of gluLookAt successfully?

Trying to implement a 3D roaming camera in my python and pygame 3D OpenGL game is something I've been trying to do, but I hit a roadblock. Every time I try to use the gluLookAt function, the camera just freaks out and yanks around while the x and z…
0
votes
1 answer

opengl glulookat warping object

First off apologies, I think i have had multiple entries with similar problems but have not been able to fix my issue as i dont believe i was able to explain my problem properly hopefully the crudely drawn image will help explain my problem. I have…
user3074140
  • 733
  • 3
  • 13
  • 30
0
votes
1 answer

Proper gluLookAt for gluCylinder

I'm trying to draw a cylinder in a specific direction with gluCylinder. To specify the direction I use gluLookAt, however, as so many before me, I am not sure about the "up" vector and thus can't get the cylinder to point to the correct…
x squared
  • 3,173
  • 1
  • 26
  • 41
0
votes
2 answers

How to use LookAt matrix in vertex shader

Let's say I have the following vertex shader code below: attribute vec4 vPos; uniform mat4 MVP; uniform mat4 LookAt; void main{ gl_Position = MVP * vPos; } How do I use the LookAt matrix in this shader to position the eye of the camera? I…
CodingNinja
  • 65
  • 1
  • 7
0
votes
1 answer

Understanding gluLookAt

I'm drawing axes at origin and keeping them fixed in position, I'm trying to rotate my camera with glLookAt: glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); DrawAxes(); // Draws X-axis in…
IssamTP
  • 2,408
  • 1
  • 25
  • 48
0
votes
1 answer

PyOpenGL: gluLookAt behaviour?

I am trying to get different perspectives in 3D on a OpenGL window. If you run the code (with anything to do with gluLookAt commented out) and left click the red line point at the place you clicked, right click and the green line aligns to where you…
DrBwts
  • 3,470
  • 6
  • 38
  • 62
0
votes
0 answers

Making OpenGL Camera Look At A Point

I'm working on a game in Java using LWJGL and I'm trying to make it rotate to look at a point in 3D space. I have tried every "lookAt" method I can find on the internet, But I just can't get it to work (The camera just doesn't look in the right…
Robo11
  • 45
  • 6
0
votes
1 answer

OpenGL. gluLookAt function not working

This is an image which I draw with my program: [IMG] http://i62.tinypic.com/j163j8.png [/IMG] It is supposed to be 3D. When I try to check it with gluLookAt: GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); …
Shpooke
  • 60
  • 1
  • 6
0
votes
1 answer

Problems understanding gluLookAt xyz rotation in FPS scenario

I'm having trouble with gluLookAt. My camera can rotate along the X and Y axis by piping in relative mouse motion events. The problem is the Z axis - I don't know how to calculate it. So, my camera can look up, down, left and right. But I can't work…
0
votes
0 answers

Rotate scene around object at centre

I have an object which is at (0.0, 0.0, -39.0) and never moves, the rest of the scene moves relative to this object; I want the camera to look at this object and at the same direction. When I do this: gluLookAt(0.0, 120.0, 10.0, 0.0, 0.0, -39.0,…
DARKMATTER
  • 361
  • 5
  • 14
0
votes
1 answer

gluLookAt is optional?

I am new to Open GL / Open GL ES. I am a Android developer and exploring Open GL myself. Is really very difficult to understand but day by day I am making progress merely because of you peoples :) Now lets come to my problem. I downloaded 2 sample,…
Amit Yadav
  • 32,664
  • 6
  • 42
  • 57