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 / The "Playing with U5.9 ODE Physics" thread

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Nov 2005 23:09
Most people seem to be well on their way now, but don't forget there is a beginners tutorial in the newsletter...

http://www.thegamecreators.com/data/newsletter/newsletter_issue_34.html

Quote: "ODE SETSURFACE MODE CONTACT APPROX1 <obj>,<state> sets an alternative friction model for objects (not necessarily always better) but setting it on for spheres seems to make them roll properly"


That's good to know I couldn't work out if ODE was the problem, or the way it was implemented in the wrapper.

Quote: "use ODE SETSURFACE MODE <obj>,2,<state> instead for now."

Another handy hint! I will be checking that one out. I left bounce out of the tutorial because I couldn't have bounce and friction.

Thanks for the updated version IanM, I will be using that from now on

CTF Freak
18
Years of Service
User Offline
Joined: 27th Oct 2005
Location: In your base
Posted: 7th Nov 2005 16:05
@sparky+IanM: that is just what I wanted thanks a ton

Quote: "No criticism of you PEH16, just for myself if we had a good source for help on commands, particularly new commands, particularly new 3d and ode commands - i can dream
"

I guess I was dreaming but I always make a help file first before
I release something so people like me don't bug me.
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 7th Nov 2005 17:10
putting all the above v useful links and sources together I begin to see and understand.... (takes time) - thanks all...

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Tachyon
18
Years of Service
User Offline
Joined: 15th Sep 2005
Location: four-momentum imaginary proper time
Posted: 8th Dec 2005 13:39
Hi all. Could somebody tell me the concept of ODE ADD FORCE?
I mean that is this command like drawing force arrows in fysics lesson?
Longer distance, stronger force? How about should I start from behind the object and end the arrow to center of an object or other way?
I appreciate your help. This is a great thread by the way.

(2b)||!(2b) (It's C++) 1. TO B OR NOT 2B (It's DarkBasic!)
But, that's the question!
[href] www.etachyon.tk [/href]
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Dec 2005 14:08
The force is added as a value. Th ex,y and z specify where the force is applied relative to the centre of the object. So, if you have a cube that is 10 units in all dimensions, and you apply the force at 0,5,-5, you are effectively pushing it at the top and at the back. If there is some friction, you will push it over, rather than push it forward.

0,0,0 = centre
-5,0,0 = left side
5,0,0 = right side
0,-5,0 = base
etc...

Tachyon
18
Years of Service
User Offline
Joined: 15th Sep 2005
Location: four-momentum imaginary proper time
Posted: 8th Dec 2005 14:46 Edited at: 8th Dec 2005 15:03
So if I understood it, ODE ADD FORCE X#,Y#,Z#,X1#,Y1#,Z1# movement can be done whit parametres like: X#,Y#,Z# is the direction where I want object to move and X1#,Y1#,Z1# is the object's center. This moves the ball like i would draw force arrow in physiclessons. Like I want penguin to move to microchip:
<---
where < is X#,Y#,Z# and penguins stomach is X1#,Y1#,Z1#
edit: and number of: - is the power
Thank you.

(2b)||!(2b) (It's C++) 1. TO B OR NOT 2B (It's DarkBasic!)
But, that's the question!
[href] www.etachyon.tk [/href]
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Dec 2005 15:51 Edited at: 8th Dec 2005 15:51
ODE ADD FORCE object, X#,Y#,Z#,X1#,Y1#,Z1#

object = object number
x#, y#, z# = the direction of the force (like your arrows)
x1#, y1#, z1# = where on the object you want to apply the force

For the second x,y,z parameters think of hitting a snooker ball. Depending on where you hit it, it spins in a different manner. So the ball could travel forwards (x#=0, y#=0, z#=10), but at the same time be spinning anticlockwise (x1#=3,y1#=0, z1#=0).

JerBil
20
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 8th Dec 2005 17:02 Edited at: 8th Dec 2005 17:05
I guess you noticed that your blocks fall even if you
don't throw the ball?

EDIT: That is, if you set the gravity to 80


-JerBil

Ad Astra Per Asper
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Dec 2005 17:35
Yes, it seems to be a problem with all physics engines - even the expensive ones. But in the expensive ones, you can make very weak joints to hold it all together. When they get hit, the joints break instantly.

You can modify this example with friction, and that helps to keep it together. The newsletter tutorial version of this example does exactly that.

Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 9th Dec 2005 06:32
Am I the only one thinking this needs a help file?

Cheese!

Expert Bug-Finder, Horrible at Identifying Them.
Mason
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: Arizona
Posted: 9th Dec 2005 06:57 Edited at: 9th Dec 2005 07:52
Well I was just playing around with ode for my first time today, and I wrote something real quick just to understand it a bit more. My little example, whenever you hold the control button, makes a bunch of cubes and drops it onto a plain. If you left click on the boxes, they are deleted. Seems when I delete a box under another box, it doesn't fall down, it just floats there like it was still on a box. Is there a way to fix this? Heres the code try it yourself, just make a lot of cubes and delete a cube that is under another cube. It will just float there.

I'm guessing there is a simple answer for this but ya know By the way, I don't delete the cubes until the end of the program, so the longer you hold the control button, the slower the program gets


Check out Penguin in the Projects Section!!!
http://www.prodigyarts.5gigs.com
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Dec 2005 11:57
Quote: "Seems when I delete a box under another box, it doesn't fall down, it just floats there like it was still on a box"


This is probably down to the way ODE disables objects that are staionary. Instead of calculating every object every cycle, it removes any objects that have stopped. They are enabled again when they are effected by a force of some kind. Because deleting an object doesn't create a force on the object above, it doesn't enable it again.

Mason
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: Arizona
Posted: 9th Dec 2005 23:43
Yeah, looks like your right. I just added a few lines in the code to fix it. Whenever the program deletes an object, I add a little force to it and it falls down.


I guess that fixes the problem. I kinda would like to see someone make a bowling game out of this, it'd be pretty sweet


Check out Penguin in the Projects Section!!!
http://www.prodigyarts.5gigs.com
Tachyon
18
Years of Service
User Offline
Joined: 15th Sep 2005
Location: four-momentum imaginary proper time
Posted: 10th Dec 2005 11:02
I have a some kind of problem, when I make cylinder, scale it, and then make it in ODE, it acts like original cylinder

Is there some kind of thing to scale it in ODE.

(2b)||!(2b) (It's C++) 1. TO B OR NOT 2B (It's DarkBasic!)
But, that's the question!
[href] www.etachyon.tk [/href]
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 10th Dec 2005 19:31
This is a simple bowling game i created using ode...hope it helps someone...and I too have trouble with static .x objects...my dynamic ones seem to behave. Also if you explore the ODE website it explains a lot of things like the world variables...i killed the sponginess of my collisions because of the nature of the game.


Ink all over the screen...and dang it! Signature still does not show.

Attachments

Login to view attachments
Mason
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: Arizona
Posted: 10th Dec 2005 22:07
Haha, thats a pretty sweet program. Kinda seems like the bowling pins stick to the ground a lot more then they should. Most of the times I hit the pins, they slid off the plain instead of falling over. I had a few realistic looking pin falls though. Nice


Check out Penguin in the Projects Section!!!
http://www.prodigyarts.5gigs.com
Mart
20
Years of Service
User Offline
Joined: 27th Sep 2003
Location: Canada
Posted: 11th Dec 2005 16:51
I had experience the same problem with ODE CREATE STATIC TRIANGLE MESH.
But I have a solution. The problem is that the triangle are too large on your model. I had create a floor in 3dsMax and increase the amount of triangle, and the box I had create stay on the floor!

Switch in wireframe view with the SET OBJECT command, and you will see all triangle.
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 13th Dec 2005 17:40
mart: Thx for the info about those triangles.


mason: Glad you liked it. After thinking about it i realized that maybe because i created the pins with the base at the origin that it thinks that might be it's center of mass therefore you would be hard pressed to knock them over. I am going to shift the origin up and see if that does not create a better true to life pin action. I will keep posted...i think it would be important to know if the way we create it has function to the way they react too.

Ink all over the screen...and dang it! Signature still does not show.
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 13th Dec 2005 17:49
my assumption was right when you create your objects the origin determines the center of gravity...if you shift it to far left and up the pins will automaticaly fall over just by moving the origin up the pins behaved appropriately.

Ink all over the screen...and dang it! Signature still does not show.
Lucka
19
Years of Service
User Offline
Joined: 1st Oct 2004
Location:
Posted: 19th Dec 2005 11:51
ODE ADD FORCE RELATIVE...

IanM, you said the in latest dll it was added..
Latest DLL?? How can I reach it?
There's a place where everybody can take the latest?
Sorry, but I'm still a lot confused playng with ODE!!
Lucka
19
Years of Service
User Offline
Joined: 1st Oct 2004
Location:
Posted: 19th Dec 2005 12:35
OK, sorry for my last trade, but when I'm hungry I become BLIND!

I'm playng with ODE and I found something interesting..
See this code:



I control the cube like a car on the ice to destroy the wall..
but the problem is the Y ANGLE of the dynamic object:
it grows from 0 to 90 and then (instead of growing to 180) it
decrease again from 90 to 0...

in this way it's impossible to understand where the object is facing
cause the ODE internally "reset" angular position making a zero crossing on 90 degree instead of 360..
Lucka
19
Years of Service
User Offline
Joined: 1st Oct 2004
Location:
Posted: 19th Dec 2005 12:42
the angular position moves like that:

0

-90 90

0

so when the angle is 45 it's impossible to understand if the object is facing NorthEast or SouthEast..

It's true?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 19th Dec 2005 15:11
Is there an ODE sound set so that when your object falls the ODE system can look after the sound of it hitting something, or do we have to do that manuly.
if so, how do you do it?

I'm not getting you down am I, Ho Look! another fancy Door?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 19th Dec 2005 16:25
You would do it by using the ODE collision commands to establish which objects had collided. I don't have ODE to hand, so I can't tell what the commands are called.

bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 20th Dec 2005 04:13
lucka all you have to do to find ango# is to access th object directly....ode turns the physical object so you just check it...

ango#=wrapvalue(object angle y(200))

this returned an accurate angle number for me in your program of 0 to 359.n degrees

the other 2 sets of numbers were accurate too ranging from negative 9.n to positive 9.n which is the change of the sine and cosine as you rotate through your y angle with a radius of 10(your force being applied)

Ink all over the screen...and dang it! Signature still does not show.
Lucka
19
Years of Service
User Offline
Joined: 1st Oct 2004
Location:
Posted: 20th Dec 2005 10:03
I'll try immediatly, thanks a lot bosskeith!!
Lucka
19
Years of Service
User Offline
Joined: 1st Oct 2004
Location:
Posted: 20th Dec 2005 10:06
opss..
it doesn't work, on my code when I rotate the object the angle
OBJECT ANGLE Y(200)
still variate from +90 to -90, can you post the code?
cause originaly I was reading the object directly, same result..
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 2nd Jan 2006 23:12 Edited at: 2nd Jan 2006 23:13
Was on vacation sorry i did not respond sooner.
included both source and screenie...i am thinking we might also be using 2 different versions because i am using 5.9c and the "relative" had to be taken out to work for me



Ink all over the screen...and dang it! Signature still does not show.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-05-19 08:29:00
Your offset time is: 2024-05-19 08:29:00