本文整理汇总了Python中mathutils.Vector.orthogonal方法的典型用法代码示例。如果您正苦于以下问题:Python Vector.orthogonal方法的具体用法?Python Vector.orthogonal怎么用?Python Vector.orthogonal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mathutils.Vector
的用法示例。
在下文中一共展示了Vector.orthogonal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_orthogonal
# 需要导入模块: from mathutils import Vector [as 别名]
# 或者: from mathutils.Vector import orthogonal [as 别名]
def test_orthogonal(self):
angle_90d = math.pi / 2.0
for v in vector_data:
v = Vector(v)
if v.length_squared != 0.0:
self.assertAlmostEqual(v.angle(v.orthogonal()), angle_90d)
示例2: get_bone_head_tail
# 需要导入模块: from mathutils import Vector [as 别名]
# 或者: from mathutils.Vector import orthogonal [as 别名]
def get_bone_head_tail(self, pbone, local=True):
parent_x_axis = Vector((1, 0))
parent_y_axis = Vector((0, 1))
space_origin = Vector((0, 0))
if pbone.parent != None and local:
parent_x_axis = (pbone.parent.tail.xz - pbone.parent.head.xz).normalized()
parent_y_axis = parent_x_axis.orthogonal().normalized()
space_origin = pbone.parent.tail.xz
head = pbone.head.xz - space_origin
tail = pbone.tail.xz - space_origin
local_tail_x = round(tail.dot(parent_x_axis), 3) * self.armature_export_scale
local_tail_y = round(tail.dot(parent_y_axis), 3) * self.armature_export_scale
local_head_x = round(head.dot(parent_x_axis), 3) * self.armature_export_scale
local_head_y = round(head.dot(parent_y_axis), 3) * self.armature_export_scale
local_tail_vec = Vector((local_tail_x, 0, local_tail_y))
local_head_vec = Vector((local_head_x, 0, local_head_y))
return {"head": local_head_vec.xz, "tail": local_tail_vec.xz}