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 forprivate 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.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 799 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings