~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to doc/python_api/examples/mathutils.py

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import mathutils
 
2
from math import radians
 
3
 
 
4
vec = mathutils.Vector((1.0, 2.0, 3.0))
 
5
 
 
6
mat_rot = mathutils.Matrix.Rotation(radians(90.0), 4, 'X')
 
7
mat_trans = mathutils.Matrix.Translation(vec)
 
8
 
 
9
mat = mat_trans * mat_rot
 
10
mat.invert()
 
11
 
 
12
mat3 = mat.to_3x3()
 
13
quat1 = mat.to_quaternion()
 
14
quat2 = mat3.to_quaternion()
 
15
 
 
16
quat_diff = quat1.rotation_difference(quat2)
 
17
 
 
18
print(quat_diff.angle)