I'm trying to rotate some vertices/PVectors using matrices. As far as I understand, all I need to do is create a matrix, store the rotation, then multiply it by the PVectors.
If I create a PMatrix3D and use rotateX(HALF_PI), then multiply a PVector, I would expect to get the PVector rotated by 90 degrees. I did a simple test drawing a quad and a clone of that quad rotated using a PMatrix3D. The clone quad gets distorted and I don't understand why. Also, I've tried using ArbitraryAxisRotation matrices, one with rotations applied in x,y,z order and one with rotations applied in z,y,x order. I've placed the 3 matrix rotation variants within //* //*/ blocks to make it easier to comment/uncomment a block by removing/adding a /.
My question is: how do I rotate a vector using a matrix in Processing ?
In my sketch, the red quad is the original quad and the green one is the one that should be rotated by 90 degrees. Here's my code so far: