iDevGames Forums
Unable to implement OES_matrix_palette - Printable Version

+- iDevGames Forums (
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: Unable to implement OES_matrix_palette (/thread-8102.html)

Unable to implement OES_matrix_palette - mariocaprino - Sep 14, 2010 09:43 AM

I've lately been trying to implement the OES_matrix_palette extension in my project. Sadly I am unable to get my test of vertex skinning working Sad

I've started a new OpenGL ES template in XCode - forcing it to use OpenGL ES 1 by default. I've used the example code at the end of the OES_matrix_palette extension description for implementation details.

I try to add the following code to the drawFrame() method:
//For my test-case we only have one "bone" - and try to use GL_MATRIX_PALETTE_OES to transform the vertices, rather than GL_MODELVIEW.
static const float squareWeights[] = {1, 1, 1, 1};
static const GLubyte squareMatrixIndices[] = {0, 0, 0, 0};

//Set up the additional pointers for matrix skinning of the template's cube
glWeightPointerOES (1, GL_FLOAT, 0, squareWeights);
glMatrixIndexPointerOES (1, GL_UNSIGNED_BYTE, 0, squareMatrixIndices);

//Transfer the GL_MODELVIEW matrix to PaletteMatrix 0

//Flush the GL_MODELVIEW matrix to make sure it does not have any influence over the vertex transform

My goal with the test-case is to have the cube move in the same pattern as the template - but using GL_MATRIX_PALETTE_OES to achieve the translation.

The cube is drawn in my test but without any translation applied! I'm obviously misunderstanding something about the extension - but what am I missing?

Thank you for your help.
Doh... found the answer after reading the "fine print" in the extension description. Don't they know we only look at the examples Wink

Naturally you have to enable the feature by calling glEnable (GL_MATRIX_PALETTE_OES) for vertex skinning to take effect!

Thank you for reading.