You don't need to use multiple trackable instances, and can utilize the same pose matrix. The pose matrix is describing the position and orientation of the parent trackable.
The ImageTargets sample uses the following set of transforms to position the model:
SampleUtils::translatePoseMatrix(0.0f, 0.0f, kObjectScale, &modelViewMatrix.data[0]);
SampleUtils::scalePoseMatrix(kObjectScale, kObjectScale, kObjectScale, &modelViewMatrix.data[0]);
SampleUtils::multiplyMatrix(&projectionMatrix.data[0], &modelViewMatrix.data[0] , &modelViewProjection.data[0]);
Note that the transforms are applied from bottom to top. In this case, the model is scaled by kObjectScale and then translated up the Z axis by kObjectScale.
If you have four models, and wish to place them all at different positions on the same target, you can loop through these operations and the render steps for each model to position each at a different point on the target. You'll just need to substitute the model's arrays in these steps ..
glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0,
(const GLvoid*) &teapotVertices[0]);
glVertexAttribPointer(normalHandle, 3, GL_FLOAT, GL_FALSE, 0,
(const GLvoid*) &teapotNormals[0]);
glVertexAttribPointer(textureCoordHandle, 2, GL_FLOAT, GL_FALSE, 0,
(const GLvoid*) &teapotTexCoords[0]);
glEnableVertexAttribArray(vertexHandle);
glEnableVertexAttribArray(normalHandle);
glEnableVertexAttribArray(textureCoordHandle);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, thisTexture->mTextureID);
glUniformMatrix4fv(mvpMatrixHandle, 1, GL_FALSE,
(GLfloat*)&modelViewProjection.data[0] );
glDrawElements(GL_TRIANGLES, NUM_TEAPOT_OBJECT_INDEX, GL_UNSIGNED_SHORT,
(const GLvoid*) &teapotIndices[0]);
Hello Yashu94.
This thread covers using OpenGL to render multiple models on an Image Target. If you're looking for a more detailed introduction on using OpenGL, I'd recommend looking for an online tutorial or book that goes over the basics.
Thanks,
-Vuforia Support