Rotating towers

Started by
36 comments, last by HelderBorges 13 years ago

You have a radians -vs- degrees problem. Really, do read the documentation instead of relying on trial and error and on the patience of the good people on this forum.


ok... sry...:(
Advertisement
Just in case you haven't already caught it, it looks like one of your problems is here:

glRotatef(atan2(posb[0]-post[0],posb[2]-post[2]),0,1,0);[/quote]
glRotate*() expects an angle in degrees, but atan2() returns an angle in radians.

[Oops, missed a bunch of posts; looks like this has already been covered.]

Just in case you haven't already caught it, it looks like one of your problems is here:

glRotatef(atan2(posb[0]-post[0],posb[2]-post[2]),0,1,0);

glRotate*() expects an angle in degrees, but atan2() returns an angle in radians.

[Oops, missed a bunch of posts; looks like this has already been covered.]
[/quote]

Thanks anyway that was really 1 of the problems. After that i can rotate the tower every time i move at the range area, the only problem for now is that the tower is not facing the object properly.....
But thanks anyway :\
That might depend on what direction your tower faces under no rotation. What you have should work as long as it's originally pointing towards (1,0,0). If that's not the case, either change the model, or apply some rotation before to align it that way, or add some number to the computed angle.

That might depend on what direction your tower faces under no rotation. What you have should work as long as it's originally pointing towards (1,0,0). If that's not the case, either change the model, or apply some rotation before to align it that way, or add some number to the computed angle.


Good tip. thanks :D.

That might depend on what direction your tower faces under no rotation. What you have should work as long as it's originally pointing towards (1,0,0). If that's not the case, either change the model, or apply some rotation before to align it that way, or add some number to the computed angle.


ITTTTTTTTSSSSSSSSS WWWWWWWWOOOOOOORRRRRRRRKKKKKKKKIIIIIIIINNNNNNNNNGGGGGGGGGG thank you so much :D If you where from portugal i wold order you a pizza :D



Working :D
Álvaro poderia ser um nome português. :)

Álvaro poderia ser um nome português. :)


Sry only answering now. Pois podia. é pena :P

This topic is closed to new replies.

Advertisement