09-19-2022, 09:59 PM
I am playing with the samples of _MAPTRIANGLE to get a better understanding of the 3D rotation workings...
As a basis I am using 'Example 2: A 3D Spinning Cube demo using a software image and _MAPTRIANGLE' on the wiki page
If I put
With Pitch of 90 degrees, Roll becomes Yaw so the above values would result in the cube rotated to P=90,Y=10,R=0
It must have to do with the formulas here:
But I can't get my head around it.
Can someone give this a try and see what's the error is in these formulas?
As a basis I am using 'Example 2: A 3D Spinning Cube demo using a software image and _MAPTRIANGLE' on the wiki page
If I put
Code: (Select All)
PIT(OB&) = 90
YAW(OB&) = 0
ROL(OB&) = 10
With Pitch of 90 degrees, Roll becomes Yaw so the above values would result in the cube rotated to P=90,Y=10,R=0
It must have to do with the formulas here:
Code: (Select All)
RX& = (TZ& * CP - TY& * SP) * SY - ((TZ& * SP + TY& * CP) * SR + TX& * CR) * CY
RY& = (TZ& * SP + TY& * CP) * CR - TX& * SR
RZ& = (TZ& * CP - TY& * SP) * CY + ((TZ& * SP + TY& * CP) * SR + TX& * CR) * SY
Can someone give this a try and see what's the error is in these formulas?
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience