PDA

View Full Version : VBO and Moving Parts



mattloto
06-08-2011, 11:13 AM
Hi! So I'm working on a project and I'm writing a .OBJ importer. I read up online that in order to make it fast enough when using complex models, you should use VBO, and for that I saw that there was STATIC, STREAM, and DYNAMIC. I will be using the OBJ importer in a game, and part of that will be with characters that have moving arms, legs, etc. I read that in order to having moving body parts, you need to have each body part separate, rotate/transform them individually, and then draw a few meshes that go between where the body parts meet (if this isn't the best way, then please tell me). Now, back to the VBO. Would I use dynamic for this? And also, can you change the size of a VBO while it's running? I'd use that when creating the meshes that join the body, or should I just allocate a few meshes per joint and keep the size constant? Thanks!

BionicBytes
06-08-2011, 03:47 PM
First you need to expand the vertex info from the obj file into vertex array so that each vertex, tex coords and normals are unique and not shared.
Whether or not you upload those to vbo(s) really depends on your expected usage. If you are going to be updating the vertex arrays continuosly then it may not be worth while uploading to vbo. Static vertex arrays should be uploaded with GL_STATIC.