Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm looking for a resource to figure out how to program a function to cut a 3d model in game.

Example: Enemy/NPC is sliced into 2 pieces with a sword. His body is not hollow, you can see bloody texture where normally a 'polygon hole' would be.

The first step is to actually 'cut/slice' the model, then add in polygons to fill the hole in the model. I know this can be done in 3D modelling software, but I'm not sure how to go about doing this in a game, code-wise. I do not wish to use 'pre cut-up" models, the code will determine where the cut is.

Any pointers in the right direction would be greatly appreciated.

share|improve this question
add comment

1 Answer

What you want to look for are techniques for doing Constructive Solid Geometry, CSG for short. CSG isn't particularly hard (although numerical border cases might cause some trouble), but doing it in realtime isn't trivial.

Sander van Rossen writes interesting stuff about the datastructures he used for his particular implementation. His approach might be more approriate for animated character models than the standard BSP representation often used in non-realtime CSG.

A solid open implementation of rendering CSG objects is OpenCSG.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.