Forum Migration Notice
We're transitioning to a more modern community platform by the end of this year. Learn about the upcoming changes and what to expect.
Rotate a target around its own x
pjneil
✭
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
0
Comments
-
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 targetMatrix4 tMatrix = target.Transform.GlobalMatrix;//Rotate the matrixtMatrix.Rotate(target.Transform.GlobalMatrix.Translation, vAxis, rotationAngle);//Set the new matrix to target matrixtarget.Transform.GlobalMatrix = tMatrix;}Hope it is usefull,Regards LarsLars Glud
Danrob A/S0
Categories
- All Categories
- 5.6K RobotStudio
- 401 UpFeed
- 21 Tutorials
- 16 RobotApps
- 306 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.9K Robot Controller
- 366 IRC5
- 86 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 856 RAPID Programming
- 40 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 111 Collaborative Robots
- 5 Job listings