-1

どうすればこれを行うことができますか?これまでのところ、1 つのモデルしか回転できませんでした。

4

1 に答える 1

0

Quote: Oh wait, I think I get it now. I bind the vbo, apply matrix, unbind, bind second vbo, then apply new model matrix?

The only time your matrix has any effect is when you call glDrawArrays/glDrawElements or one of their similar derivatives.

The way to draw multiple objects, each with their own matrix would be similar to the following pseudocode:

foreach (Object obj in List<Object>) {
    setupVertexAttributes(obj.attributes);   //setup the attributes (VBOs)
    uploadMatrix(obj.matrix);                //set the matrix
    glDrawElements(obj.indices);             //draw the object

}
于 2012-10-08T22:03:11.063 に答える