If you work in a 3D modeling program, like 3DS Max, before you do a rotation you need to select a coordination system, it can be the view, or the world, or a group, or the local object coordinate system, it all comes down to one thing: at what stage do you add the rotation, in the end, the object current position and orientation is the accumulation of all the rotations and movements in a set of matrices, multiplied in a certain order, the order makes all the difference. If I add a new matrix with a rotation to the beginning of the chain, the rotation is relative to the world coordinate system, but it I add it to the end, the rotation is relative to the object local coordinate system.
What if I want to rotate the object relative to the camera coordinate system, which is called the view coordinated system?
Basically a camera rotation is just another manipulation of the vertex array, so basically I can think of it as a transformation of the world, which can be seen as just a group that contains all other objects, and when render an object, I usually do a loop that is taking all the matrices of all parents and multiply them like this:
var tmp:Object3D = obj;
tmp = tmp.Parent;
then I add the camera matrix with prepend, but what do I have to do, for the rotation to be relative to the camera orientation, if all I have is world transform matrix, camera transform matrix, and object transform matrix?
Should I put it before the camera? then it is added after the world, matrix and since I don't add any transformation to the world, it is basically goes to the beginning, which is the world coordinate system. Should I put it after the camera and before the object rotation matrix?
I don't want to rotate the camera, I want to rotate the object relative to the camera, meaning make it rotate as if the camera is rotating, but since in some cases I might have more then one object on the scene, and I want only one object to rotate, not both, I don't want the camera to move.