A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by Neo » Tue May 29, 2012 4:17 pm
I use plane to build as a tree collison, but when I create a Nowton box into the world, it falls through the plane,
as if the plane is not exist...

Then I tried hard to find solution, it seems that mesh tree collison only works when the mesh is a convex hull,am i right?
-
Neo
-
- Posts: 127
- Joined: Fri May 11, 2012 12:29 pm
- Location: China,Sichuan
by Julio Jerez » Tue May 29, 2012 4:37 pm
not collision tree, works with any kind of polygons that do no self intesect: convex or concave.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by PJani » Wed May 30, 2012 8:33 am
Are you setting inertia?
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
-

PJani
-
- Posts: 448
- Joined: Mon Feb 02, 2009 7:18 pm
- Location: Slovenia
by Neo » Wed May 30, 2012 9:10 am
Julio Jerez wrote:not collision tree, works with any kind of polygons that do no self intesect: convex or concave.
still cannot work..then i change the terran model into a newton box...this time collison happens ,but sth wierld took place:the box i dropped from a very low place bounce up very high,and had fly out of the newton world directly(normally the box fall down and disapear when hit the floor, then i set the gravity and mass to a very small value, such as mass=0.1 and gravity=0.01. then i found that it's not disapear but bounce very high, even higher than the original drop hight).....
ps:
i use lrrlicht 1.7.1 for graphic perpose and
my newton version is 2.35, download from googlecode.
-
Neo
-
- Posts: 127
- Joined: Fri May 11, 2012 12:29 pm
- Location: China,Sichuan
by Neo » Wed May 30, 2012 9:12 am
PJani wrote:Are you setting inertia?
of course, use the NewtonConvexCollisionCalculateInertialMatrix() and NewtonBodySetMassMatrix()
-
Neo
-
- Posts: 127
- Joined: Fri May 11, 2012 12:29 pm
- Location: China,Sichuan
by Julio Jerez » Wed May 30, 2012 9:46 am
get version 3.00 for svn
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Neo » Wed May 30, 2012 11:55 am
Julio Jerez wrote:get version 3.00 for svn
NewtonSetWorldSize and NewtonReleaseCollision have disapeared in the v3.00...
Is it a change to old version?
-
Neo
-
- Posts: 127
- Joined: Fri May 11, 2012 12:29 pm
- Location: China,Sichuan
by Neo » Wed May 30, 2012 12:05 pm
Julio Jerez wrote:get version 3.00 for svn
same result...

-
Neo
-
- Posts: 127
- Joined: Fri May 11, 2012 12:29 pm
- Location: China,Sichuan
by Neo » Wed May 30, 2012 12:24 pm
I let the console print out veloclity every time when game update, and then i found out that forthe first few seconds(my gravity is -0.01,and mess is 1 , so i can observe it clearly), the box accelerate like a normal stuff falling, but then the velocity start reduce. After hit the floor(a large newton box with 0 mass), it bounce at amost 10 times as the falling speed and fly to the sky....then it velocity began to reduce to minus, box start to fall. However, the falling speed still repeat the accelerate-for-shot-time-then-reduce's process...WTF....

-
Neo
-
- Posts: 127
- Joined: Fri May 11, 2012 12:29 pm
- Location: China,Sichuan
by Neo » Thu May 31, 2012 3:24 am
well, i've wrote this program by modifing this examle
http://newtondynamics.com/wiki/index.php5?title=Tutorial_-_Irrlicht_and_Newton_start, later i found that collision works well when i change the getRelativeTransformation to getAbusoluteTransformation, though the poision isn't right(the model came back to thr origin)...but i believe i can handle it , just adding some code to modify the posion.
but the point is, now the floor(the huge newton box), when i tried to load it as tree collision, the box i dropped still fall through it:(
I want load a tree collision as terrain and use bouding box of model to deel with collison, briefly speaking, a tree collison with multiple primitive collison. How can i get it work?
BTW, does tree collison and convex hull collides each other? thx
-
Neo
-
- Posts: 127
- Joined: Fri May 11, 2012 12:29 pm
- Location: China,Sichuan
by Julio Jerez » Thu May 31, 2012 7:55 am
yes everything collide with everything else, with execption of static mesh versus static meshes (collision tress vs collision tress or hieghtfield)
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Neo » Thu May 31, 2012 12:30 pm
Julio Jerez wrote:yesy every thing collide with every thing else, wit th exemtion of static mesh versus static meshes
thx, the convex hull works, but collison happens before the scene node actually hit (they are far from each other)
it seems that the newton body's location is differ to the irrlicht scene,my function code to create the convex hull is quite familiar with it
http://newtondynamics.com/forum/viewtopic.php?f=9&t=7230&start=30, what did i do addtionally is to create a newton body with that collison object.
and transform it
- Code: Select all
NewtonCollision* collision_obj=NewtonCreateConvexHull(nWorld, nVertices, &vertices[0], sizeof(f32)*3,0.001f,10,NULL);
matrix4 matrix=irr_meshS->getAbsoluteTransformation();
vector3df origin =matrix.getTranslation()*IrrToNewton;//irrToNewton is set to (1/32)
matrix.setTranslation(origin);
NewtonBody* cb=NewtonCreateBody(nWorld,collision_obj,&matrix.pointer()[0]);
is it the transform cause the problem? i know nothing about transform matrix

-
Neo
-
- Posts: 127
- Joined: Fri May 11, 2012 12:29 pm
- Location: China,Sichuan
by Julio Jerez » Thu May 31, 2012 1:08 pm
if you are using Netwon 300, you cna us eteh serialization and test teh scene in teh sandbox demos
all you nee to do is this.
after you create the workd or at any time you can call this funtion
void NewtonSerializeToFile (const NewtonWorld* const newtonWorld, const char* const filename);
then you can load the file in the sandbox and see if they are differences between what you see and what you the world is doing.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Neo » Thu May 31, 2012 11:02 pm
Julio Jerez wrote:if you are using Netwon 300, you cna us eteh serialization and test teh scene in teh sandbox demos
all you nee to do is this.
after you create the workd or at any time you can call this funtion
void NewtonSerializeToFile (const NewtonWorld* const newtonWorld, const char* const filename);
then you can load the file in the sandbox and see if they are differences between what you see and what you the world is doing.
thx a lot Julio, it do help a lot.
what i'm seeing is, my tank box apear in the right place with right scale(because it's a primitive collison, not user mesh), bu the scene(this time only a larger box, i use it as floor, but load it as user mesh collison)become very large. to the degree that when i start the scene, i am in the floor's collison box! It's a very huge box, ten times larger than the actual size of the scene node. yeah, the it's the problem of scaling, maybe i should scale the point when i add faces to the tree collision or transform vertex when i load them to the convex hull?
PS:Did the NewtonReleaseCollison have removed from Newton 300? The compiler said there's no function called NewtonReleaseCollison..
-
Neo
-
- Posts: 127
- Joined: Fri May 11, 2012 12:29 pm
- Location: China,Sichuan
by Julio Jerez » Fri Jun 01, 2012 7:24 am
NewtonReleaseCollsion is deprecated.
you can try using the scale feature of the collsion to match the size of you visual mesh
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 0 guests