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.

DarkBASIC Professional Discussion / So if rotation isn't buggy, how do I do this?

Author
Message
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 6th Sep 2003 04:08
Here's a really common example of a use of all angles of rotation. It's the common problem of getting an object to tilt so its sitting properly on a matrix.

In the original darkbasic (starting with the object facing the right direction on its y-axis), I got the height of the ground in front and behind the object. I used this information and xrotate object to tilt the object correctly on its x axis. Then I got the matrix heights to the left and right of the object and got the angle before using zrotate to the tilt the object on its z-axis. This made the object sit properly on the matrix.

Seeing as DB Pros rotation works differently, the same process doesn't work in pro, and there is no explanation as to what makes the rotation different. So my question is, if the rotation isn't buggy as has been said, how do you do get an object to tilt properly on a matrix in pro (without using extra objects as limbs etc. as this shouldn't be necessary)?

Insiiiiiiiiiiiiiiiiiiiiiiiide!
randi
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 6th Sep 2003 05:32
I have no clue to your question, but your new avatar is scaring me.


Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 6th Sep 2003 12:59
hehe. You love it. That's what I look like in real life!

Insiiiiiiiiiiiiiiiiiiiiiiiide!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Sep 2003 14:09
I've just compiles and ran the DBC tank demo compiled in DBPro and that follows the landscape as well as it ever did.

Rip the code from there
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 7th Sep 2003 14:29
Yeah, but that uses a pivot object, or something, doesnt it? I think they used that because when the db tank demo was released with the first db, it's rotation worked in the same way dbpro now. Subsequent releases after a certain version number had the rotation changed (although, I like to say "fixed" ) meaning that using that extra object wasn't necessary.

I don't actually need to tilt an object to the matrix. That was just my hyperthetical question disguised as a real question to encourage a member of the db staff to magically appear and explain all in a post. Oh well. No third axis of rotation for me then.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
adr
23
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 7th Sep 2003 15:00 Edited at: 7th Sep 2003 15:05
I'm sure you and I have had similar conversations in private, and whenever I suggest my solution (by "my", I mean TMC's), you seem to suffer from a bout of "stubborn git".

The free flight commands work, but they seem to work releatively. It's wrong for 99% of the total range conceivable applications, but I'm sure there's a good reason for that particular behaviour.

In order to work around this (uh oh, "workaround"?) make a hidden plain...

* imagine a western film set in a bar right now. The piano player would've stopped. All conversation stopped. Everyone looks at the guy who just suggested making a hidden plain *

Here's my code which works wonderfully ...


I've found the order of turning, pitching and rolling does affect your object's behaviour.

And I think your avatar looks a bit like Christopher Lloyd in "Who Framed Roger Rabbit?" ... except more scary.

A wise man once said: "I know that I need codes but I dont know the codes"
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 8th Sep 2003 14:51
I know adrian. Thanks for your help. But I'll show you where you can stick your hidden plain. I may well have to resort to that method, but I don't want to if I can help it.

It's quite simple really. The rotation system should allow you to go from any concievable rotation, to any other conceivable rotation by just changing the numbers. But seeing as that doesn't seem to happen in dbpro, people have to use extra objects to track a certain axis. How lovely.

This is how I think the xyz order rotation should work:
(1) You enter a value for x. The object pitches forwards or backwards on its own x axis to get the desired angle. Chaaching - dbpro does this.
(2) You enter a value for the y. The object turns left or right, on its own y-axis to get the desired angle of left/right turnage. Chachingchingchin - dbpro does this!!!
(3) You enter a value for the z. The object rolls left or right, on its own z-axis, like a barrel rolling. Bluuuuuuuuuuuurrrrrg - Instead, DBPro rotates on the worlds z-axis, throwing out your x-angle, your y-angle and it goes without saying that the z-axis never gets anywhere near the angle you want.

The z axis of an object is a line running through its centre, pointing in the direction the object is facing. So rotations around this axis should just cause the object to barrel roll left and right, but they don't - they use the worlds z-axis.

It'd just be nice if someone could explain why the last angle in the rotation sequence uses the world axis instead of the objects axis, and how to get proper rotation using this method.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Sep 2003 15:50
No, DBPro uses world axis rotation all the way through using this method. If it didn't then a 45 degree rotation of the x axis would move the y axis as well as the z axis.

Anyway, see the other post for an update
adr
23
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 8th Sep 2003 16:15
Quote: "But I'll show you where you can stick your hidden plain"


I'm suspicious now - I mean, how do I know when you've stuck it somewhere when it's hidden?

O_o

A wise man once said: "I know that I need codes but I dont know the codes"
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Sep 2003 16:35
I'm sure that he'll make the plane nice and large so you'll feel it
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 8th Sep 2003 19:20
... you wouldn't believe!

Btw, hows your flight game coming Adrian? Or have you started a new one?

Insiiiiiiiiiiiiiiiiiiiiiiiide!

Login to post a reply

Server time is: 2026-07-25 09:40:12
Your offset time is: 2026-07-25 09:40:12