Sorry for my last input, I’ll try to be more clear this time.
I’m developing an Android AR (Augmented reality) app using a code example from Qualcomm.
I’m completely new to both AR and OpenGL.
I have textures in .obj format and to import these textures to my project I’m using a perl scrips.
The script outputs a .h that contains two arrays. See code below:
float sideVerts [] = {
// f 9//9 6//6 10//10
-0.231038325580029, 0.105720149112096, -0.0585550619509055,
-0.231184883305453, 0.0997986647895742, -0.0625237611900266,
-0.230957413502451, 0.105516044102722, -0.0566150803927526,
…
}
float sideNormals [] = {
// f 9//9 6//6 10//10
-0.999345908214985, 0.00044890045386168, 0.0361601192247726,
-0.998600666745904, 0.0196637717127176, 0.0490922036240545,
-0.999098931038037, -0.00144239592868675, 0.0424175139846333,
…
}
When I draw my textures I use the following code:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
SampleUtils::translatePoseMatrix(-10.0f, -190.0f, kObjectScale0-700, &modelViewMatrix.data[0]);
SampleUtils::rotatePoseMatrix(-90.0f, 1.0f, 0.0f, 0.0f, &modelViewMatrix.data[0]); // rotate X
SampleUtils::rotatePoseMatrix(0.0f, -0.0f, 1.0f, 0.0f, &modelViewMatrix.data[0]); // rotate Y
SampleUtils::rotatePoseMatrix(40.0f, -0.0f, 0.0f, 1.0f, &modelViewMatrix.data[0]); // rotate Z
SampleUtils::scalePoseMatrix(kObjectScale0, kObjectScale0, kObjectScale0, &modelViewMatrix.data[0]);
SampleUtils::multiplyMatrix(&projectionMatrix.data[0], &modelViewMatrix.data[0], &modelViewProjection.data[0]);
glUseProgram(shaderProgramID);
glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid*) &sideVerts[0]);
glVertexAttribPointer(normalHandle, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid*) &sideNormals[0]);
glEnableVertexAttribArray(vertexHandle);
glEnableVertexAttribArray(normalHandle);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, thisTexture->mTextureID);
glUniformMatrix4fv(mvpMatrixHandle, 1, GL_FALSE, (GLfloat*)&modelViewProjection.data[0] );
glDrawArrays(GL_TRIANGLES, 0, sideNumVerts);
glDisable(GL_DEPTH_TEST);
(This is not all the code in my project, I had to do some copy and paste.)
My textures are shown in a yellowish color and I wonder if it’s possible to change the color and the transparency of my textures.