本文整理汇总了Python中Geometry.transform_direction方法的典型用法代码示例。如果您正苦于以下问题:Python Geometry.transform_direction方法的具体用法?Python Geometry.transform_direction怎么用?Python Geometry.transform_direction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Geometry
的用法示例。
在下文中一共展示了Geometry.transform_direction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addFinitePlane
# 需要导入模块: import Geometry [as 别名]
# 或者: from Geometry import transform_direction [as 别名]
def addFinitePlane(self, plane, colour=None, opacity=0.):
if not Visualiser.VISUALISER_ON:
return
if isinstance(plane, geo.FinitePlane):
if colour == None:
colour = visual.color.blue
# visual doesn't support planes, so we draw a very thin box
H = .001
pos = (plane.length/2, plane.width/2, H/2)
pos = geo.transform_point(pos, plane.transform)
size = (plane.length, plane.width, H)
axis = geo.transform_direction((0,0,1), plane.transform)
visual.box(pos=pos, size=size, color=colour, opacity=0)
示例2: addCylinder
# 需要导入模块: import Geometry [as 别名]
# 或者: from Geometry import transform_direction [as 别名]
def addCylinder(self, cylinder, colour=None):
if not Visualiser.VISUALISER_ON:
return
if colour == None:
colour = visual.color.blue
#angle, direction, point = tf.rotation_from_matrix(cylinder.transform)
#axis = direction * cylinder.length
position = geo.transform_point([0,0,0], cylinder.transform)
axis = geo.transform_direction([0,0,1], cylinder.transform)
print cylinder.transform, "Cylinder:transform"
print position, "Cylinder:position"
print axis, "Cylinder:axis"
print colour, "Cylinder:colour"
print cylinder.radius, "Cylinder:radius"
visual.cylinder(pos=position, axis=axis, color=colour, radius=cylinder.radius, opacity=0.5, length = cylinder.length)