Logo
Explore Help
Register Sign In
griefith/test
1
0
Fork 0
You've already forked test
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
ffcec4024bf3e408e2a8f581846954f9b4ed3f86
test/source/blender/python/doc/examples/mathutils.py

18 lines
342 B
Python
Raw Normal View History

PyAPI - added new mathutils.Color() type, use with rna so we can do for eg: material.diffuse_color.r = 1.0 # also has hsv access material.diffuse_color.s = 0.6 - made Mathutils and Geometry module names lowercase.
2010-04-11 14:22:27 +00:00
import mathutils
mathutils.RotationMatrix Angles are in radians. Doc and example should reflect reality
2010-06-23 02:42:39 +00:00
from math import radians
PyAPI - added new mathutils.Color() type, use with rna so we can do for eg: material.diffuse_color.r = 1.0 # also has hsv access material.diffuse_color.s = 0.6 - made Mathutils and Geometry module names lowercase.
2010-04-11 14:22:27 +00:00
vec = mathutils.Vector(1.0, 2.0, 3.0)
mathutils.RotationMatrix Angles are in radians. Doc and example should reflect reality
2010-06-23 02:42:39 +00:00
mat_rot = mathutils.RotationMatrix(radians(90), 4, 'X')
PyAPI - added new mathutils.Color() type, use with rna so we can do for eg: material.diffuse_color.r = 1.0 # also has hsv access material.diffuse_color.s = 0.6 - made Mathutils and Geometry module names lowercase.
2010-04-11 14:22:27 +00:00
mat_trans = mathutils.TranslationMatrix(vec)
mat = mat_trans * mat_rot
mat.invert()
mat3 = mat.rotation_part()
quat1 = mat.to_quat()
quat2 = mat3.to_quat()
angle = quat1.difference(quat2)
print(angle)
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 226ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API