当前位置: 首页>>代码示例>>Python>>正文


Python Geometry.transform_point方法代码示例

本文整理汇总了Python中Geometry.transform_point方法的典型用法代码示例。如果您正苦于以下问题:Python Geometry.transform_point方法的具体用法?Python Geometry.transform_point怎么用?Python Geometry.transform_point使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Geometry的用法示例。


在下文中一共展示了Geometry.transform_point方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: addBox

# 需要导入模块: import Geometry [as 别名]
# 或者: from Geometry import transform_point [as 别名]
 def addBox(self, box, colour=None):
     if not Visualiser.VISUALISER_ON:
         return
     if isinstance(box, geo.Box):
         if colour == None:
             colour = visual.color.red
         org = geo.transform_point(box.origin, box.transform)
         ext = geo.transform_point(box.extent, box.transform)
         print "Visualiser: box origin=%s, extent=%s" % (str(org), str(ext))
         size = np.abs(ext - org)
         
         pos = org + 0.5*size
         print "Visualiser: box position=%s, size=%s" % (str(pos), str(size))
         angle, direction, point = tf.rotation_from_matrix(box.transform)
         print "colour,", colour
         if colour == [0,0,0]:
             visual.box(pos=pos, size=size, opacity=0.3, material=visual.materials.plastic)
         else:
             visual.box(pos=pos, size=size, color=geo.norm(colour), opacity=0.5)
开发者ID:GuzSku,项目名称:mcclanahoochie,代码行数:21,代码来源:Visualise.py

示例2: addFinitePlane

# 需要导入模块: import Geometry [as 别名]
# 或者: from Geometry import transform_point [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)
开发者ID:GuzSku,项目名称:mcclanahoochie,代码行数:15,代码来源:Visualise.py

示例3: addCylinder

# 需要导入模块: import Geometry [as 别名]
# 或者: from Geometry import transform_point [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)
开发者ID:GuzSku,项目名称:mcclanahoochie,代码行数:17,代码来源:Visualise.py


注:本文中的Geometry.transform_point方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。