Esempio n. 1
0
 def makeInverseMatrix(self, grid):
     # first apply a negative translation by the rotCenter
     # then apply the rotation
     # then reverse the rotCenter
     centerVec = bdggeom.Vec2f(*grid.indexToWorld(*self.rotCenterIndices))
     rotRad = 2 * math.pi / self.rotCount
     negTrans = bdggeom.makeTranslationMatrix(-centerVec.x, -centerVec.y)
     posTrans = bdggeom.makeTranslationMatrix(centerVec.x, centerVec.y)
     rotTrans = bdggeom.makeRotationMatrix(-rotRad)
     return posTrans.mulMat(rotTrans.mulMat(negTrans))
Esempio n. 2
0
 def appendTranslation(self, dx, dy):
     self.transformMatrix = bdggeom.makeTranslationMatrix(dx, dy).mulMat(
         self.transformMatrix)
Esempio n. 3
0
 def appendTranslation(self, dx, dy):
     trans = bdggeom.makeTranslationMatrix(dx, dy)
     self.gridToWorldTransform = trans.mulMat(self.gridToWorldTransform)
     invTrans = bdggeom.makeTranslationMatrix(-dx, -dy)
     self.worldToGridTransform = self.worldToGridTransform.mulMat(invTrans)
Esempio n. 4
0
 def makeInverseMatrix(self, grid):
     offsetVec = bdggeom.Vec2f(*grid.indexToWorld(*self.offset))
     return bdggeom.makeTranslationMatrix(-offsetVec.x, -offsetVec.y)