rotations with show/hide entitly

Blitz3D Forums/Blitz3D Programming/rotations with show/hide entitly

This would be a possible solution, use arrays for pitch yaw and roll, and the variable c_w that indicates what array index you are currently working with.

dim pitch#(2),yaw#(2),roll#(2) ; <<<<<<< add this

While Not KeyHit(1)

UserControls()

If KeyDown( 208 )=True Then pitch#(c_m)=pitch#(c_m)-1 
If KeyDown( 200 )=True Then pitch#(c_m)=pitch#(c_m)+1 
If KeyDown( 203 )=True Then yaw#(c_m)=yaw#(c_m)-1 
If KeyDown( 205 )=True Then yaw#(c_m)=yaw#(c_m)+1 
If KeyDown( 45 )=True Then roll#(c_m)=roll#(c_m)-1 
If KeyDown( 44 )=True Then roll#(c_m)=roll#(c_m)+1

RotateEntity redcube,pitch#(0),yaw#(0),roll#(0)
RotateEntity bluecube,pitch#(1),yaw#(1),roll#(1) 
RotateEntity yellowcube,pitch#(2),yaw#(2),roll#(2)



If KeyDown (19)
HideEntity bluecube
HideEntity yellowcube
ShowEntity redcube
c_w=0 
EndIf


If KeyDown (48)
HideEntity redcube
HideEntity yellowcube
ShowEntity bluecube
c_w=1
EndIf


If KeyDown (21)
HideEntity bluecube
HideEntity redcube
ShowEntity yellowcube
c_w=2
EndIf

...continue with your code