A question was asked on Learning Blender 2.5 Facebook page
about the process of getting the world coordinates of a control vertex on a curve. Following was my answer
How do we visualize the local and world coordinates for object location, vertex location?
Note: For all the examples on this page
- I have used a BezierCurve object with three control vertices.
- The curve object has been translated along the +x direction by 1 unit and also rotated it around in space.
- The curve object is not parented to any other object.
|Local coordinates of the control vertex
The control vertex's local coordinates are those values that are stored with respect to the curve objects transformation (in other words, in Object Space)
The Local Coordinates will be different than the Global Coordinates, If the object to which the vertices belong has been transformed (scaled, rotated, translated)
|Global (World) coordinates of the control vertex
The control vertex's global/world coordinates are those values that are obtained after taking into consideration the transformation of the curve object. These values are with respect to the World Coordinate System in Blender.
The Local Coordinates and World Coordinates will be the same if the object is not transformed.
Since the time this tutorial was written, the order of operations for multiplying matrices and vectors/points has changed in Blender. Please follow the code at the link below for the updates.Updates to the tutorial
How can we do it using Python?
Copy/Paste the code
wmtx = bpy.context.active_object.
localCoord = bpy.context.active_object.
worldCoord = localCoord * wmtx
To learn more about vector and matrix operation that you can perform, read the manual
satishgoda at gmail dot com