Advertisement

gluLookAt problem.

Started by January 23, 2001 06:42 PM
1 comment, last by Xersist 23 years, 10 months ago
I''m having some trouble getting the gluLookAt routine to do what I want. I know it has to be a simple solution that I am over looking. Any help would be GREAT! gluLookAt( eyex, eyey, eyez, centerx, centery, centerz, 0, 1, 0); When the eyez corrds. get to less then zero the view does a 180 and starts going in the oppsite direction. How can I get the camra to move in the same direction and keep going without doing a 180? If you know what I mean then please help. If not I''ll ramble a little more here. Given the below code... gluLookAt( objX, objY, forwardback, objX, objY, 0, 0, 1, 0); if "forwardback" = 10 and I start deincrementing it, the view moves forward... when keeps going and gets to a negitive number, my "view" does a 180 and starts backtracing my movements... but my object i''m tracking keeps going in the same direction. I can follow my object as long as the forwardback never goes to a negitive number. So, what do i have to do to follow my object no matter what? I just can''t seem to see the solution. Any small example code? Is there a formula? You can also email @ jim@scn.net if need be. Thanks!
-X-
If your object moves, then somewhere in your code you must be able to get the cordinates of the object(x,y,z). Then you insert in gluLookAt(eyex, eyey, eyez, OBJECT_X, OBJECT_Y, OBJECT_Z, up_x, up_y, up_z)

The view will focus on the object and you *only* have to manipulate eye_x, eye_y, eye_z

Hope it''s helps.

Mvh
Søren Olesen
Advertisement
If your object moves, then somewhere in your code you must be able to get the cordinates of the object(x,y,z). Then you insert in gluLookAt(eyex, eyey, eyez, OBJECT_X, OBJECT_Y, OBJECT_Z, up_x, up_y, up_z)

The view will focus on the object and you *only* have to manipulate eye_x, eye_y, eye_z

Hope it''s helps.

Mvh
Søren Olesen

This topic is closed to new replies.

Advertisement