Exploding hea-- Um, deleting mesh parts

Blitz3D Forums/Blitz3D Beginners Area/Exploding hea-- Um, deleting mesh parts

Kiyoshi(Posted 2011) [#1]
Is there a way to find the picked part or section of a mesh using Camerapick, then deleting it? I'm making a zombie game, and I would like to delete the zombie's head (or arms and legs, if need be) when shot. Like I said, I'm using Camerapick for this one.

Thanks!

p.s. Sorry if this question has already been asked. I just couldn't find it if it was.


SLotman(Posted 2011) [#2]
If you have a single mesh for the model, then no.

You must have the model done as parts (even if exported all together as a single b3d, but in the modeler you should have legs, arms, heads, etc as single objects)

That way you can use GetChild to list all the child entities on the zombie mesh, apply entitypickmode on those children, and camerapick should return the correct part 'being hit'.

Summarizing: it all depends on how the mesh was created.


Yasha(Posted 2011) [#3]
There are the PickedX, PickedY, PickedZ commands. If your entity is picked, you can find out where on the entity it happened with these. With that done, you'd need to supply your own way of deleting the vertices as you can only clear a surface completely (normally you rebuild with the required bits not included).

However, if I recall correctly, they don't work with animated meshes... so probably not of much use to you. You could however pick the bones, or invisible target meshes attached to the bones, and then use the coordinates to decide what to do to the visible mesh.

Last edited 2011


jfk EO-11110(Posted 2011) [#4]
Instead of deleting vertices I's rather delete Triangles and leave the Vertices as they are. PickedTriangle would return you sure guess what. But basicly I have to say: this will look poorish. A zombie that will desolve in Tris? What the.

Here'S a siggestion for something much cooler that might competite with modern FX:

Create your Zombie with multiple parts, as SLotman suggested. Then create several versions of each bodypart, with nice wounds and blood etc. So when you shot someones head off (and swap the bodypart accordingly, disguised by the blood particle fx), the neck will look bloody real.

Tho, have to say I'm not a fan of splatter elements. But if you do them, do it right :)


Kiyoshi(Posted 2011) [#5]
Okay, thanks guys! This helps! :D