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
1
vote
2 answers

Legacy openGL - light is wrongly moving with glulookat orientation

I'm seeking help as I'm having a hard time trying to draw a fixed spot light in my mesh renderer. I'm currently doing something like: gluLookAt(...) DrawMesh(...) float pos[] = {0, 500, 0, 1}; glLightfv(GL_LIGHT0, GL_POSITION, pos); where I init…
Tides
  • 17
  • 4
1
vote
1 answer

pyopengl gluLookAt() clarity

I'm trying to understand what I'm doing wrong displaying two different cubes with a grid through the x and z axis. I'm using gluLookAt() to view both cubes at the same angle. I'm very confused why the first viewport does not show the grid but the…
symanoz
  • 51
  • 4
1
vote
2 answers

OpenGL renders nothing after using gluLookAt

This is my source If I build this source without the function I can see only 2 lines. But I want to see the 'z'axis. So I added the gluLookAt() function but I can see just black screen. What's wrong with my code? Is the camera's point of view is…
1
vote
1 answer

OpenGL LookAt Confusion

I read online that if we want to directly compute the world to view matrix we can use OpenGl's LookAt function If you have the camera position, the position where the camera is looking at and an up-vector. However, here is my confusion, the…
Belphegor
  • 1,683
  • 4
  • 23
  • 44
1
vote
1 answer

OpenGL - wrong objects positioning - gluLookAt()

I've got a taks from university and have to make a small example of solar system, the objects have to rotate etc. The problem is that when I do not call GluLookAt() everything looks fine, but I would like to change the view and when I call the…
1
vote
1 answer

Rotate camera in own coord using gluLookat and glMultMatrixf

I have to change a camera implementation built with gluLookat and glMultmatrixf. The camera implemented is an arcball camera where the camera rotates around a point. Orientation of the camera is by //set…
kevin0228ca
  • 479
  • 1
  • 8
  • 17
1
vote
1 answer

openGL - Rotating above and below an object using gluLookAt

I have a cube in open GL. I have the cube rotating by multiplying by the rotation matrix. I have also got the camera rotating around the cube on the x axis using gluLookAt as you can see below. case 'j': eyeX = 10*cos(angle); …
Josh Horton
  • 77
  • 1
  • 1
  • 7
1
vote
0 answers

Camera following an object OpenGL

I want to implement a camera that follows my 3D object (a car). To set the camera I use the following structure: glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45, 1, -5, 5); glMatrixMode(GL_MODELVIEW); …
Miguel
  • 89
  • 2
  • 9
1
vote
2 answers

rotating camera in OpenGL using Glut libraries and gluLookAt

I am trying to implement a software in OpenGl which is able to draw a Lorenz system. I achieved my purpose but in a static way: the system is drawn once and that's all. Now I want to move my camera around the system and show the 3D-ness of the…
Tarta
  • 1,729
  • 1
  • 29
  • 63
1
vote
1 answer

OpenGl GluLookAt. Cannot orient object

I have 2 objects in different coordinate systems: planet and cylinder. I have eye coordinates of both objects. I want to orient cylinder along vector that connects it and the planet. glLoadMatrixf( PlanetTransform); // .. draw planet …
Zheden
  • 583
  • 2
  • 11
  • 36
1
vote
1 answer

OpenGL ES 2.0 setLookAtM

I have, a problem with the setLookAtM function. My goal is to create a cube within a cube something like this (yep, it's paint :P ): So basically everything works... almoust... I have the smaller cube and I have the bigger one. However, there is a…
L3M0L
  • 429
  • 8
  • 23
1
vote
1 answer

OpenGL gluLookAt why the up vector instead of an angle

I understand that in OpenGL, we use the gluLookAt to place the camera relative to the world and thus define the image that would be drawn. The "eye" specifies the position of the camera and the "center" specifies the point the camera is pointing…
nutsiepully
  • 1,066
  • 3
  • 14
  • 21
1
vote
1 answer

OpenGL in Java, Manual creatation of gluLookAt matrix

I've been experimenting with using matrix manipulation instead of using the euler or quaternion based functions that come with Open GL ES (and the ulti lib). I can get most stuff working, however I can't recreate the gluLookAt function quite right,…
DiscoStu
  • 559
  • 6
  • 15
1
vote
2 answers

Does gluLookAt() have a limit on smallest argument size?

I have an OpenGL program which works when I call this: gluLookAt(0.1,0.1,0.1, 0,0,0, 0,0.1,0); ... but not when I call this: gluLookAt(0.01,0.01,0.01, 0,0,0, 0,0.01,0); (In the latter case, a blank screen occurs.) Does gluLookAt have a…
FreelanceConsultant
  • 13,167
  • 27
  • 115
  • 225
1
vote
1 answer

Changing camera position in 2D game OpenGL

I'm beginner in making games in OpenGL. I drew a map (this is world, there player can move) and now I want to do, that camera follows the player (player is in center of the screen). I've done something like this: GLU.gluLookAt(gl, …
Piotrek
  • 10,919
  • 18
  • 73
  • 136