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.

Dark Physics & Dark A.I. & Dark Dynamix / Building a hehicle out of joints

Author
Message
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 7th Jan 2010 12:00 Edited at: 7th Jan 2010 16:05
I was geting frustrated with the physx vehicle controls and started playing around with rigid bodies and joints to see if it was possible to build a vehicle yourself.The code snippet is my first attempt at a very basic vehicle,it works ok,but now i seem to be getting "wobbly joints".Even fixed joints dont seem that well attatched.Not having realy used the joints before i dont know if this is just how they are or if i'm not seting them up properly.Have a play with the code and see if you can "strengthen" the joints up a bit.

Edit:
Newer virsion makes use of hardware if present and has a little ramp to play with.
Thanks.
Duke E
15
Years of Service
User Offline
Joined: 10th Mar 2009
Location:
Posted: 7th Jan 2010 21:20
For the wobbly joints (I posted this on another tread, just copied it):
Look in to "PHY SET REVOLUTE JOINT PROJECTION ID, mode, distance#, angle#"

More info on it in the Information help;
"Joint projection is a method for correcting large joint errors. Joint errors occur when a joints constraint is violated, imagine the ball being pulled out of the socket in a spherical joint. Under normal circumstances these joint errors are small (but unavoidable due to the imprecise nature of floating point math and numerical integrators). Dark Physics will apply small correcting forces to the simulation to try and reduce joint errors over time."

"However if a joint error becomes very large more drastic measures can be necessary, this is when joint projection comes into play."


Quote: "Newer virsion makes use of hardware if present and has a little ramp to play with."


Rigid bodys are not accelerated by hardware with Physx. The old PPU cards Aegia made had this implemented but those cards are obsolete as of Windows 7. So a beefy CPU will probably run rigid body's faster in software mode than a low end Nvidia 8XXX card does in hardware.

Regards
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 7th Jan 2010 22:15 Edited at: 7th Jan 2010 22:22
Duke E,I know the old ppu card is no longer supported by ageia or nvidea for windows 7,but reading posts from other members on here gives me the impression that most arnt running beefy cpu´s or high end graphics cards,quite a lot of us are still running xp.Keeping my start up code the same for all my physx projects (rigid,soft or fluid) and giving it the option to use hardware if present is just the same as getting the available screen resolutions and color depths,its a nice touch that makes it work for everyone.
I´ll look in to "PHY SET REVOLUTE JOINT PROJECTION ID, mode, distance#, angle#" and see if it helps.
Thanks.
Duke E
15
Years of Service
User Offline
Joined: 10th Mar 2009
Location:
Posted: 8th Jan 2010 07:34 Edited at: 8th Jan 2010 07:39
Yes you are quite right to make it optional, rumors say NVidia might implement rigid body acceleration in future drivers, just wanted to clarify as it seems to be a little known fact.

A real performance boost can be achieved by using asynchronous phy updates, this makes you run multithreaded.

Try:


Regards
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 8th Jan 2010 12:34
Thanks Duke E,i gave the multi threading a go,it doesn't really seem to make that much difference to this demo,but i'll try it on something a bit bigger later,i usually have a function that averages the fps over a set time with sync rate set at 0,on this demo it only managed a 1-2 fps difference,bit hard to really judge it with a scene that changes this much with the vehicle position.
I'm still not getting very far with the wobbly joints though,not really sure what the distance and angle values relate to,are they a limit to how much movement it wll allow or how much it wil compensate for?
Thanks.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 8th Jan 2010 13:26
This might help, it show other joint and how I made them and stopped them moving in direction I did not want.

It a demo of the sample joints as shown in the sdk but made in DBPro, show how to lock a joint to stop it moving in the direction you do not want.
Yon might find a joint that might work for what you trying to achieve.



What you have done so far looks great and may help other get the hang of it.

Dark Physics makes any hot drink go cold.
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 8th Jan 2010 13:35
Thanks HowDo,nice bit of code,works great.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 8th Jan 2010 13:42
it the firsat part of

phy make revolute joint 1, 2, 7, 0, 1, 0, -20, 30, 100

this means

x on move
y move
z no move

position -20 on x
position 30 on y
position 100 on z

does that help.

Dark Physics makes any hot drink go cold.
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 8th Jan 2010 14:34
Yes thats how i was seting them up HowDo with the 1 as being on the axis i want to rotate around.1,0,0 would only allow movement on the x axis 0,1,0 on the y and 0,0,1 on the z.The problems start when you try adding torque to one of the objects in the joint,like in the case of a wheel and a hub,the wheel should turn when you apply torque and the hub should transmit the motion generated through the axle and into the chasis,but the so called fixed joints between the hub and axles start to wobble so the vehicle starts to veer off to one side.It gives the impression that all the fixed joints are tied together with elastic bands,great and easy to use breakable joints are nice to have,but 0 movement on an axis is what i've specified and not what i've been given by physx.
Heres hoping the havoc wraper turns out to be as good as expected then we may just have some vehicles to play with.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 10th Jan 2010 23:13
Quote: "Building a [v]ehicle out of joints"


Wasn't that in a Cheech and Chong movie?

(sorry, couldn't resist..)

paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 11th Jan 2010 19:41
Dont know KISTech its all just gone up in smoke
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 12th Jan 2010 21:34
Latest vehicle is a small tank
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 13th Jan 2010 17:43
Nicely done.

paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 13th Jan 2010 20:32
Added a bit of sceneary to it,any one want to take it further be my guest.
Duke E
15
Years of Service
User Offline
Joined: 10th Mar 2009
Location:
Posted: 14th Jan 2010 03:27 Edited at: 14th Jan 2010 03:27
Tested your car code now.

Your main problem is the "phy set rigid body mass l,5"
The set mass command is bugged or has to be use in some other way - i dont know - i always use:
"phy update rigid body mass ID,Density#,Mass#".
The Density# should be set to zero according to the help.
If you use that instead of "set mass" and tweak the steering/spring torque forces alittle it works much better. The mass of jointed items should not be to different either (according to NVidia) i had 110 on the chassis and 80 on the wheels. I tested stretching the chassis some too, it was too gocarty for me . Pretty fun vehicle code, well done.

Regards
paul5147
18
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 14th Jan 2010 19:45
Thanks Duke E,never really noticed a problem with the phy set rigid body mass ,allways seems to do exactly what it says until the amounts get realy high, but i`ll give your method a try and see if it improves things."Gocarty" was exactly what i was aiming for so i guess i got it fairly close.
Latest try at this using a lot more joints and it now has suspension on it.
gwheycs62egydws
15
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 11th Apr 2010 03:08
I no this might be late in the game so to speak

but it seems in version 7.4 of DBP
the "move camera up" no longer works

I added the 16 like

position camera object position x(tank),object position y(tank)+16,object position z(tank)

Other than that the example run fine

Login to post a reply

Server time is: 2024-11-24 14:57:03
Your offset time is: 2024-11-24 14:57:03