I am trying to rotate targets around their own x axis, my understanding is that I need to use Martix4 to do this but I am not sure how to do it. I have all of the required targets and am able to step through them with a foreach loop.
Thanks
I am trying to rotate targets around their own x axis, my understanding is that I need to use Martix4 to do this but I am not sure how to do it. I have all of the required targets and am able to step through them with a foreach loop.
Thanks
Hi pjneil,
I have this function that should be able to do what you search for ![]()
private static void RotateTarget(RsTarget target,Axis axis, double rotationAngle)
{
Vector3 vAxis = target.Transform.GlobalMatrix.GetAxisVector(axis);
//Get the Matrix of target
Matrix4 tMatrix = target.Transform.GlobalMatrix;
//Rotate the matrix
tMatrix.Rotate(target.Transform.GlobalMatrix.Translation, vAxis, rotationAngle);
//Set the new matrix to target matrix
target.Transform.GlobalMatrix = tMatrix;
}
Hope it is usefull,
Regards Lars