Hello, I'm currently writing a model loader, and I have quite a few structures for different things, vertices, normals, materials, that stuff. Anyways, in my main model class, I want to have vectors to hold many of those structures. I don't quite know how to explain it, but here's what I mean in code:
As you can see, I can access all the triangles in the model from that one vector. I like that idea, because I can allocate the space as needed, and it's more encapsulated like that.Code:typedef struct { USHORT flag; USHORT vertex_index1, vertex_index2, vertex_index3; USHORT normal_index1, normal_index2, normal_index3; USHORT smothing_group; } TRIANGLE; class Model { public: ..Yadda yadda yada.. private: vector<TRIANGLE> triangles; }
Anyways, on to my problem. How would I initialize these, add another triangle, etc? Is this even possible?
Thanks in advance



LinkBack URL
About LinkBacks



