Hydrogen777 Guest   Status: Posts: n/a Absolute Heading - 09-26-2010, 04:14 PM I'm working on a flight simulator project. Here's the problem. The player needs to be able to control yaw (left/right motion). But simply having the plane turn right and left without rolling right and left doesn't look realistic. But if I make the plane roll as it yaws relative to itself, altitude is affected, which is not the intention. I could adjust the pitch (up/down motion) so that constant altitude is maintained, but this seems overly difficult and complicated. So I decided to get rid of motion relative to the plane altogether and instead go with absolute coordinates (relative to the world). The plane has properties for speed, theta (angle in the x-y plane, corresponding to yaw), phi (angle from the x-y plane up in the z-direction, corresponding to pitch), and roll. I used trig (spherical coordinates) to get the plane to move properly, and it works very nicely. However, the plane does not change its animation direction at all. I need to make the plane change its absolute heading to match its theta, phi, and roll properties. But I don't see any methods that change absolute heading - only relative heading, e.g. "turn 1/4 revolution". Is there a method something like "set horizontal angle to 0 as seen by world"?
 debussybunny563 Senior Member     Status: Offline Posts: 852 Join Date: May 2010 09-26-2010, 04:37 PM Unfortunately, no. But what you could do is have a dummy at the object, vehicled to the camera or whatever, and have "object orient to *dummy*." Or, you could scrap the dummy all together and have "object orient to *camera*" if it works for you. If you're planning on having the plane actually "move" relative the the camera's field of view (anything other than turning or rolling), then substitute the "orient to" with "set point of view to." EDIT: 365th post. Yay. Last edited by debussybunny563; 12-21-2012 at 12:00 AM. |--------------------------------------------------------------------------------------------------| |Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 | |--------------------------------------------------------------------------------------------------| I have been dead for quite some time now; not much hope for resurrection.
 Hydrogen777 Guest   Status: Posts: n/a 09-26-2010, 06:56 PM I don't want to orient anything to the camera because the camera is set to follow behind the plane at all times, almost in first-person style. "But what you could do is have a dummy at the object, vehicled to the camera or whatever . . ." I like this idea, but now I need a way to move the dummy object to the position of the plane plus the appropriate offset. I don't see any way in Alice to move an object to a point beyond another other object. Also, this still doesn't allow me to animate rolls.
 debussybunny563 Senior Member     Status: Offline Posts: 852 Join Date: May 2010 09-26-2010, 08:11 PM Hmm. Perhaps post your world, so I could take a look at it? Last edited by debussybunny563; 12-21-2012 at 12:00 AM. |--------------------------------------------------------------------------------------------------| |Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 | |--------------------------------------------------------------------------------------------------| I have been dead for quite some time now; not much hope for resurrection.
Hydrogen777
Guest

Status:
Posts: n/a
09-26-2010, 08:43 PM

Left and right arrows control yaw. Up and down arrows control pitch. W and S control speed. And A and D control roll. The object "Heading" is the dummy object, but it doesn't do anything yet.

Thanks for your help - I really appreciate it.
Attached Files
 Test Movement.a2w (996.3 KB, 16 views)

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops     Alice Player and VR General Discussion     Questions and Comments     The Lounge