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 / tilt on matrix slopes

Author
Message
viscera eyes
20
Years of Service
User Offline
Joined: 29th Apr 2004
Location: the moon
Posted: 18th Jun 2005 11:38 Edited at: 18th Jun 2005 11:40
hey i was wondering how you get an object to tilt according to the slope that its moving on. i got the code to make it walk on the matrix but i need some help trying to get it to rotate along the terrain so it looks realistic. if it makes a difference i am working with DBPro.

if you need to know, here is my code:



ALIVE IN THE SUPERUNKNOWN!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 18th Jun 2005 11:47
Here's some code I did a while back. See if it helps.



"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
viscera eyes
20
Years of Service
User Offline
Joined: 29th Apr 2004
Location: the moon
Posted: 18th Jun 2005 11:54 Edited at: 18th Jun 2005 11:55
good code. thats exactly what im looking for but do you think you could tell me what part of the code actually does the rotating and how it works? its kinda got allot of stuff i dont need

ALIVE IN THE SUPERUNKNOWN!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 18th Jun 2005 12:10
Basically, you need 3 points to determine a 3D angle. I did this by adding limbs onto the truck (I added, and used, 4 limbs, but only really needed 2, plus the center-point of the object = 3 points). See the Function Make_Truck().

Then I need to get the angles. I did this in the Function Get_Angles(). I started out with the limb coordinates. Then I changed the Y coord to the ground height and used the resulting coordinates to calculate an angle using ATanFull(). The results gave the pitch and roll angles that get averaged, then used to pitch and roll the truck.

Simple.

If you want, you can fee free to use this code and the "truck" as a dummy object. Then hide it and Position your object at the same coords and set object to object orientation to align the two.

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
viscera eyes
20
Years of Service
User Offline
Joined: 29th Apr 2004
Location: the moon
Posted: 18th Jun 2005 13:02 Edited at: 18th Jun 2005 14:42
thanks but i dont know anything about limbs so how would you do it with a .x file without any limbs?

ALIVE IN THE SUPERUNKNOWN!

Login to post a reply

Server time is: 2024-09-23 21:27:07
Your offset time is: 2024-09-23 21:27:07