Question

For example, let's say I have P0 = (x, y, z) and I want to rotate it about y-axis with respect to the point C = (Cx, Cy, Cz)

I know that the rotation matrix to apply is:

{ {cos(angle),0,sin(angle),0}, {0,1,0,0}, {-sin(angle),0,cos(angle),0}, {0,0,0,1} }

But this matrix would be used in case of rotating with respect to (0,0,0), right?

How can I do it respect to a different point?

Was it helpful?

Solution

P' = (P - C) * A + C

where P is your point, C the point that should be the origin and A the transformation matrix.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top