Jump to content

  • Log In with Google      Sign In   
  • Create Account


gluLookAt for in_game_world_objekts?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 uncutno   Members   -  Reputation: 146

Like
Likes
Like

Posted 27 June 2001 - 11:17 AM

I have a 3D game world! I use gluLookAt to set the "camera" , so that i see the world from the right pos, in the right direction. In my world, i have a ship! It have a position, a facing_direction_vector, and a up_direction_vactor! How can i use these vectors to rotate and transforme the ship? I think i need to use glPushMatrix, and glPopMatrix to set and restore the world matrix, but what about the code betwen? Please help! :-) -Anders-Oredsson-Norway-

Sponsor:

#2 Obelix   Members   -  Reputation: 122

Like
Likes
Like

Posted 27 June 2001 - 08:46 PM

It depends on where the ship is pointing from the start without roatations. glRotate is used to rotate around any arbitary axis.
Why not give it a try before asking for help?
You can start by identify the axis you want to rotate around.

#3 uncutno   Members   -  Reputation: 146

Like
Likes
Like

Posted 28 June 2001 - 01:15 AM

Thats my problem! I will not use degrees, but instead i use directional vectors! This is because of my physic engine!

-Anders-Oredsson-Norway-

#4 smitty1276   Members   -  Reputation: 560

Like
Likes
Like

Posted 05 July 2001 - 10:52 PM

Pull out a geometry or trigonometry book. If you know the two vectors, you can find the lenth of the arc within the circle/ellipse defined by those vectors.

#5 Obelix   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 July 2001 - 02:09 PM

It is probably easier to solve a less general problem. If you just want the rotation around the y axis can you calculate it from the x and z part of the direction vector.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS