NewtonMeshApproximateConvexDecomposition tests

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

NewtonMeshApproximateConvexDecomposition tests

Postby Bird » Wed Dec 07, 2011 1:55 pm

I tried on a a variety of objects and it looks like there might be some problems. Here's the results http://www.hurleyworks.com/downloads/decomp_tests.jpg

I think Hans might be failing because the mesh is composed of disconnected pieces ...like body, hair, vest etc. Noodle has disconnected parts too. But the dragon and angel are scanned meshes and should have no disconnected pieces and I checked to make sure that is true. The concave-cube is just one piece too.

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: NewtonMeshApproximateConvexDecomposition tests

Postby Julio Jerez » Wed Dec 07, 2011 4:18 pm

Ye smay be some bug still, I has no test much.
Let us start from the simple ot the complex.
can you send me the The concave-cube is just one piece demo and the paramenters you are using for the decomposition?

then after that we try the more elaborated models. for that I wan to add teh mesh simplificaton fase.

I should be able to fix those bugs fially eassy.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonMeshApproximateConvexDecomposition tests

Postby Bird » Wed Dec 07, 2011 5:28 pm

Here's the OBJ : http://www.hurleyworks.com/downloads/concave_cube.obj

parameters:
maxConcavity = .2f
maxCount = 16

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: NewtonMeshApproximateConvexDecomposition tests

Postby Julio Jerez » Thu Dec 08, 2011 9:45 am

I just run the concave test in the max plugin in and I had a pefect decomposition, and had two sides each matching the convex pieces of teh box.
I tryed with 0.2 tolerance and with 0.1 and butvbalues yeilded the same result.
I can do this, I will same teh result in the SDK as a test file, mayeb you can run it and see if taht is right.

one thing we need to do si to pu teh dScene format so that we can transfer data tah can be read exactly as it is by Max and bet lighwave
OBJ format max doe some scalling and it may be that way we see is no waht we get. the dScen fiel will at leat guarantte we are working wi the the same data.

I know there are bug still specially with concave pieces. this particalar model should no fail in any way.
can you send me the Handsolo model?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonMeshApproximateConvexDecomposition tests

Postby Julio Jerez » Thu Dec 08, 2011 10:21 am

Ha I think I found the problem. It is no really a bug is related to file format and metric system.
when I load the model in Max internally is dimension less but when each file has a metric system scale.
when a model is loaded each plug-in in convert the model to a Max dimensions by multiply by the scale system. so your Box in file his about [0.5 x 0.5 x 0.5]
when I load the Box into Max, Max load the unit as they are in the file, and all processing is done on the file unit.
The reason Max and some other modeling packages do not apply the scale to the model is that if you do that many time,
then each time you save the file the file the new copy is slightly different doe to floating point rounding error creeping in.
when I call the plug in form Max I am also getting a this values

g default
v -0.5 -0.5 0.5
v -0.5 -0.5 -0.5
v -0.5 0.5 0.5
v -0.5 0.5 -0.5
v -0.2 -0.15 0.5
v -0.2 -0.15 -0.5
v 0.5 -0.5 0.5
v 0.5 -0.5 -0.5
and the function work fine with that specified tolerance.

However when I export the model, I do apply the metric scale to the model when in Max by default is a one max unit represent one inch. therefore my model is tiny. these are the values in meters.
<position float4="8" floats=
"0.012700 -0.012700 -0.012700 1.000000
0.012700 0.012700 -0.012700 1.000000
0.012700 -0.003810 -0.005080 1.000000
0.012700 -0.012700 0.012700 1.000000
-0.012700 -0.012700 -0.012700 1.000000
-0.012700 0.012700 -0.012700 1.000000
-0.012700 -0.012700 0.012700 1.000000
-0.012700 -0.003810 -0.005080 1.000000" />


when I call teh plugin form teh SDK demo wit teh experted model I get the same result, and teh eaosn is that teh tolarnce is too big for size model.

The telrace repsent the maximum distant form a concave face to teh surceav of teh Convex hull that surroudn the collsion of face that face beleng to.
an value of 0.2 is bigget than teh masimun size of the model so teh entien model is collapsed int one single conve hold.

I beleive lighway applis the scale to the model at loading time, and it work with real units as opposted to Max that is always dimension less.
you can verify this by setting a break point here. ..\coreLibrary_300\source\physics\dgMeshEffect3.cpp
line 370 dgMeshEffect::Iterator iter(mesh); and open the array
const dgBigVector* const points = mesh.m_points;
you will see that the point has small values (values in to meters)

if this is the case you can do few things.

-Scale the model before calling the function, and scale back after the call
-scale the tolerance (0.2 * 0.0254)
-see if the OBJ plug in has a Unit system so when you load the model it do not apply the scale.

On my side this weekend I will complete some of the missing features of the functions (mesh simplifcation, and dealling with deep cancavities, dealing with disjoint pieces)
also a better algorith for selecting the best convex cluster.

the after that I will see if I can change the concaviy to be a normalize value so that people will not have to worry about scale systems.

please see if my asumpsions are right

also do not forget to give me teh hans solo model. (OBJ is fine at this time)
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonMeshApproximateConvexDecomposition tests

Postby Bird » Thu Dec 08, 2011 11:06 am

I beleive lighway applis the scale to the model at loading time, and it work with real units as opposted to Max that is always dimension less.
you can verify this by setting a break point here. ..\coreLibrary_300\source\physics\dgMeshEffect3.cpp
line 370 dgMeshEffect::Iterator iter(mesh); and open the array
const dgBigVector* const points = mesh.m_points;
you will see that the point has small values (values in to meters)

Yes, LightWave works in real units.
I still see the original size when I break in dgMeshEffect: http://www.hurleyworks.com/downloads/debugMesh.jpg

Heres' Mr.Solo http://www.hurleyworks.com/downloads/Han_Solo.zip

I'll try scaling the model down to see if it works.

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: NewtonMeshApproximateConvexDecomposition tests

Postby Julio Jerez » Thu Dec 08, 2011 12:17 pm

if the NetwonMesh is geting the original Size in the model then it spould produce the correct partition.

Please try again after to dwonlaod the mates version.

If it fail we will have to some how save that data to ithe dScene Mesh, to make this a litle simpler, can you do that? it soe be no more that few houer of work.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonMeshApproximateConvexDecomposition tests

Postby Bird » Thu Dec 08, 2011 1:45 pm

if the NetwonMesh is geting the original Size in the model then it spould produce the correct partition.

Please try again after to dwonlaod the mates version.

If it fail we will have to some how save that data to ithe dScene Mesh, to make this a litle simpler, can you do that? it soe be no more that few houer of work.

I tried again with the latest svn 1166 and it's sill not working. I tried with higher and lower values for maxConcavity but it still just made 1 pieces.
I'll try to save the data to dScene Mesh, but for now, here's the vertex and indices in case that will work for you.

-Bird

Code: Select all
static const float vertices[] = {
   -0.5,    -0.5,    -0.5,
   -0.5,    -0.5,    0.5,
   -0.5,    0.5,    0.5,
   -0.5,    0.5,    -0.5,
   0.5,    -0.5,    -0.5,
   0.5,    -0.5,    0.5,
   -0.2,    -0.15,    0.5,
   -0.2,    -0.15,    -0.5
};

static const unsigned int indices[12][3] = {
   {3,1,0},
   {3,2,1},
   {1,4,0},
   {1,5,4},
   {6,5,1},
   {2,6,1},
   {2,3,7},
   {6,2,7},
   {7,3,0},
   {4,7,0},
   {5,7,4},
   {6,7,5}
};
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: NewtonMeshApproximateConvexDecomposition tests

Postby Julio Jerez » Thu Dec 08, 2011 2:06 pm

It does not make sence, I did run the same values by freezing the scale in Max and saving the file as it, and it generated a correct partition. two convexes one for each wing.

if you can convert the data to a scene Mesh, it will be eassy to place mode itself in the SDK demo, and see what is wrong.
there must be something missing between what you are doing and what I am doing some where.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonMeshApproximateConvexDecomposition tests

Postby Bird » Thu Dec 08, 2011 2:34 pm

Julio Jerez wrote:It does not make sence, I did run the same values by freezing the scale in Max and saving the file as it, and it generated a correct partition. two convexes one for each wing.

if you can convert the data to a scene Mesh, it will be eassy to place mode itself in the SDK demo, and see what is wrong.
there must be something missing between what you are doing and what I am doing some where.


Heh, probably something stupid I'm doing. I'm not quite sure what you mean by "scene Mesh". I have written code that converts my mesh data to a NewtonBody .... what else do I need to do?

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: NewtonMeshApproximateConvexDecomposition tests

Postby Julio Jerez » Thu Dec 08, 2011 3:08 pm

it is the dScene, it is a file format.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonMeshApproximateConvexDecomposition tests

Postby Bird » Thu Dec 08, 2011 8:20 pm

I'm getting a crash now in svn 1166 when I try to create CollisionCompound for the convex pieces.

It's crashing at line 373 of dgCollisionCompound.cpp because the dgNodeBase* const sourceNode is a NULL pointer.

I tried the NewtonDemos->CompoundColliison and it works ok so I assume there's something wrong on my end but I can't find it. Any ideas why dgNodeBase* const sourceNode would be NULL there?

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: NewtonMeshApproximateConvexDecomposition tests

Postby Julio Jerez » Thu Dec 08, 2011 11:52 pm

Bird wrote:I'm getting a crash now in svn 1166 when I try to create CollisionCompound for the convex pieces.

It's crashing at line 373 of dgCollisionCompound.cpp because the dgNodeBase* const sourceNode is a NULL pointer.

I tried the NewtonDemos->CompoundColliison and it works ok so I assume there's something wrong on my end but I can't find it. Any ideas why dgNodeBase* const sourceNode would be NULL there?

-Bird

what is cratching? you use of the compound collision?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonMeshApproximateConvexDecomposition tests

Postby Bird » Fri Dec 09, 2011 12:09 am

what is cratching? you use of the compound collision?


Yes, but it only crashes after I make a NewtonMeshApproximateConvexDecomposition. I can create a compound collision in other ways and there's no crash.

And your SDKDemo example with the chairs works... so it must be something on my end.

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: NewtonMeshApproximateConvexDecomposition tests

Postby Bird » Fri Dec 09, 2011 5:26 pm

If it fail we will have to some how save that data to ithe dScene Mesh, to make this a litle simpler, can you do that? it soe be no more that few houer of work.

I can save the data to dScene but am still hitting an _ASSERTE (0) on line 47 of dCollisionCompoundNodeInfo.cpp, so I can't generate a scene file if the collision type is CollisionCompound. I'm trying in the latest svn 1170.

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Next

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 6 guests

cron