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 / [dark dynamix] How can I make a object.X with physic and collision ?

Author
Message
Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 23rd Oct 2012 23:15 Edited at: 23rd Oct 2012 23:16
Hi,
1st step)I make a DBPro sphere, then I use DYN MAKE SPHERE to make the DBPro sphere with physic and collision property

2nd step)I make a DBPro box then I use DYN MAKE SPHERE to make the DBPro box with physic and collision property

3rd step)Now I make an object form a .X object so :
load object "my_object.x", 1
then I use WHAT command on DarkDynamix to give to this object a correct and realistic collision mesh?

I am trying all mix but I getting just mad..
Probably I need to use DYN COOK CONVEX MESH command or DYN COOK TRIANGLE MESH or DYN LOAD TRIANGLE MESH...
Dudes I just hanging in confusion here...

My objective is just to launch some little spheres against a object.X and to see a realistic collision though I am using a complex object.X too.

Thanks!
Andrew_Neale
14
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: The Normandy SR-2
Posted: 24th Oct 2012 00:49 Edited at: 24th Oct 2012 00:50
Use these 2 lines to get started:

dyn cook triangle mesh ObjectId, TriangleMeshId
dyn make triangle mesh ObjectId, TriangleMeshId

This cooks(makes) data PhysX can use about the object and then applies that data to the object.

You can cook the triangle mesh and then save it so that in future you can just load it in rather than re-cooking it.

And I'm assuming it was a typo, but for boxes use:
dyn make box ObjectId, Density
instead of:
dyn make sphere ObjectId, Density

Hope that helps.


Previously TEH_CODERER.
Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 24th Oct 2012 01:02
Quote: "Use these 2 lines to get started:

dyn cook triangle mesh ObjectId, TriangleMeshId
dyn make triangle mesh ObjectId, TriangleMeshId
"


In first my friend THANK YOU for help! really!

Oh my god.. I am starting to get melted..

So, If I understand a bit.. :


Ok In fact I see my funnel on the scene and seems my little cubes and spheres can collide against it in a realistic and detailed way!!! (though if really little size cubes or spheres I find a less realistic collisions situation)

but Fffff What the hell, a forward step

But dude, I read about in the help document that If I make a physic object in this way(using DYN MAKE TRIANGLE MESH command) so I can just obtain a static object!

But If I would to have my funnel fall down with gravity and with a mass?
Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 24th Oct 2012 01:23
EDIT:


Done in this way!
Seems right not?
Andrew_Neale
14
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: The Normandy SR-2
Posted: 24th Oct 2012 10:36
Sorry for the misunderstanding. I didn't realise you wanted the .x object to be dynamic as well; I'd assumed that it was maybe your level object, like a building perhaps, which you would want to remain static. Yes, I believe you are on the right track there with the convex mesh commands. Does that work as you'd expect?


Previously TEH_CODERER.
Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 24th Oct 2012 11:36 Edited at: 24th Oct 2012 11:38
Quote: "Does that work as you'd expect?"


haha mate.. I was thinking was all perfect but this your question push me to check again all..

SO, It's work BUT... (please look at the attached picture)

As you can see If I use convex mesh command so I obtain a DYNAMIC object as I want but the collision area seems to be just the external shape of my cup.x .....

What the hell!! Please, how can I obtain same collision shape such as the STATIC cup.x object??

Attachments

Login to view attachments
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 24th Oct 2012 16:46
Hi Alduce,

You should always use the debug renderer, this will save you lots of frustration since you will see the physics simulation directly making it easy to spot issues. It is set up in every example so just copy one of those.

Convex meshes only support convex shapes, although it will calculate a best fit convex shape for models which are not convex, like yours. This is why it is roughly correct but the boxes will not go inside the cup, you will see this when you turn on the debug renderer.

You should use a triangle mesh for the cup, if it must be dynamic then you will need to somehow use multiple shapes(box, sphere, capsule or convex) combined to represent your shape. This is not easy.

I would personally re-model the cup so it is many convex shaped limbs, then create a convex mesh for each limb, this is the easiest solution, other than have the cup static of course.

Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 24th Oct 2012 18:00 Edited at: 24th Oct 2012 18:05
Hi Matty H. your words are interesting.

From what I understand since now, there is not a way to give the DarkDynamix physic to a triangle meshed object.

Again, only Static (so with no physic) objects can handle a triangle mesh as "a collision map".

Mmmmm but are you really sure there are no tricks available to make a triangled meshed body as dynamic body too?
I don't know.. mmm.. Like something converting in fly-by the triangled/convex shape... to let the object get physic and the "triangle collision map" too....


Your solutions are good yes, but is really complex to use many shapes to obtain something near to a good triangle mesh!

And if really is not possible (grr I hope not! ) so do you guys have plans to add this feature in future versions of Dark Dynamix?
I think this should be a BIG feature! (thinking too about Newton wrapper handling that currently)
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 24th Oct 2012 18:20
Physx does not support dynamic triangle meshes any-more, so I could not add it even if I wanted to.

It turned out that they were really slow, and tri-mesh to tri-mesh collision is near impossible, or so slow and unstable you would never run a real time application using it.

It turns out that if you want real time complex collision then grouping convex meshes is much faster, it's a little more work for you, but it really is the best way, otherwise physx would not have dropped dynamic triangle meshes.

Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 24th Oct 2012 18:38 Edited at: 24th Oct 2012 18:39
So Matty can you confirm me the following?:

1) I made 10 objects using for example deled

2) these 10 objects are all the different pieces of my cup. So these are my cup limbs.

3) I load this cup.x object in DBPro

4) I take the limbs list from the cup.x then I make these limbs as single objects

5) Now I have 10 single objects (the full cup)

6) I apply to all 10 objects the "DYN COOK CONVEX MESH" and "
DYN MAKE CONVEX MESH" commands

7) I join these 10 objects with appropriate DarkDynamix commands (haha currently I don't know what are these commands.. )
So now I have a single DarkDynamix object made by 10 limbs that form a cup.
And all these limbs are using a own "convex mesh collision map".

8) If all these step are ok, do you think I will get a good result considering my goal is to obtain the best and precise collision system for a DYNAMIC object!


Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 24th Oct 2012 19:53
Yes, that sounds about right.

7) You can join them together with fixed joints but I would not recommend that. Look at 'dyn make shape convex' and 'dyn make compound from shapes', I think this will be more stable and perhaps faster than using joints.

Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 24th Oct 2012 23:21
Quote: "Yes, that sounds about right.

7) You can join them together with fixed joints but I would not recommend that. Look at 'dyn make shape convex' and 'dyn make compound from shapes', I think this will be more stable and perhaps faster than using joints."


Thank you Matty H I try some codes to see what happen

Login to post a reply

Server time is: 2024-04-18 20:27:42
Your offset time is: 2024-04-18 20:27:42