How to create detailed Collision for complex Mesh?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

How to create detailed Collision for complex Mesh?

Postby Scarabol » Sun Jan 25, 2009 9:41 am

Hi,

im Newbie so pls be helpfull...

Im using Irrlicht 3D Engine and the Newton SDK in my Projekt.
Now I want to make a collision I use a Convex Hull, but the result is very bad, whats gone wrong?

If you wanna help me pls feel free to contact me via ICQ: 423708279

The gray circles, are the positions where Newton detects a collision, but there not on the mesh, especially in the region around the yellow cross :-(

Image

Scarabol
Scarabol
 
Posts: 24
Joined: Sun Jan 25, 2009 9:21 am

Re: How to create detailed Collision for complex Mesh?

Postby agi_shi » Sun Jan 25, 2009 10:30 am

Convex hulls are just that, convex. Those circles are in a concave region of your model. I suggest you break your model up into several parts and put them together into a 'concave hull' via NewtonCreateCompoundCollision()
agi_shi
 
Posts: 263
Joined: Fri Aug 17, 2007 6:54 pm

Re: How to create detailed Collision for complex Mesh?

Postby Scarabol » Sun Jan 25, 2009 10:46 am

Damn, i hopped Newton could do this for me.

But thanks i'll try it...

Scarabol
Scarabol
 
Posts: 24
Joined: Sun Jan 25, 2009 9:21 am

Re: How to create detailed Collision for complex Mesh?

Postby Scarabol » Sun Jan 25, 2009 11:08 am

I know that it's horrible for the performance, but how may i use the exact mesh for collision?

Scarabol
Scarabol
 
Posts: 24
Joined: Sun Jan 25, 2009 9:21 am

Re: How to create detailed Collision for complex Mesh?

Postby agi_shi » Sun Jan 25, 2009 11:32 am

Scarabol wrote:Damn, i hopped Newton could do this for me.

But thanks i'll try it...

Scarabol

When you create a convex hull, you just have a cloud of vertices. It's like wrapping tinfoil around a bunch of random points. There's no way to 'know' where things are concave.

Scarabol wrote:I know that it's horrible for the performance, but how may i use the exact mesh for collision?

Scarabol

Considering this seems like a space game... is that ship dynamically simulated by Newton (with mass and everything)? If not, you can just use a tree collision (check the Newton examples and wiki on how to use it), which isn't horrible for performance, since it's meant for large, complex, static objects. Technically, you can even move it manually with a velocity and everything, Newton just can't use forces and what-not on it, you need to move it manually (see here: http://www.newtondynamics.com/wiki/inde ... TriMesh%3F)
agi_shi
 
Posts: 263
Joined: Fri Aug 17, 2007 6:54 pm

Re: How to create detailed Collision for complex Mesh?

Postby Scarabol » Sun Jan 25, 2009 12:12 pm

Yeah! Thanks works great, thats what i'm looking for!

Scarabol
Scarabol
 
Posts: 24
Joined: Sun Jan 25, 2009 9:21 am

Re: How to create detailed Collision for complex Mesh?

Postby Scarabol » Sun Jan 25, 2009 12:27 pm

Argh!

How may i scale this?
Do I have to scale this in my 3D Editor or can I use something such as ConvexHull Transformation?

Scarabol
Scarabol
 
Posts: 24
Joined: Sun Jan 25, 2009 9:21 am

Re: How to create detailed Collision for complex Mesh?

Postby agi_shi » Sun Jan 25, 2009 12:52 pm

Scarabol wrote:Argh!

How may i scale this?
Do I have to scale this in my 3D Editor or can I use something such as ConvexHull Transformation?

Scarabol

You want to scale the tree collision? Tree collisions are slightly limited in that department, to 'scale' it you need to manually scale up all the faces (simply currentVertex * scaleAmount) and then (re)construct the tree collision. This shouldn't be too slow if you have the vertices standing by in some array. Though, it'd probably be best to get the scales right when you export from a modeling application, rather than making your program deal with it.

If you're talking about a compound collision object, then you can create convex hull modifiers for each 'part', and then add the modifiers (not the originals) to the compound collision. Now, scaling each modifier will in turn scale the whole compound object.
agi_shi
 
Posts: 263
Joined: Fri Aug 17, 2007 6:54 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 29 guests