Issue with 3D Spinning Cube sample in MapTriangle doc
#1
Sad 
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

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
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? 
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience
Reply


Messages In This Thread
Issue with 3D Spinning Cube sample in MapTriangle doc - by mdijkens - 09-19-2022, 09:59 PM



Users browsing this thread: 1 Guest(s)