//-------------------------------------------------------------- ofMatrix4x4 Path3D::zForward(ofMatrix4x4 originalMat){ ofVec3f pos = originalMat.getTranslation(); ofVec3f y = originalMat.getRowAsVec3f(1); // local y-axis originalMat.setTranslation(0,0,0); originalMat.rotate(90, y.x, y.y, y.z); // rotate about the y originalMat.setTranslation(pos); return originalMat; }
//-------------------------------------------------------------- ofMatrix4x4 Path3D::zOut(ofMatrix4x4 originalMat){ ofVec3f pos = originalMat.getTranslation(); ofVec3f x = originalMat.getRowAsVec3f(0); // local x-axis originalMat.setTranslation(0,0,0); originalMat.rotate(-90, x.x, x.y, x.z); // rotate about the y originalMat.setTranslation(pos); return originalMat; }
//-------------------------------------------------------------- ofMatrix4x4 Path3D::flip(ofMatrix4x4 originalMat){ ofVec3f pos = originalMat.getTranslation(); ofVec3f z = originalMat.getRowAsVec3f(2); // local y-axis originalMat.setTranslation(0,0,0); originalMat.rotate(180, z.x, z.y, z.z); // rotate about the y originalMat.setTranslation(pos); return originalMat; }