Original Post
Hello people,
I got my little renderer running, but there''s something I just want to know. When you add triangles to the Triangle list do you add them transformed or untransformed? If you add them untransformed how do you apply the Transformation matrices later? and if you add them transformed are you using some buffers in each model to hold the transformed vertices until they are rendered?
Note: perhaps it will be of some help to explain a little how my renderer is working right now. I have some loaders that load model geometry and stores it in a mesh manager (more or less), so you can ask for a model frame (I´m using key frame animations) by id, etc... The thing is that to add this mesh to the renderer queue I have to add this mesh triangles transformed because I can´t figure out a better way to do it, so I have in each model class a vertex buffer (no a d3d buffer just a chunk of system mem) where I transform the mesh vertices (applying the model transformation matrix) and then I pass this buffer to the renderer. But, I think this is a bad way to do it because I´m wasting lota memory and it needs a lot of cpy time because I have to transofrm the vertices, add them to the buffer (the one in each model) and then add the triangles to the renderer. Later the renderer does batching with the trinagles and copies them again to a d3d Vertex Buffer ready to be passed to the d3d pipeline. I almost forget, I´m using directx.
I would be very grateful if anyone could help with this because I´m stucked at this point.
Thanks in advance.
HexDump.