A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by MatrixChess » Thu Mar 12, 2009 2:28 pm
Hi guys, I'm a Newton Newbie.
I'm developing a simple world with a Treecollision static geometry composed by 1 plane and a dynamic sphere controlled by the user through the keyboard.
The problem is that the sphere collide with the plane only on the front face but not on the back face...
I've read that this is a limit of Newton Dynamics but how can I decide what face must collide?
To construct the Treecollision I tell Newton only the points coordinate and not the normal.
Thanks in advance for any help.
-
MatrixChess
-
- Posts: 5
- Joined: Wed Mar 04, 2009 11:29 am
by Julio Jerez » Thu Mar 12, 2009 4:08 pm
there is not double face collisionn in newton.
the direction of the collision is determined by the normal of the face, which in calculated base on the order of the point of each face.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Stucuk » Thu Mar 12, 2009 6:03 pm
I don't see how its a limitation of the engine. When do you ever need to have a face thats got double sided collision? There are HARDLY anything in the real world that so thin that you could get away with double sided collision.
-
Stucuk
-
- Posts: 801
- Joined: Sat Mar 12, 2005 3:54 pm
- Location: Scotland
-
by Julio Jerez » Thu Mar 12, 2009 6:29 pm
in the old days when we needed to save the liset number of faces, it was fine to have double face collision.
on those day collision was limited to queries and very basic geometrical interestion test, therfore the order of a face was not a problem.
today collision is more accurate and use some features of the geometry.
for example before we did not care about a edge discontinuty, we where happy if we just get a collision, today this is not aceptable.
what edge continuity? is say you have two face that share and edge, if the edge is convex you can extrude the contoure and determine if the contact is in any of
ther voronoi spaces of the two faces and shared edge, if it is, then it is a smooth contact, if is not then the normal need to be project th the closest voronoi space.
These required that the the geometry is a single manifold, so that edges convexity can be are tagged with special flags to do the collision correction.
In the geometry was double sided, it is impossible to determine the voronoi space of shared edges.
I know is sound cofusing but is it the best way I know how Newton reliable tecnology that people just use without worring
of those details than in the end are show stopping in many projects.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Dave Gravel » Thu Mar 12, 2009 11:18 pm
if the double collision sided is only a plane use a box mesh or something like this...
-
Dave Gravel
-
- Posts: 800
- Joined: Sat Apr 01, 2006 9:31 pm
- Location: Quebec in Canada.
-
by MatrixChess » Fri Mar 13, 2009 6:28 pm
This is only the first example I'm implementing... my objective is to load an obj model of an artery and to navigate it with collision...
Now the collisions occur only on the external faces whereas I need the collisions in the internal faces.
So I need to invert the order of vertex for each face in the obj to obtain this?
-
MatrixChess
-
- Posts: 5
- Joined: Wed Mar 04, 2009 11:29 am
by Stucuk » Fri Mar 13, 2009 9:47 pm
Yeh. Order controls if its the Front or Back of a face.
-
Stucuk
-
- Posts: 801
- Joined: Sat Mar 12, 2005 3:54 pm
- Location: Scotland
-
by MatrixChess » Sat Mar 14, 2009 10:52 am
Ok, I've tried this in my simple example and it function!
Now is the problem... How can I define the correct order for about 10000 faces? Not manually I hope
Thanks to all for the replies!!!
-
MatrixChess
-
- Posts: 5
- Joined: Wed Mar 04, 2009 11:29 am
by Julio Jerez » Sat Mar 14, 2009 12:16 pm
In generate the order of teh face is consistent sinc ethe are made using soem sor pf prededucral modelling tool, so the is never a problem
ussuatly model editors like Max, Maya have commands to make sure order of teh face is consistent.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by MatrixChess » Sun Mar 15, 2009 6:28 pm
Thank you very much!!! I've exported the model with Blender and then changed all vertex order for each face, with a simple C program.
The obj file was:
- Code: Select all
# Blender3D v248 OBJ File:
# www.blender3d.org
mtllib plane.mtl
v 0.000000 0.000000 0.000000
v 1.000000 0.000000 0.000000
v 0.000000 1.000000 0.000000
v 0.000000 0.000000 1.000000
s off
f 1 2 3
f 1 3 4
f 1 4 2
And after the change it's:
- Code: Select all
# Blender3D v248 OBJ File:
# www.blender3d.org
mtllib plane.mtl
v 0.000000 0.000000 0.000000
v 1.000000 0.000000 0.000000
v 0.000000 1.000000 0.000000
v 0.000000 0.000000 1.000000
s off
f 1 3 2
f 1 4 3
f 1 2 4
And the collision faces are inverted! (obviously I've written the simple example but the procedure is the same).
-
MatrixChess
-
- Posts: 5
- Joined: Wed Mar 04, 2009 11:29 am
by Stucuk » Sun Mar 15, 2009 7:12 pm
shouldn't it not be:
- Code: Select all
f 3 2 1
f 4 3 1
f 2 4 1
^ Thats true invertion.
-
Stucuk
-
- Posts: 801
- Joined: Sat Mar 12, 2005 3:54 pm
- Location: Scotland
-
by MatrixChess » Mon Mar 16, 2009 8:30 am
It's the same!
Because of the important thing is the clockwise or counterclockwise order, therefore
2
|\
| \
|__\
1.... 3
1 2 3 -> clockwise
1 3 2 or 3 2 1 -> counterclockwise
That's all.
-
MatrixChess
-
- Posts: 5
- Joined: Wed Mar 04, 2009 11:29 am
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 19 guests