diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-16 18:35:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-16 18:35:15 +0400 |
commit | 564902582c2da768e189fb9369839f457dbf1bbc (patch) | |
tree | e7ebc2c002cb52295d45e85c6e8b670715ec6c78 /release | |
parent | acb7f3639154bf474717c2aeabbfa0173eccd69d (diff) |
rename world_to_camera -> world_to_camera_view
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/bpy_extras/object_utils.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py index 7412d34940f..7d8caf449ca 100644 --- a/release/scripts/modules/bpy_extras/object_utils.py +++ b/release/scripts/modules/bpy_extras/object_utils.py @@ -25,7 +25,7 @@ __all__ = ( "object_add_grid_scale", "object_add_grid_scale_apply_operator", "object_image_guess", - "world_to_camera", + "world_to_camera_view", ) @@ -268,12 +268,14 @@ def object_image_guess(obj, bm=None): return None -def world_to_camera(scene, obj, coord): +def world_to_camera_view(scene, obj, coord): """ - Returns the 2d camera space coords for a 3d point. + Returns the camera space coords for a 3d point. + (also known as: normalized device coordinates - NDC). Where (0, 0) is the bottom left and (1, 1) is the top right of the camera frame. values outside 0-1 are also supported. + A negative 'z' value means the point is behind the camera. Takes shift-x/y, lens angle and sensor size into account as well as perspective/ortho projections. @@ -284,7 +286,7 @@ def world_to_camera(scene, obj, coord): :type obj: :class:`bpy.types.Object` :arg coord: World space location. :type coord: :class:`mathutils.Vector` - :return: normalized 2d vector. + :return: a vector where X and Y map to the view plane and Z is the depth on the view axis. :rtype: :class:`mathutils.Vector` """ from mathutils import Vector |