def prepeare_to_screen(context): scale = min(context.width(), context.height()) / 1.5 scale_matrix = MatrixShop.dilation(scale, scale, scale) invert_matrix = MatrixShop.reflectionY() center_matrix = MatrixShop.translation(context.width() / 2, context.height() / 2, 0) return scale_matrix @ invert_matrix @ center_matrix
def translationZRight(fig): fig.model_matrix = fig.model_matrix @ MatrixShop.translation(0, 0, 0.1)
def reflectionZ(fig): fig.model_matrix = fig.model_matrix @ MatrixShop.reflectionZ()
def scaleZLess(fig): fig.model_matrix = fig.model_matrix @ MatrixShop.dilation(1, 1, 0.99)
def scaleZMore(fig): fig.model_matrix = fig.model_matrix @ MatrixShop.dilation(1, 1, 1.1)
def scaleXLess(fig): fig.model_matrix = fig.model_matrix @ MatrixShop.dilation(0.99, 1, 1)
def scale_x_more(fig): fig.model_matrix = fig.model_matrix @ MatrixShop.dilation(1.01, 1, 1)
def scale(self, matrix, x, y, z): self.model_matrix = matrix @ MatrixShop.dilation(x, y, z)
def cavalieProj(fig): fig.project_matrix = MatrixShop.cavalerProject()
def kabinetProj(fig): fig.project_matrix = MatrixShop.kabinetProject()
def perspectiveProj(fig): fig.project_matrix = MatrixShop.perspectiveProject(3)
def orthoPoject(fig): fig.project_matrix = MatrixShop.orthoPoject()
def rotationZLeft(fig): fig.model_matrix = fig.model_matrix @ MatrixShop.rotationZ(-radians(6))
def rotationZRight(fig): fig.model_matrix = fig.model_matrix @ MatrixShop.rotationZ(radians(3))
def translationZLeft(fig): fig.model_matrix = fig.model_matrix @ MatrixShop.translation( 0, 0, -0.1)
def translationXLeft(fig): fig.model_matrix = fig.model_matrix @ MatrixShop.translation( -0.1, 0, 0)