Log in or register to post comments

Image is not clear while render

October 11, 2013 - 3:29am #1

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_TRIANGLES0STRAPPNumVerts);

 

where i did mistake?

 

AttachmentSize
Image icon strapp.png173.41 KB

Image is not clear while render

October 14, 2013 - 9:50pm #3

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

Image is not clear while render

October 11, 2013 - 6:23am #2

Since you only have vertices, but no texture coordinates, your mesh will be rendered black, unless you change the code in the fragment Shader.

Perhaps you may want to consider using Unity rather than programming natively ? as this would make your life much easier when it comes to rendering 3D models...

 

Log in or register to post comments