Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Neotron
16
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 24th Sep 2010 12:32
Hi

I am making a college project.Its like a Flight simulator.But i am stuck at the A.I. formation.

The thing is i need to rotate an object in 3d to point towards a point smoothly not just snapping but rotating.

My first attempt was to use Atanfull() but it made the plane flicker and go in wrong direction .i added and subtracted the angle by 180,360,90,270 but nothing worked.

So i had to learn to use vectors but it is still not working.

I think i am not making a good approach.




oh and one more thing it should be like a function.

ALLAH IS THE GREATEST
May he forgive me
Neotron
16
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 24th Sep 2010 12:55
Umm i kind of got the vanb's demo about rotating to object posted about 6 years ago.it used curveangles

Plz give the detail about curveangle fully O.K.

ALLAH IS THE GREATEST
May he forgive me
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 24th Sep 2010 13:31
It is very easy, you just put current angle, target angle, and speed in it. Every loop, the current angle will be a little closer to the target which remains still of course in the case of a not moving target position. The rotation will get slower as it gets closer to the target rotation value(s) hence the smooth transition.
Davey B
21
Years of Service
User Offline
Joined: 22nd Aug 2004
Location:
Posted: 24th Sep 2010 16:31
I made a thread asking for help on this a few days ago.

http://forum.thegamecreators.com/?m=forum_view&t=175931&b=1&p=0

green gandalf's solution worked perfectly for me, I'm assuming it'll work for you. Just replace the npc with a waypoint and you can have a plane turn to any point you decide with a nice realistic smoothness.
Neotron
16
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 24th Sep 2010 17:45
O.K. i have tried everything but the problem here is when i yrotate an object it works fine but when i xrotate it it doesn't .

my project deadline is close plzzzz help me.

rotating the missile to the fighter plane.

ALLAH IS THE GREATEST
May he forgive me
Four Dimensional
18
Years of Service
User Offline
Joined: 11th Jun 2008
Location: lost in thought
Posted: 25th Sep 2010 07:32
Personally, I love vectors, so hopefully I can help:

typically I create a rotation matrix, but I am not very familiar with DBP matrix commands, so the derived rotation vector would be:

(along Y axis)<Xr, Yr, Zr> =
<X*cos(ang) - Z*sin(ang), Y, X*sin(ang) + Z*cos(ang)>
(where ang is the intended angle)

You may also look into quaternions, but I'm not sure how practical they are...

Imagine this: there may exist infinite parallel universes, all similar to ours, but we may never be able to encounter or even interact with them.
Slayer
22
Years of Service
User Offline
Joined: 15th Nov 2003
Location: CA
Posted: 25th Sep 2010 08:36 Edited at: 25th Sep 2010 08:37
this is what your talking about right?

I was on the 7th issue of the dark basic news letter, I was
looking for the same thing, lol go to "Ask Dr. DB" on this news letter
and theres your answer! lol

http://www.thegamecreators.com/pages/newsletters/newsletter_issue_7.html

I dont know how to spell

Login to post a reply

Server time is: 2026-07-24 18:27:27
Your offset time is: 2026-07-24 18:27:27