I am making an application in which i used opengl code to add image as texture onto virtual button sample code , and i got help from internet and add image as texture but now problem is i want to show this image of specific place but i couldn't understand how to handle this, because i am new bee in opengl. here is codestatic const float planeVertices[] = { -0.5, -0.5, 0.0, 0.5, -0.5, 0.0, 0.5, 0.5, 0.0, -0.5, 0.5, 0.0, }; static const float planeTexcoords[] = { 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0 }; static const float planeNormals[] = { 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0 }; static const unsigned short planeIndices[] = { 0, 1, 2, 0, 2, 3 }; QCAR::Vec2F targetSize = ((QCAR::ImageTarget *) trackable)->getSize(); QCAR::Matrix44F modelViewProjection; ShaderUtils::translatePoseMatrix(0.0f, 0.0f, kObjectScale, &modelViewMatrix.data[0]); ShaderUtils::scalePoseMatrix(targetSize.data[0]/8, targetSize.data[1]/8, 1.0f, &modelViewMatrix.data[0]); ShaderUtils::multiplyMatrix(&qUtils.projectionMatrix.data[0], &modelViewMatrix.data[0] , &modelViewProjection.data[0]); // glTranslatef(100.0f,0.5f, -kObjectScale); glUseProgram(shaderProgramID); glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid*) &planeVertices[0]); glVertexAttribPointer(normalHandle, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid*) &planeNormals[0]); glVertexAttribPointer(textureCoordHandle, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid*) &planeTexcoords[0]); glEnableVertexAttribArray(vertexHandle); glEnableVertexAttribArray(normalHandle); glEnableVertexAttribArray(textureCoordHandle); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, [thisTexture textureID]); glUniformMatrix4fv(mvpMatrixHandle, 1, GL_FALSE, (GLfloat*)&modelViewProjection.data[0] ); glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, (const GLvoid*) &planeIndices[0]);Thanks in Advance. Have a great day.
"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team
Adjust image which added as texture on virtual button sample cod
By aleem_razzaq
on Thu, 09/27/2012 - 11:59
Adjust image which added as texture on virtual button sample cod
Hi Aleem
Not quite sure what you are trying to do here, but you might find this thread useful:
https://ar.qualcomm.at/content/drawing-rectangle-besides-marker-and-getting-its-coordinates-fill-image
Adjust image which added as texture on virtual button sample cod
I almost did same thing of your answer(following showed) which you shared link with me but i want to adjust image position (x,y). I want to change image position on bottom right but i couldn't understand how to do this. Please help me to this.
Adjust image which added as texture on virtual button sample cod
Hi Aleem
I want to change image position on bottom right