I used Blender for create 3D modal. I created .obj file and converted to .h file but .h file having only glVertexPointer, glDrawArrays. I used .png image file. But when image is tracking the 3D modal doesn't displays proper. It's some what black color. I replaced code in EAGLView.mm is:
- (void) setup3dObjects
{
for (int i=0; i < [textures count]; i++)
{
Object3D *obj3D = [[Object3D alloc] init];
obj3D.numVertices = STRAPPNumVerts;
obj3D.vertices = STRAPPVerts;
obj3D.normals = nil;
obj3D.texCoords = nil;
obj3D.numIndices = 0;
obj3D.indices = nil;
obj3D.texture = [textures objectAtIndex:i];
[objects3D addObject:obj3D];
[obj3D release];
}
}
In renderFrame:
glVertexPointer(3, GL_FLOAT, 0, STRAPPVerts);
glDrawArrays(GL_TRIANGLES, 0, STRAPPNumVerts);
and
glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid*) STRAPPVerts);
glDrawArrays(GL_TRIANGLES, 0, STRAPPNumVerts);
where i did mistake?
Image is not clear while render
Since you only have vertices, but no texture coordinates, your mesh will be rendered black, unless you change the code in the fragment Shader.
Image is not clear while render
Im using blender. Is any other way to create textcoords using blender. Unity is too cost, i can't buy this. Is anyone help me about this