Dealing with intersection artifacts

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Dealing with intersection artifacts

Postby Bird » Sat Feb 18, 2012 12:45 pm

Hi Julio,

I made a simple simulation of some coins filling up a jar and near the end of the animation one of the coins penetrated jar and got stuck in it's neck. Could you please tell me what causes this behavior and how to avoid it in Newton? I'm using the latest SVN core_300.

Here's a rendered image showing the penny stuck in the left side of the jar's neck. http://www.hurleyworks.com/downloads/pennies_in_jar8_0206.jpg

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

Re: Dealing with intersection artifacts

Postby JernejL » Sat Feb 18, 2012 1:28 pm

How about a debug render of that scene?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Dealing with intersection artifacts

Postby Bird » Sat Feb 18, 2012 3:41 pm

JernejL wrote:How about a debug render of that scene?


Here's the NGD file. http://www.hurleyworks.com/downloads/penny_intersection_error.zip

My current SDK demo app crashes while trying to load this file though. I tried to find out where it was crashing but I can't get the SDK demo to compile anymore with the latest SVN version 1587

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

Re: Dealing with intersection artifacts

Postby Julio Jerez » Sat Feb 18, 2012 4:46 pm

darm!!! :D that's the kind stuff is what I am talking about newton 300 is designed for.
as bad as the pentration looks, tha is awesome.

how did you make the jar?
how fast did that run? can you make a video so that I can see how the animation worked?

I will try to load the scene file and see what it is,
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Dealing with intersection artifacts

Postby Julio Jerez » Sat Feb 18, 2012 5:02 pm

Bird wrote:I tried to find out where it was crashing but I can't get the SDK demo to compile anymore with the latest SVN version 1587
-Bird

why can't you get the lastest to compile? can you try again, I check in version 1588, and open to an empty force and build it.
Maybe you got a version with a missing file highmap demo file, but I added it to the project, it sodul compile fine now

can you try again?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Dealing with intersection artifacts

Postby Bird » Sat Feb 18, 2012 5:53 pm

Julio Jerez wrote:darm!!! :D that's the kind stuff is what I am talking about newton 300 is designed for.
as bad as the pentration looks, tha is awesome.

how did you make the jar?
how fast did that run? can you make a video so that I can see how the animation worked?

I will try to load the scene file and see what it is,


I recorded how the scene computes in LightWave. There's 700 pennies in this version and it runs quite smoothly. I don't have the code in place yet to calculate the physics time versus graphics time.

http://www.hurleyworks.com/media/flash/7Bucks/7Bucks.html

As you can see, another problem I have is that the simulation solves differently each time I run it. In the wireframe version you can see that this time a penny actually pops out of the jar.

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

Re: Dealing with intersection artifacts

Postby Bird » Sat Feb 18, 2012 6:04 pm

Julio Jerez wrote:
Bird wrote:I tried to find out where it was crashing but I can't get the SDK demo to compile anymore with the latest SVN version 1587
-Bird

why can't you get the lastest to compile? can you try again, I check in version 1588, and open to an empty force and build it.
Maybe you got a version with a missing file highmap demo file, but I added it to the project, it sodul compile fine now

can you try again?

I tried again with 1588 and it compiles fine now. The SDK demo still crashes while trying to load the penny simulation file.

Here's what I get while debugging in case it's not crashing for you: http://www.hurleyworks.com/downloads/Sdk_demo_crash.jpg

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

Re: Dealing with intersection artifacts

Postby Julio Jerez » Sat Feb 18, 2012 6:53 pm

excellent.

I can clearlly see the Bug, when the penny pops out of te yard.
I beleive this is a bug I have being chasing for some time, but that I have neggleted.

Bacially the is a bug in the latest solver that some how makes or collision system than make the collision resolution to gain enegry.
I do have a setup that reproduces the bug but is is a test when I drop 3000 sphere on the a mesh.
and after the fall one ball pops like a projectile.
I was writting some debug code to track it, but then I go destracted with anothe 2010 preojects.

ayway let us do this.
First let me see if we can first find out why the exported file crash. and If I can loat it I will debug the bug in the test demo.

I Have an ideal of what that is, it is just that I have no put time to fix it, because it take lot of effort to add code to track it.
but it is time to fix that.

when you say the demo crash, do you mean you are tryin to load it in the SDK demo, or are you tryin to load it in you plug in?

edit:
never mind it crashe in the SDK demo, let me address that problem first and we move from there.

afte we fix the problem we nee to address the issue wit teh simulation being different avery time.
the one question I have is are you using mutithreaded set up?
and are you using fix time step.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Dealing with intersection artifacts

Postby Bird » Sat Feb 18, 2012 7:08 pm

afte we fix the problem we nee to address the issue wit teh simulation being different avery time.
the one question I have is are you using mutithreaded set up?
and are you using fix time step.


Yes I'm using multithreading and a fixed time step.

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

Re: Dealing with intersection artifacts

Postby Julio Jerez » Sat Feb 18, 2012 7:56 pm

Mutithread at thsio time is not deterministic at thsi time. I will add an uptio for deterministic muthitreaded solution, but it is no a proiroty I have lot of oteh thong to complete first.

for this test for debugin popouse can you try running with Non Simd and not mutithreaded, just to see if the outcome is the same with different runs.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Dealing with intersection artifacts

Postby Bird » Sat Feb 18, 2012 8:06 pm

I made a simplified scene with 500 boxes that might be easier for you to debug. Here's a video of how it runs in LW.
http://www.hurleyworks.com/media/flash/Poppers/Poppers.html

I set gravity to be -30 which seems to help cause problems and it looks like the first box passes right through the container.

Here's the NGD file http://www.hurleyworks.com/downloads/high_energy_poppers.zip

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

Re: Dealing with intersection artifacts

Postby Bird » Sat Feb 18, 2012 8:39 pm

for this test for debugin popouse can you try running with Non Simd and not mutithreaded, just to see if the outcome is the same with different runs.

Still can't make Newton deterministic with those settings

Before each run I reset each body's Velocity, Omega and start pose.
And I call NewtonInvalidateCache()

Is there anything else I'm supposed to be doing?

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

Re: Dealing with intersection artifacts

Postby Julio Jerez » Sun Feb 19, 2012 9:28 am

it soud be deterministic if you start the engine, it is no if you simply reset the position an dveocities.

this is because I have not implemented NewtonInvalidateCache() yet, it will be a waste of time if I did while I am making change still.
There is one more change that will affter how memopry is keep in core 300, then afte that I will complete imvalidat cache.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Dealing with intersection artifacts

Postby Julio Jerez » Sun Feb 19, 2012 10:52 am

Ok I try to load the scene and it crash in my too.

I trace the bug and it is a memory overun in tiny xml

when you write the , some how the name fild is no initialize and time xml write a series of garbage
but then when is going to read teh same fild again i produce a memory oberun an dteh file get corrunted

here is how teh name filed is being written
<dMeshNodeInfo>
<dGeometryNodeInfo>
<dNodeInfo name="ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÍ#" />
<pivotMatrix float16="1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000" />
</dGeometryNodeInfo>


you can see that name is a sereis of random characters.
can you show me the piece of code you wrote to write the mesh, I am guessing it is the user mesh, they have to be a unitialized variable that is making the srialize to write garbage than cannot be read back into the file.


I edit the file by hand, by using regular expresion, and I was able to read the demo, I see the box with all the small boxes falling on it.
It run fine in my system by I did not really see wha was going on because I do not have trasparent render, I have to add that to the file format.

anyway first thing first, please show me the glue code you are using to write the user mesh to the file, there have to be a bug there.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Dealing with intersection artifacts

Postby Bird » Sun Feb 19, 2012 3:29 pm

anyway first thing first, please show me the glue code you are using to write the user mesh to the file, there have to be a bug there.

Here's the code I use to serialize the scene to the NGD file
Code: Select all
MakeViualMesh context (world_);
dScene testScene (world_);
testScene.NewtonWorldToScene (world_, &context);
testScene.Serialize ("E:/Depenencies/NewtonTrunk/applications/media/high_energy_poppers.ngd");


And here's the MakeVisualMesh class

Code: Select all
class MakeViualMesh: public dScene::dSceneExportCallback
{
   public:
   MakeViualMesh (NewtonWorld* const world)
      :m_world (world),
      mesh(0)
   {   
   }
   ~MakeViualMesh()
   {
      if( mesh )
       NewtonMeshDestroy(mesh);
   }

   NewtonMesh* CreateVisualMesh (NewtonBody* const body, char* const name, int maxNameSize) const
   {
      NewtonCollision* collision = NewtonBodyGetCollision(body);
      mesh = NewtonMeshCreateFromCollision(collision);

      return mesh;
   }

   NewtonWorld* m_world;
   mutable NewtonMesh* mesh;
};



I edit the file by hand, by using regular expresion, and I was able to read the demo, I see the box with all the small boxes falling on it.
It run fine in my system by I did not really see wha was going on because I do not have trasparent render, I have to add that to the file format.

I have gravity set to -30 in my scene. I don't think that gets saved when writing the NGD file

-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