A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by Carli » Thu Dec 03, 2009 4:40 pm
Hi,
I had in my old game engine (which was not using newton) a voxel system:
http://www.youtube.com/watch?v=0RhDQiHMfuYIt was a set of 32*32*32 cubes of weighted voxels in an aligned grid with one Voxelmap each material.
The Voxels will be converted to a concave mesh (for drawing) for each 32*32*32 box which leads to the effect that you don't have to render the landscape that is too far away.
How can I reimplement the Voxel Engine using Newton?
The Voxelmap is very dynamically, you can blast holes, dig into it, water can flow.
How do you think can we get the same Effect (blowing holes, digging, water simulation) with Newton?
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
by Julio Jerez » Thu Dec 03, 2009 5:18 pm
Since you convert the mesh to triangles for rendering,
The eassiest to integrate that system with newton will be using a user defined collision and pass the faces in the call back.
you can check the plane collision or the hightfield in the SDK.
if you can generate the faces quick enought for rendering then it should be fine for collision too sien collision only use the face inside an AABB in a callback.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Carli » Fri Dec 04, 2009 3:35 am
Could you imagine, that there would be a dynamic digging-and-blasting functionality for meshes in newton?
The voxel engine is fine for single player but one voxel cube has a size of half a megabyte an that's too much for a network game.
Working with voxel-generated-meshes is very slow - we had a simple raycasting with directly accessing the voxels
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
by JernejL » Fri Dec 04, 2009 5:30 am
A user defined collision can already do holes in terrain, as you tell newton the shape of your voxel object every time it is being checked for collision in a particular AABB, all you need to give newton are faces in that region + your own raycast for the voxel object.
Newtonmesh can also do what you describe - carving terrain meshes.
-

JernejL
-
- Posts: 1587
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by Carli » Fri Dec 04, 2009 9:08 am
What i thaugt about was to integrate a terrain engine into the destruction demo -- that means blasting out a part of the mesh or digging into a destructible ground. The results would be more realistic than a voxel implementation which will "remove" blasted material.
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
by Julio Jerez » Fri Dec 04, 2009 10:30 am
I am confuse are you talking about teh destrution in newton or your voxel destrution?
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Carli » Fri Dec 04, 2009 11:55 am
I'm talking about both.
Landscape destruction would be more realistic with a mesh-based method.
So you could extend Newton Destruction for huge size terrains
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
by Carli » Wed Feb 10, 2010 5:56 pm
I'm having a separated graphics and logic(=physic), so it would be much effort to generate the resulting mesh twice.
Is there an other option, for example having a user defined callback which part of the world is solid…
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
by Carli » Thu Feb 11, 2010 2:24 pm
what functions do I have to create a "user definded collision"?
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
by Carli » Wed Feb 24, 2010 4:48 am
I tried to understand the usermesh collision but it does not seem to be efficient to my problem.
I have following questions:
- collideCallback - when is it called? what do the parameters mean?
- rayHitCallback - do i really have to define it if it should work?
- getInfoCallback - most of the data i even do not need - every face has 3 vertices, the faces do not have any user data, i don't have indexed vertices
- facesInAABBCallback - how often is it called
or is there an other efficient method to have voxel physics in newton?
i'm thinking about for example dividing the concave landscape to many convex hulls and merge them in a compound collision…
Edit: i experienced that it's nearly impossible to walk on a convex hull because it's bouncing off very often.
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
by JernejL » Wed Feb 24, 2010 5:56 am
Carli wrote:I tried to understand the usermesh collision but it does not seem to be efficient to my problem.
I have following questions:
- collideCallback - when is it called? what do the parameters mean?
- rayHitCallback - do i really have to define it if it should work?
- getInfoCallback - most of the data i even do not need - every face has 3 vertices, the faces do not have any user data, i don't have indexed vertices
- facesInAABBCallback - how often is it called
or is there an other efficient method to have voxel physics in newton?
i'm thinking about for example dividing the concave landscape to many convex hulls and merge them in a compound collision…
Edit: i experienced that it's nearly impossible to walk on a convex hull because it's bouncing off very often.
Check out the: NewtonCreateUserMeshCollision wiki page.
Also, convex hulls are fine for walking on them, you must be having materials set up to respound in a bouncy way..
-

JernejL
-
- Posts: 1587
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by Carli » Thu Feb 25, 2010 4:22 am
Check out the: NewtonCreateUserMeshCollision wiki page.
But that's my Problem: the callbacks are undocumented
Edit: can I set the undocumented callbacks to nil?
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
by JernejL » Thu Feb 25, 2010 4:55 am
I think they can be left null but then some functions on the objects won't work (those that you don't implement).
Julio should know more about how to use these callbacks, i haven't figured them out myself either a few years ago when i tried to use the usermesh..

-

JernejL
-
- Posts: 1587
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by Carli » Fri Feb 26, 2010 8:02 am
Would it be fast enough to have the map as a set of boxes/speres/convex hulls with mass=0 in a compound collision or any other things?
or an other idea would be to divide the voxel landscape into some convex hulls but i don't have the mathematical basement for it (cutting ears…)
would be nice if someone could help me!
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
by Carli » Sat Feb 27, 2010 1:34 pm
Good News: Newton is fast enough to handle each Voxel as a 8-points convex hull!
Now I try to merge some 8-points convex hulls to bigger objects
-
Carli
-
- Posts: 245
- Joined: Fri Oct 02, 2009 5:28 am
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 0 guests