opengl matrix rotation quaternions

后端 未结 4 958
忘掉有多难
忘掉有多难 2021-01-18 03:20

Im trying to do a simple rotation of a cube about the x and y axis:

I want to always rotate the cube over the x axis by an amount x and rotate the cube over the yax

4条回答
  •  悲&欢浪女
    2021-01-18 03:52

    It is not clear what you want to achieve. Perhaps you should think about some points and where you want them to rotate to -- e.g. vertex (1,1,1) should map to (0,1,0). Then, from that information, you can calculate the required rotation.

    Quaternions are generally used to interpolate between two rotational 'positions'. So step one is identifying your start and end 'positions', which you don't have yet. Once you have that, you use quaternions to interpolate. It doesn't sound like you have any time-varying aspect here.

提交回复
热议问题