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 / Moving objects in ODE

Author
Message
Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 24th Jun 2006 04:24
I need to move objects in ode and since I can't use move object becuase of ode i need another way to do it.

Your signature has been erased by a mod because it's larger than 600x120...
bosskeith
19
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 25th Jun 2006 09:12
apply forces to your objects...their momentum will then move them

Ink all over the screen...and dang it! Signature still does not show.
Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 25th Jun 2006 19:03
I mean in the direction the object is facing sorry I didn't say that in my other post. When I use something to apply force in ode I have to give an x,y,z and not just a step value like move object.

Your signature has been erased by a mod because it's larger than 600x120...
Dream And Death
19
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 25th Jun 2006 20:02
I don't use ode personally (yet), but it sounds like you need to find out your object's heading in terms of x,y,z and apply the force (presumably in the z direction).
Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 25th Jun 2006 20:08
When I go in the z direction I move in the z direction and not the way I am facing. I think I need to find out the how much it moves in the x and z by its y angle but Im not sure how

Your signature has been erased by a mod because it's larger than 600x120...
thebulk71
19
Years of Service
User Offline
Joined: 2nd Jan 2006
Location: takin a poop
Posted: 26th Jun 2006 19:47
HO HO HO!!! I solutioned this problem, what you need is.....(suspence).... Trigonometrics...(maths do serve in life... hard to believe isn't it?)

so this is how you must proceed:
you need to convert your object Y angle into 3D coordinates (to understand, imagine that you are looking at the character you want to move from above, well the Y angle is obviously the 'forwards' direction.)

-so...using the ODE command to add force (experiment both types... results vary depending on your objects shape...):

-set the X variable to SIN(object angle y(your object number here)) -set the Y to 0 (otherwise the character will start flying)
-set the Z variable to COS(object angle y(your object number here)).

you will notice how 'slow' the character will move... this is normal because trigonometrics only return a value between 0 and 1. so to make the character go faster all you have to do is multiply your Y angle in the XYZ variable area like this... to resume use the following command:

ODE SET LINEAR VELOCITY object number here,SIN( object angle y(object number here)*speed),0,COS (object angle Y(object number here)*speed)

the speed variable is what you want to set for the character speed.
(I'm on a friends PC here, so when I get home I'll mail you an example...)

Hope this helps out!

Login to post a reply

Server time is: 2025-06-10 06:31:11
Your offset time is: 2025-06-10 06:31:11