Original Post
Hi,
I'm trying to render a robot which has 7 joints. Each joint is an object called "Joint". I load the vertices correctly but I don't know why I can just see the first joint. I new in openGL so I don't understand very well if my calls are correct or not and the reason why...
Here you can check my code:
vertexArray is the array where I put my vertexs points previously.
GLuint vertexs[color="#000000"];
glGenBuffers[color="#000000"]([color="#000080"]1[color="#000000"],&vertexs[color="#000000"]);
glBindBuffer[color="#000000"](GL_ARRAY_BUFFER[color="#000000"],vertexs[color="#000000"]);
glBufferData[color="#000000"](GL_ARRAY_BUFFER[color="#000000"],sizeVertex[color="#000000"]*[color="#808000"]sizeof[color="#000000"](GLfloat[color="#000000"]),vertexArray[color="#000000"],GL_DYNAMIC_DRAW[color="#000000"]);
glEnableVertexAttribArray[color="#000000"]([color="#000080"]0[color="#000000"]);
glVertexAttribPointer[color="#000000"]([color="#000080"]0[color="#000000"], [color="#000080"]3[color="#000000"], GL_FLOAT[color="#000000"], GL_FALSE[color="#000000"], [color="#000080"]0[color="#000000"], [color="#000080"]0[color="#000000"]);
the render function:
[color="#808000"]void Joint[color="#000000"]::render[color="#000000"]()[color="#000000"]{ glDrawArrays[color="#000000"](GL_TRIANGLES[color="#000000"],[color="#000080"]0[color="#000000"],sizeVertex[color="#000000"]);}
Can you see a problem? Thanks
I'm trying to render a robot which has 7 joints. Each joint is an object called "Joint". I load the vertices correctly but I don't know why I can just see the first joint. I new in openGL so I don't understand very well if my calls are correct or not and the reason why...
Here you can check my code:
vertexArray is the array where I put my vertexs points previously.
GLuint vertexs[color="#000000"];
glGenBuffers[color="#000000"]([color="#000080"]1[color="#000000"],&vertexs[color="#000000"]);
glBindBuffer[color="#000000"](GL_ARRAY_BUFFER[color="#000000"],vertexs[color="#000000"]);
glBufferData[color="#000000"](GL_ARRAY_BUFFER[color="#000000"],sizeVertex[color="#000000"]*[color="#808000"]sizeof[color="#000000"](GLfloat[color="#000000"]),vertexArray[color="#000000"],GL_DYNAMIC_DRAW[color="#000000"]);
glEnableVertexAttribArray[color="#000000"]([color="#000080"]0[color="#000000"]);
glVertexAttribPointer[color="#000000"]([color="#000080"]0[color="#000000"], [color="#000080"]3[color="#000000"], GL_FLOAT[color="#000000"], GL_FALSE[color="#000000"], [color="#000080"]0[color="#000000"], [color="#000080"]0[color="#000000"]);
the render function:
[color="#808000"]void Joint[color="#000000"]::render[color="#000000"]()[color="#000000"]{ glDrawArrays[color="#000000"](GL_TRIANGLES[color="#000000"],[color="#000080"]0[color="#000000"],sizeVertex[color="#000000"]);}
Can you see a problem? Thanks