本文整理汇总了Python中Matrix.rotate方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.rotate方法的具体用法?Python Matrix.rotate怎么用?Python Matrix.rotate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix
的用法示例。
在下文中一共展示了Matrix.rotate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setTurretRotation
# 需要导入模块: import Matrix [as 别名]
# 或者: from Matrix import rotate [as 别名]
def setTurretRotation (self, t_):
t = t_
if abs (t) > self.turretrotspeed:
t = self.turretrotspeed * t / abs (t)
self.turretTheta += t
m = Matrix.translate (-self.pos.x (), -self.pos.y (), 0) * Matrix.rotate (0, -t, 0) * Matrix.translate (self.pos.x (), self.pos.y (), 0)
self.turret.transform (m)
示例2: changeAngle
# 需要导入模块: import Matrix [as 别名]
# 或者: from Matrix import rotate [as 别名]
def changeAngle (self, dt):
self.theta += dt
m = Matrix.translate (-self.pos.x (), -self.pos.y (), 0) * Matrix.rotate (0, -dt, 0) * Matrix.translate (self.pos.x (), self.pos.y (), 0)
self.base.transform (m)
示例3: rotateTurret
# 需要导入模块: import Matrix [as 别名]
# 或者: from Matrix import rotate [as 别名]
def rotateTurret (self):
t = rotationDirection (self.turretTheta, self.theta, self.turretrotspeed)
if t != 0:
self.turretTheta += t
m = Matrix.translate (-self.pos.x (), -self.pos.y (), 0) * Matrix.rotate (0, -t, 0) * Matrix.translate (self.pos.x (), self.pos.y (), 0)
self.turret.transform (m)
示例4: rotateWorld
# 需要导入模块: import Matrix [as 别名]
# 或者: from Matrix import rotate [as 别名]
def rotateWorld (self, H, A, R):
m = Matrix.rotate (H, A, R)
for a in self.objects:
a.transform (m)
示例5: rotate
# 需要导入模块: import Matrix [as 别名]
# 或者: from Matrix import rotate [as 别名]
def rotate (self, H, A, R):
m = Matrix.rotate (H, A, R)
self.setLookingDir (Vector.Vector ((Matrix.Matrix ([self.lookDir.toList () + [0]]) * m).vectorRow (1).toList () [:3]))
self.setUpDir (Vector.Vector ((Matrix.Matrix ([self.up.toList () + [0]]) * m).vectorRow (1).toList () [:3]))