
Transform local coordinate to global coordinate

surgeon
✭
Hi!
When I got the vector3 of a vertex. I can find the body coordinate values, but I find this value is in local coordinate. I want to transform this local coordinate to global coordinate. I use the TransformVector to realize this function.
The definition of TransformVector as follow:
public Vector3 TransformVector(
Matrix4 from,
Matrix4 to
)
My code:
Vector3 vertextrans = codege.Edge.EndVertex.Position;
Matrix4 localmatrix = body.Transform.Matrix;
Matrix4 worldmatrix = station.Transform .GlobalMatrix;
Vector3 tmp =vertextrans.TransformVector(localmatrix,worldmatrix);
I want to transform the local vertor3 into world coordinate, but there is no effect.. What is wrong with the code?
Thanks!
Regards,
Aston
Aston
0
Categories
- All Categories
- 5.5K RobotStudio
- 398 UpFeed
- 19 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 323 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 812 RAPID Programming
- 5 AppStudio
- 3 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings