5
votes

I'm trying to rotate a point on a plane around the normal of the plane with a certain angle (so it stays on the plane).

For example:

  • Point = (0,0,1) (on the plane)
  • Normal = (0,1,0)
  • Angle = 33 degrees

But can't seem to figure out how to do it

EDIT:

The axis of rotation always passes through the origin (0,0,0)

3
I assume you mean for the axis of rotation to pass through the origin? - Karl Knechtel
Yes, it does. It always passes through (0,0,0) - RdR
So is it the math you need help with, or the Irrlicht API, or just what? What have you tried? - Karl Knechtel

3 Answers

3
votes

If you're looking for axis-angle rotations in 3-space, Rodrigues's Rotation Formula is very useful. The Wikipedia page is pretty good: here

0
votes

Probably not optimal, but: find the span vectors of the plane (call them U and V), express the point P in terms of U and V and apply 2D rotation. PS: a normal does not fully define a plane; you need at least a point in the plane in addition.

0
votes

To compute the rotation matrix you want, you will need a bit of linear algebra. There is an article on Wikipedia which explains what you need to do.