   Own vertex buffer for each vector (each object)? (Direct X)
  Hello,At first i want to point out that my english isn't the best, so excuse me for any language mistakes i make.I'm new to DirectX programming but i'm experienced in C++ programming. I tried to follow the DirectX SDK Tutorials, but i'm very confused with a topic and i couldn't find tutorials on this.  Here it goes:In the DirectX Tutorials there is a function to draw the geometry. (Defining Custom Vertex with vertices for a triangle, then copying it to the vertex buffer) and later drawing the triangle in the render function (DrawPrimitive(...)So here are my questions: What is a good way to encapsulate a single model? (like creating a struct/class for the model with a vector holding the coordinates of the vertices. How to connect the class with the vertex buffer ? It would not be a problem if i could create an own vertex buffer for each object, is this the right way?If i want i.e. more models (i.e. triangles) and rotate each in another direction, how do i get access to only the desired model and not to all at the same time ? I know there is an index buffer but what is a good way to refer to the desired vertices ? I'm sure there is a efficient way dealing with more than one object...I would be very thankful if someone could show me a tutorial on drawing multiple, different objects and transforming each one separately. I hope you understand my problem and i would be very happy if someone could help me and don't just tells me to read the SDK documentation... Thank you,Michael[Edited by - dxnewb on June 25, 2009 5:13:46 PM]
  Hiya, i had a similar problem.I really do recomend Directxtutorials (google it). It's great it starts you from scratch and really helps and explains large amounts of Dx. I'm forever singing this website's praises.Any way hope that helped.PureBlackSin;  Usually you can do this by drawing the same model, but using different transformation matrices. Don't move the actual vertices for the model, but just set a different matrix that translates them. So the class that holds the position information only needs a matrix, and a static model class (same model for each object of the same type) holds the vertex buffer, which is never changed.If you need more advanced animation you can usually do that in a vertex shader, but it's another topic.   ;  All in all, this depends on what you plan to do with your models. You might want to look up Scene Graphs or Transformation Trees on Google. Essentially, they are ways of organizing a 3d scene.But to answer your question more accurately, you could potentially just create a class called Mesh or Model and store everything about it in there, including a vertex buffer. That's what most engines do anyways.You could also create classes for vertices, triangles, quads, etc. that the model class would interface with, but that might only be useful if you plan to perform algorithms on the vertex data itself (model editor for example).Like I said though, it all boils down to what you want to achieve.   