Hi
I was wondering if there is any simple code that demonstrates a static terrain being deformed/changed and having its collision and physics recalculated, so dynamic ones interact properly with the new structure/shape/mass.
Otherwise, any tips where I should start?
i never did anything like that, so my suggestion might be off and performance wise a bad idea.
Maybe you could try to create the terrain from a heigthmap with many small tiles.
Then generate StaticPhysicNodes for those tiles.
Now if a object hits the terrain with a great enough force, you modify the heightmap and create a bump in it.
Then recreate the tiles which have been modified, recreate the staticNodes and switch the old nodes with the new ones.
This whole modifying and replacing of Nodes could be done in a separate thread, to avoid lagging when the nodes are replaced.
There were posts about it on the boards. Hevee posted a video of a jME-based tech demo for it, I believe.
Hi Again!!!
I found something!
There is a technology called PolyVox, look at here:
http://www.thermite3d.org
It is not in Java, but with SWIG
http://www.swig.org/
java bindings can be created (like it was done to ODE and others).
And finally, some kind of JME integration can be created!!
There is just something missing… oh yes! someone to do all this work!! xD
So if you are interested, you can look at this very self thread here where u r.
And the PolyVox thread here:
http://www.thermite3d.org/phpBB3/viewtopic.php?f=2&t=10
May be something very interesting can come out of this… someday
Of course, given this voxel world we still need some we of rendering it. There are a few options:
* Use Raycasting: Raycasting is a computer graphics technique which involves tracing virtual 'rays' from the camera position into the scene. For each pixel on the screen, a ray is traced until it hits an object at which point lighting and shading calculations are performed to determine the pixel colour.
* Render individual voxels: The voxels representing materials other than air can be rendered using graphics hardware. Each voxel could be displayed as a point sprite, or even as a cube mesh (though this would be costly).
* Extract surface: An algorithm (known as Marching Cubes) is used to convert the volumetric representation into a conventional polygon mesh. This can then be rendered in the same way as any other geometry in the scene.
Needless to say, there are many trade offs to be considered when choosing one of these approaches. PolyVox uses the surface extraction approach which allows it to integrate easily with existing 3D engines. When the world is first created PolyVox generates an initial mesh. When the world is then modified, the 3D engine simply requests new geometry for the appropriate region.
I would say that system is cool, but I wonder about the scalability (their demo is a pretty small area)...
I coming together the conversations of you and me interested in the subject by the following, make I have an environment to simulation of crowds and wanted to test them in a virtual environment through an engine, as I deal with java to create the behavior of the officers, thought to use an engine in java and like much of jME. And I began to as floods and land search them, and my next step would be tumbling hillsides, to simulate
geographical accidents caused by cyclones, tsunamis or floods until … So I am trying to understand what
you have been doing …
teique said:
Hi Again!!!
I found something!
There is a technology called PolyVox, look at here:
http://www.thermite3d.org
It is not in Java, but with SWIG
http://www.swig.org/
java bindings can be created (like it was done to ODE and others).
And finally, some kind of JME integration can be created!!
There is just something missing... oh yes! someone to do all this work!! xD
So if you are interested, you can look at this very self thread here where u r.
And the PolyVox thread here:
http://www.thermite3d.org/phpBB3/viewtopic.php?f=2&t=10
May be something very interesting can come out of this... someday :)
You don't really need a library for this. jME already has marching cubes implemented so all you need is the scalar field. You can easily create an app that would allow you to modify the scalar field in real time while updating the terrain that represents it. You may have to modify the marching cubes implementation so that triangles are automatically sorted into tiles upon creation. The only issue I see is the selective updating on specific tiles.. You may want to constraint the algorithm from operating on parts of the scalar field that are clearly outside the applied modification.
Momoko_Fan said:
You don't really need a library for this. jME already has marching cubes implemented so all you need is the scalar field. You can easily create an app that would allow you to modify the scalar field in real time while updating the terrain that represents it. You may have to modify the marching cubes implementation so that triangles are automatically sorted into tiles upon creation. The only issue I see is the selective updating on specific tiles.. You may want to constraint the algorithm from operating on parts of the scalar field that are clearly outside the applied modification.
Oh! the polyvox stuff is just about voxels also, that is just about marching cubes xD http://en.wikipedia.org/wiki/Marching_cubes !
I will surely look for those marching cubes stuff implemented on JME2 !
Yes, it is mandatory that it can be changed dynamically and all modifications affect entities on a physics environment, as fast as possible of course :)
thx! xD
btw, I also found a project in java that does fast dynamic deformation that affects environment entities (beta):
http://sourceforge.net/projects/x-phase/
I dunno if it is with JME2 or even ODE tho (neither if it uses voxels concept).
I agree with Core-Dump in that a sensible (initial) approach to this for most games would be the tiled strategy.
I think you will also need some sort of CSG algorithm in place in order to perform the deformation.
It would be nice to see something like this for JME.