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.

Newcomers DBPro Corner / Rolling and tilting an object.

Author
Message
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 20th Sep 2009 20:45
I am working on an airplane sim and am having trouble with the turning, roll object doesn't work correctly for this. I want it to tilt slightly when it turns, however when I use roll object it just rolls continuously. I also want it to a barrel roll but I have no clue how to start. Any help/suggestions/code is appreciated.

Thanks!
-Zeus

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 20th Sep 2009 22:51
Quote: "I want it to tilt slightly when it turns, however when I use roll object it just rolls continuously."


roll object left/right obj, value

As long as value <> 0, the object will keep rolling. It doesn't work in any way like the rotate object-commands.
If you want to make your plane tilt slightly then you will have to make value <> 0.0 for a short time. Meaning value should reach a value of 0.0 again after some loops.

Quote: "I also want it to a barrel roll but I have no clue how to start."


A barrel roll is pretty much rolling 360° right ...

Of course, if you're talking about real physics, you're up for quite a challenge.

Sven B

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 21st Sep 2009 03:05 Edited at: 21st Sep 2009 03:05
Quote: "If you want to make your plane tilt slightly then you will have to make value <> 0.0 for a short time. Meaning value should reach a value of 0.0 again after some loops."


So you are saying I should setup a variable for roll object that resets itself every time the program loops? Example below.



Like that?

Quote: "A barrel roll is pretty much rolling 360° right ...

Of course, if you're talking about real physics, you're up for quite a challenge.
"


With a bit of movement but basically yeah unfortunately, I may have to do real physics.

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 21st Sep 2009 14:55
Roll object works like turn object or pitch object.

The following method would be correct:



And the following would be the wrong way, which I'm guessing you might have done since your object kept rolling continuously:



Cheers!
Sven B

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 21st Sep 2009 23:12
Works the same way, you know I just want an airplane turning right? I am not asking for codes but I think you do not understand what I mean.

Happy Cheesecake
15
Years of Service
User Offline
Joined: 16th Jun 2009
Location: My non-vice-presidential refrigerator.
Posted: 21st Sep 2009 23:26
So you want an airplane to tilt down in the direction that it's turning, correct? I have no help for you there. But I hope that this clears things up for other people who can help you.

Sometimes reading posts from Zeus or I will bring gut-wrenching laughter, drenched pants, and a full load of underwear.

READ AT YOUR OWN RISK!
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 22nd Sep 2009 00:08
Yes, thank you that is what I want!

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 22nd Sep 2009 18:18
Quote: "Works the same way, you know I just want an airplane turning right? I am not asking for codes but I think you do not understand what I mean."


I'm sorry I misunderstood.
But what you're asking now isn't that easy to achieve. It's airplane physics I'm afraid. If you want, you could always make it look like it's turning like a real airplane by using EZ Rotate or LowerLogic's Rotation functions by rotating it around its local axises and playing a little with the values.

Sven B

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 22nd Sep 2009 22:46
Alright, I will take a look at them, because I want to avoid physics if possible, I am going to have HC make me a barrel roll animation to make it look like the object does a barrel roll. And thank you for your help!

-Zeus

Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 23rd Sep 2009 13:30
I have the code for a combat flight sim which I was working on a while ago, but still not sure exactly what you want. Are you just trying to be able to have the aircraft change the nose attitude while banking?

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 23rd Sep 2009 22:33
Yes!

Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 24th Sep 2009 07:58
Well, i'm not going to just give the code out, but I suggest you actually learn some basic aviation physics, you won't get anywhere without it.

If you can't learn/don't want to learn it/don't know at least a bit, then a flight sim is way too big a project for you.

BowserYo
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 24th Sep 2009 16:51
I'm new to programming myself... but wouldn't this work?

(Note: not actual code)


Like I said I'm a newbie but that concept should do the job for you.

ßõw§&#8364;r¥¤
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 25th Sep 2009 02:04
Quote: "I'm new to programming myself... but wouldn't this work?"


I'm only new to 3d but I tried that and it didn't work.

BowserYo
16
Years of Service
User Offline
Joined: 4th Jan 2008
Location:
Posted: 25th Sep 2009 03:08
If you can somehow get the x,y,z rotations to be local to your air plane maybe that would work.

ßõw§&#8364;r¥¤
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 25th Sep 2009 18:00
I was having some fun and managed to get this kinda of working. It doesn't really have physics or anything special, but I had fun!

Code:


It might give some ideas that you can develop upon.

There's something in this room that makes you can't speak well.
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 26th Sep 2009 00:38
Nice! I will develop off of this, thank you.

Login to post a reply

Server time is: 2024-11-25 02:02:52
Your offset time is: 2024-11-25 02:02:52