0
\$\begingroup\$

I am working on a prototype for a very low poly game. I can't figure out a way for a player to cut or break objects in real time without predefined fractures. For example, if a player cuts a tree, it will separate at the cut point rather than at a predetermine fracture. So how can you create a vertex loop and separate the halves in real time?

\$\endgroup\$
1
\$\begingroup\$

EDIT: if you still really want to cut that model in half realtime without any predefined fractures, you might want to look into clip planes. They don't actually generate two separate meshes but you might be able to achieve the effect you want with them.

I found a similar question on another gamedev site - and as I figured, there's no easy solution. To quote one of the replies:

In the case of a wooden beam, it may be relatively straightforward because you already know the cross sectional shape. In the general case, it's doable on well formed meshes but kind of a pain. Essentially you'll have to calculate where the vertices should be and create a new mesh.

So, what I was thinking was - why not create more than one predefined fracture - and pick the closest one to where the player cuts? And if the visuals aren't that detailed you may even be able to move some of the model pieces around a bit so that a cut point is closer to where the player actually cut. Here's an image explaining my idea: (please don't mind the icky-looking microsoft paint graphics. xD)

Treechop

I'm not sure if this method would suit your needs but it might be more effective and/or easier than modifying model mesh data on the fly. Especially because there's not much in the way of support for that kind of stuff, or at least as far as I can tell. Anyway - good luck - hope this helps.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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