user3072616
user3072616

Reputation: 57

How to cut mesh efficiently?

I want to cut the mesh into pieces. So I encounter a programming problem: how to add new cut node to the original mesh VAO(vertex array buffer) efficiently? With the cutting procedure going on, more new cutting node created at the same time. It means that there are many new nodes has been created each frame. Do I need to rearrange the structure of VBO(vertex buffer object) and IBO(index buffer object) by inserting new vertex and index to VBO and IBO at each frame ? Do someone have some good ideas on how to cut mesh and update VAO more efficiently?

Upvotes: 0

Views: 1080

Answers (1)

BWG
BWG

Reputation: 2278

I had a question much like this, Multiple, dynamic model data in opengl.

Basically, from what I found, you can have one VAO, and one VBO set (locations, normals, etc), and then manually manage the memory using glBufferSubData(). But I found that to be too hard (eh, not hard, but time consuming) for what I wanted, so I just add a VAO and new VBOs for each part that is cut off. Then, delete them when the are gone. Basically just make a robust mesh/model system that has easy to call delete and copy functions.

Upvotes: 0

Related Questions