In the scene there are two scenenodes. One contains a procedural mesh and the other can be anything. The procedural I'll call CProcedural and the other CTarget.
CProcedural contains a mesh which is a plane, vector3df(0,1,0) at position vecor3df(0,radius,0). Then all verts are normalized() * radius; This makes it a part of a quadsphere.
Q 1: CTarget is a node that moves around. Currently it has a quick but messy setUp( getPosition().normalized() ) thingy to simulate it is moving around a sphere. It has a gimbal lock and should get rid of that.
Q 1.1: CTarget's position needs to be converted to a rotation. How could this be done?
Q 2: CProcedural needs to be able to rotate its plane locally so it will be on the infinite line (0,0,0) - CTarget::getPosition(). The node shouldn't rotate at all.
Currently CTarget is a develop camera controller but all objects within the scene needs to have the same behaviour. Don't think this will matter but maybe it does so I'd like to note. CProcedural will always 'center' at the camera.
r,
A2: Still thinking out loud
Code: Select all
// To just rotate it with a given rotation in degrees (Was I that scared for this? Probably the reason why matrix isn't spelled like BOO)
core::matrix4 rotationMatrix;
rotationMatrix.setRotationDegrees( core::vector3df( 0, 0, 90 ) );
core::vector3df vIn( -2.5f, 2.5f, -2.5f );
core::vector3df vOut;
rotationMatrix.rotateVect( vOut, vIn );