Hello again,
I’m working on another project using your SDK and examples, and I could you use some help with an issue I’m running into.
I basically started with the Skinning trainingcourse project (thanks, it’s awesome to get my own animated chars from 3ds max to my iPhone so easily) and am modifying it to fit my needs. It’s a sports game and has about 12 different characters with the same animations, but with slightly different models. I don’t have all the models yet and would like to use the biped geometry as a place holder so I can continue working on the game while the models are created.
Obviously I can simply duplicate the first character I use for testing purposes and modify the texture slightly to have another test character
(opponent) but I noticed there’s an “Export Bone Geometry” option in the
exporter.
My questions is: how can I render this bone geometry on my iPhone?
I’m able to export it correctly and it shows up in Shaman, but I’m using the drawMesh function from the Skinning training course project and that hangs on the bolded line for the texcoords below:
/
void OGLES2Skinning::DrawMesh(int i32NodeIndex)
{
SPODNode& Node = m_Scene.pNode[i32NodeIndex];
SPODMesh& Mesh = m_Scene.pMesh[Node.nIdx];
// bind the VBO for the mesh
glBindBuffer(GL_ARRAY_BUFFER, m_puiVbo[Node.nIdx]);
// bind the index buffer, won’t hurt if the handle is 0
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_puiIndexVbo[Node.nIdx]);
// Enable the vertex attribute arrays
for (int i = 0; i < eNumAttribs; ++i) glEnableVertexAttribArray(i);
// Set the vertex attribute offsets
glVertexAttribPointer(VERTEX_ARRAY, 3, GL_FLOAT, GL_FALSE, Mesh.sVertex.nStride, Mesh.sVertex.pData);
glVertexAttribPointer(NORMAL_ARRAY, 3, GL_FLOAT, GL_FALSE, Mesh.sNormals.nStride, Mesh.sNormals.pData);
glVertexAttribPointer(TEXCOORD_ARRAY, 2, GL_FLOAT, GL_FALSE, Mesh.psUVW[0].nStride, Mesh.psUVW[0].pData);
glVertexAttribPointer(BONEINDEX_ARRAY, Mesh.sBoneIdx.n, GL_UNSIGNED_BYTE, GL_FALSE, Mesh.sBoneIdx.nStride, Mesh.sBoneIdx.pData);
glVertexAttribPointer(BONEWEIGHT_ARRAY, Mesh.sBoneWeight.n, GL_UNSIGNED_BYTE, GL_TRUE, Mesh.sBoneWeight.nStride, Mesh.sBoneWeight.pData);
/
I tried solving it by adding a UVW modifier to the biped bones in Max but that didn’t work out either. I realize this particular drawMesh function draws only objects that are skinned (have bone data) but it’s not even getting at the point where that matters.
What’s the right way to render the bone geometry?
[code truncated]****************************************/
I tried solving it by adding a UVW modifier to the biped bones in Max but that didn’t work out either. I realize this particular drawMesh function draws only objects that are skinned (have bone data) but it’s not even getting at the point where that matters.
What’s the right way to render the bone geometry?
I ended up exporting the Biped skeleton with a mesh modifier to Obj, importing it with a prefix for the bone names, and using a push modifier to slightly blow it up, and skinned it around the original Biped skeleton. Not the best for performance (all bones are different meshes now) but fine for testing purposes.