Suppose I have a brain model drawn in object space (Xo, Yo, Zo). I have another sphere always showing its position in world space (Xw, Yw, Zw). The MRI data texture of the model is shown on the sphere.
When the sphere is rotated or translated, the texture mapping on the sphere also changes according to its rotational or translational transformation. When the brain model is translated or rotated, the change in texture should also be reflected on the sphere.
Overall thing is that on the surface of the sphere the texture should be mapped in model (object) space, but on the screen, the sphere should always be positioned on world space.
I have done the following:
Drawn the sphere at the origin ( 0, 0, 0).
Suppose rotational and translational transformation of the sphere is stored in transformation matrix MATRIX_(sphere). Multiplying the vertices of the sphere with MATRIX_1(sphere),gives the world space transformation of the vertices.
Now if I rotate the brain model, it gets transformation matrix MATRIX_(model). Multiplying the vertices of sphere with MATRIX_(model), gives the corresponding object space transformation of the sphere. Now the texture on sphere is mapped into object space and sphere is also positioned at object space. But the sphere should be constrained to position at world space, just mapping texture on the sphere should be drawn in object space. How this can be drawn synchronously.
Any suggestion will be highly appreciated.