1

I'm rotating a teapot according to an axis of rotation given the user click. The axis is calculated as the perpendicular line to the line from the clicked point to the origin. All of this is happening in the xy plane and z = 0.

The first rotation, everything works perfectly, but in the next rotations the perpendicularity to the point it's not kept, as the axes rotated. How could I maintain this functionality?

Rabbid76
  • 202,892
  • 27
  • 131
  • 174
  • see [Understanding 4x4 homogenous transform matrices](https://stackoverflow.com/a/28084380/2521214) especially the last links in there. You need to separate your `MODELVIEW` into `camera` and `model` matrix so you can easily transform between global world and model local coordinates. Also to preserve transforms you need to have them in cumulative form (not reseting them on each frame/resize ...) As you did not share the relevant code and structures you are using we can only guess so we can not help more specificaly than this. – Spektre Sep 20 '18 at 07:49

0 Answers0