i have changed the model with a cube
texture with differnet colour
private Buffer mVertBuff;
private Buffer mTexCoordBuff;
private Buffer mNormBuff;
private Buffer mIndBuff;
private int indicesNumber = 0;
private int verticesNumber = 0;
public cube()
{
setVerts();
setTexCoords();
setNorms();
setIndices();
}
private void setVerts()
{
double[] cube_VERTS = {
1.000000,-1.000000,-1.000000,
1.000000,-1.000000,1.000000,
-1.000000,-1.000000,1.000000,
-1.000000,-1.000000,-1.000000,
1.000000,1.000000,-0.999999,
0.999999,1.000000,1.000001,
-1.000000,1.000000,1.000000,
-1.000000,1.000000,-1.000000,
};
mVertBuff = fillBuffer(cube_VERTS);
verticesNumber = cube_VERTS.length / 3;
}
private void setTexCoords()
{
double[] cube_TEX_COORDS = {
0.624375,0.500624,
0.624375,0.749375,
0.375625,0.749375,
0.375624,0.003126,
0.624373,0.003126,
0.624374,0.251874,
0.375624,0.500625,
0.375625,0.251875,
0.873126,0.749375,
0.873126,0.998126,
0.624375,0.998126,
0.375625,0.998126,
0.126874,0.749375,
0.126874,0.998126,
};
mTexCoordBuff = fillBuffer(cube_TEX_COORDS);
}
private void setNorms()
{
double[] cube_NORMS = {
0.000000,-1.000000,0.000000,
0.000000,1.000000,0.000000,
1.000000,-0.000000,0.000000,
-0.000000,-0.000000,1.000000,
-1.000000,-0.000000,-0.000000,
0.000000,0.000000,-1.000000,
};
mNormBuff = fillBuffer(cube_NORMS);
}
private void setIndices()
{
short[] cube_INDICES = {
1,0,0,2,1,0,3,2,0,
7,3,1,6,4,1,5,5,1,
0,6,2,4,7,2,5,5,2,
1,8,3,5,9,3,6,10,3,
6,10,4,7,11,4,3,2,4,
0,12,5,3,2,5,7,11,5,
0,6,0,1,0,0,3,2,0,
4,7,1,7,3,1,5,5,1,
1,0,2,0,6,2,5,5,2,
2,1,3,1,8,3,6,10,3,
2,1,4,6,10,4,3,2,4,
4,13,5,0,12,5,7,11,5,
};
mIndBuff = fillBuffer(cube_INDICES);
indicesNumber = cube_INDICES.length;
}
public int getNumObjectIndex()
{
return indicesNumber;
}
@Override
public int getNumObjectVertex()
{
return verticesNumber;
}
i have attached cube.obj,textures ,rendered image of cube (in png as well)
any help would be appreciated...................
will you please tell me how i can change teapot to my own model (android)