David Williams wrote:
(it's probably not necessary though)
That's what fixed it for me. It had never occurred to me that I could access the necessary directly through getVertices() function, like so:
Code:
float position=volume[index].meshData.mesh->getVertices()[vertexNumber].getPosition().getX();
That drastically simplified things for me and made my code work
I still have no idea why it wasn't copying properly but I no longer care
David Williams wrote:
In this paricular case the format of a vertex is specified in the 'PositionMaterialNormal' and basically consists of floats representing the position, material, and normal. The vertex data is then just an std::vector of these vertices.
I understood that bit alright. I actually understood more about how meshes are composed than I thought I did. I just confused myself by thinking that the number of indices (in my case, 96) needed to be divisible by the number of vertices (18), but of course it doesn't. There's only a problem if the number of indices isn't divisible by 3.
David Williams wrote:
The interesting part is then the index buffer, which specifies how these vertices are connected to form triangles. Every group of three entries in the index buffer represents a triangle. Each index is just a number telling you which vertex to use.
Ah good, just as I thought. I was hoping it wasn't something weird that was going to make it difficult to integrate with DBPro, but all is well
I often struggle to get my head around seemingly simple concepts until someone else (in this case you) explains it, even if they explain in a similar way. My brain sort of freezes up
David Williams wrote:
You should probably read a bit more about index and vertex buffers here:
http://rbwhitaker.wikidot.com/index-and-vertex-buffershttp://msdn.microsoft.com/en-us/library ... 25(v=vs.85).aspx
I'll do that because I really need to understand what I'm working with. Thanks for the links
David Williams wrote:
I'm not sure if the above helps
It did help, thanks
Thank you for helping me over and over again with dumb little things
You're the best support-person I could hope for, particularly with free software such as PolyVox
Clonkex