# Problem with gluLookAt and path.

This topic is 4235 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello! I have a 3d scene. My camera is flying trough this scene using path. This path is an array of vertex coordinates (z,y,z) and i'm using gluLookAt function here. My problem is that the fov is not stable and i know why, but i can't solve it. Please look at the pseudo: vector3f eye_pos = path_array[ i ]; vector3f look_at = path_array[ i + 4 ]; glLookAt( eye_pos, look_at, up_vector); If i'm right, the distance between position at and [i+4] is not constant. And as a result i can't get the smooth flying effect. I'm right ? Please, give me some advices about this things. n.b.: this path array was taking from the obj file, that was maded by our designers.

##### Share on other sites
Quote:
 Original post by limpacpHello!I have a 3d scene. My camera is flying trough this scene using path. This path is an array of vertex coordinates (z,y,z) and i'm using gluLookAt function here. My problem is that the fov is not stable and i know why, but i can't solve it.Please look at the pseudo:vector3f eye_pos = path_array[ i ];vector3f look_at = path_array[ i + 4 ];glLookAt( eye_pos, look_at, up_vector);If i'm right, the distance between position at and [i+4] is not constant.And as a result i can't get the smooth flying effect. I'm right ?Please, give me some advices about this things.n.b.: this path array was taking from the obj file, that was maded by our designers.
I'm not sure what you mean by the 'fov not being stable', but other than that it seems you're asking how to move a camera smoothly (and perhaps at constant speed) along a path.

With a path represented as a parametric curve, you can achieve both smooth motion (easy) and constant speed (a little harder). If all you have is a sequence of control points, you may need to first somehow fit a spline or series of splines to these points (there may be other solutions to this problem as well that I'm not thinking of at the moment).

Also, keep in mind that if at any point the path is parallel to the direction of up_vector, the 'look at' algorithm may fail. If the path is constrained such that you know this will never happen, you don't need to worry about it. Otherwise you might look into using a parallel transport frame rather than a fixed reference frame.

Finally, this topic is only tangentially related to OpenGL. If you need help with the parametric curve aspect of the problem, you'll probably have more luck in Math & Physics (maybe a mod will move this there).

##### Share on other sites
What do you mean the *fov* is not stable?
'fov' refers to the number of degrees that the view frustum covers -how wide angle your lens is. -ie zoom
gllookat Should Not be altering your camera's zoom; all it does it aim it in different directions.
I think perhaps we have a confusion of the terminology here?

Maybe you meant that the camera itself is unstable? as in jerky motions?

1. 1
Rutin
26
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 10
• 9
• 9
• 46
• 41
• ### Forum Statistics

• Total Topics
631750
• Total Posts
3002067
×