I’m working with a model viewer template that displays a 3D cube in the center of the screen. What I’m trying to achieve is put another, but smaller 3D cube on the screen and in a different XY position from the main. So visually, if the original cube is in the center, I would like to place the second smaller cube to the right.
So how do I add a another cube to the screen, make it smaller, and change its position?
Note: I’m working from a basic template.
Assign different model transformation matrix to second object.
If you are rendering with fixed pipeline, then it’s as simple as calling glMulMatrix.
If you are rendering with shaders, then pass appropriate matrix as uniform to your vertex shader.
Here’s some basic reading about this subject: