Rotating canvas about axis problems

前端 未结 2 1557
广开言路
广开言路 2021-01-25 18:41

I am using canvas 3d to draw a 3d graph in which i can plot points such as (1,5,4), (-8,6,-2) etc.So i am able to draw in all positive and negative x,y and z axis.I also have ro

2条回答
  •  闹比i
    闹比i (楼主)
    2021-01-25 19:16

    The final output of rotations along multiple axis can vary depending on the order that you rotate the axis'. What you need to do is keep track of the total rotation along each axis (as three numbers, not using matrices). And each time you update a rotation value, apply all three total rotations to an identity matrix in the correct order (try x,y,z). Always use the same order. Then use this to transform your coordinates.

提交回复
热议问题