Altering a mesh in realtime
by Garth Wood · in Torque Game Engine · 05/03/2006 (9:01 am) · 6 replies
Hi
For my game I want to have realtime mesh destruction. So say for example I cut somebody's arm off; I want to remove that part of the mesh. So my question is, how do I get access to the mesh, how do I remove parts of it and then how do I seal it up again?
Thanks
For my game I want to have realtime mesh destruction. So say for example I cut somebody's arm off; I want to remove that part of the mesh. So my question is, how do I get access to the mesh, how do I remove parts of it and then how do I seal it up again?
Thanks
About the author
#2
If I can do this I would like to extend it to make it work on all objects. So I would get a location of the impact and then cut and replace as necessary.
05/03/2006 (9:35 am)
Hmm, interesting, perhaps that could work. The thing is I also want to attach a different mesh to the part that I've taken away.If I can do this I would like to extend it to make it work on all objects. So I would get a location of the impact and then cut and replace as necessary.
#3
I would recommend looking at existing resources to see how meshes are currently handled and then create a new (well designed) object for your specific needs.
05/03/2006 (9:49 am)
You would have to code it from the ground up as that is an extremely game-specific request.I would recommend looking at existing resources to see how meshes are currently handled and then create a new (well designed) object for your specific needs.
#4
I'd go and pre-build various versions of the arm like
"whole", "missing from wrist down", "missing from elbow down" etc,
then put *all* those meshes into the DTS model,
and only show the one mesh appropriate for the character's state.
Dynamically modifying the mesh is technically very non-trivial,
but even once you get past the technicalities,
i guarantee you'll have better-looking results with hand-modelled meshes.
edit: details of that guarantee: ;)
consider the bloody stump.
you (probably) want that elbow to be ragged, bone-pierced, and bloody.
possibly with reasonable skinning too.
doing that algorythmically is going to be a nightmare.
i suppose you could have a "bloody stump" hunk of geometry which you paste onto the arm at algorythmically-welded points, but, ok. i'll stop; think you get the point..
05/03/2006 (11:11 am)
Check out the hiding meshes resource.I'd go and pre-build various versions of the arm like
"whole", "missing from wrist down", "missing from elbow down" etc,
then put *all* those meshes into the DTS model,
and only show the one mesh appropriate for the character's state.
Dynamically modifying the mesh is technically very non-trivial,
but even once you get past the technicalities,
i guarantee you'll have better-looking results with hand-modelled meshes.
edit: details of that guarantee: ;)
consider the bloody stump.
you (probably) want that elbow to be ragged, bone-pierced, and bloody.
possibly with reasonable skinning too.
doing that algorythmically is going to be a nightmare.
i suppose you could have a "bloody stump" hunk of geometry which you paste onto the arm at algorythmically-welded points, but, ok. i'll stop; think you get the point..
#5
Using my solution is just the "easy" way out. ;)
05/03/2006 (11:57 am)
Well Garth with the extra information you provide in your second post, I can only agree with Orion Elenzil solution. Orion is right, his is the best solution if you are ready for the extra work (art and code) and want the top quality looking "amputee". Using my solution is just the "easy" way out. ;)
#6
Cheers.
05/03/2006 (12:34 pm)
Hey, thanks a lot. Yeah I think hiding and showing will be the best option.Cheers.
Torque Owner Claude-Alain Fournier
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7368
It may not seems that it's what you want but you can remove limbs by scaling a node. So if you scale knee node to "0 0 0" the whole limb from knee down is sized to 0 and the attached meshes disappear.
You can use this with any limb or part of the body.