I want to shear a SCNPlane
like in the image below, but then on the Y-axis. So B and C are moved upwards instead of A and B to the right. I know there is a transform matrix needed to accomplish this, so I have tried to create this transform matrix like the code snippet below. But none of the possible options does give the desired result. Besides, the SCNPlane
is rotated -90 around the X-axis. Maybe someone can show me what I'm doing wrong.
var transformMatrix = matrix_float4x4()
transformMatrix.columns.0 = [1.0, tan(60), 0.0, 0.0]
transformMatrix.columns.1 = [0.0, 1.0, 0.0, 0.0]
transformMatrix.columns.2 = [0.0, 0.0, 1.0, 0.0]
transformMatrix.columns.3 = [0.0, 0.0, 0.0, 1.0]
let newTransform = matrix_multiply(transformMatrix, simd_float4x4((transformPlane?.transform)!))
transformPlane?.simdTransform = newTransform
I got the transform matrix from the answer to this question (number 3).