I was in the middle of making a line clipping function but I noticed the getkey function for the camera stopped working correctly. For some reason, multiple of the same keys get activated when only one is pressed. Even though only getKey(19) is true, the condition for getKey(35) also gets activated as well(Which is why I switched over to getKey(13) and getKey(21), but that doesn't work either). I believe Axe uses the Xlib getkey functions, if that has anything to do with it.
SourceCoder 3 (AXECUBEO) wrote:
:.CUBE
:DiagnosticOff
:Full
:[F7F7F7F7F708]->GDB1
:[F7F7F7F708F7]
:[F7F7F708F7F7]
:[F70808F708F7]
:[F70808F7F708]
:[F70808080808]
:[08F70808F7F7]
:[08F708080808]
:[08F708F7F708]
:[0808F7080808]
:[0808F708F7F7]
:[0808F7F708F7]
:[F7F7F7080808]
:[0808F7F7F708]
:[F708F708F708]
:Select(~1,+L1->[r1])
:For(256)
: Select(+1,cos()->{[r1]++}
:End
:0->[r1]
:L1->^^oCosLUT
:L1+256->^^oMOV
:L1+256+3->^^oINSIDE
:L1+256+9->^^oLEFT
:L1+256+14->^^oRIGHT
:L1+256+18->^^oBOTTOM
:L1+256+24->^^oTOP
:L1+256+28->^^oCODE
:
:0->theta
:0->T
:0->MOV
:
:0->CODE
:0->INSIDE
:2->LEFT
:4->RIGHT
:8->BOTTOM
:16->TOP
:Repeat getKey(15)
: ClrDraw
: If getKey(1):T+1->T:End
: If getKey(2):theta+1->theta:End
: If getKey(3):theta-1->theta:End
: If getKey(4):T-1->T:End
:
: If getKey(13)
: MOV+30->MOV
: ElseIf getKey(21)
: MOV-30->MOV
: End
:
: thetasub(Sin)->S
: thetasub(Cos)->C
: Tsub(Sin)->M
: Tsub(Cos)->N
:
: 0->CODE
: For(A,0,14)
: A*6+GDB1->B
: . X and G
: sign{B}->X->G
: . Y and O
: sign{B+1}->Y
: . Z and R
: sign{B+2}->Z
: . U and P
: sign{B+3}->U->P
: . V and F
: sign{B+4}->V
: . W and J
: sign{B+5}->W
:
: . ----\-Y ROTATION----\-
: . G acts as a placeholder for the X variable, since we're performing operations on the actual X variable and should change.
: . x' = x * cos(angle) + z * sin(angle);
: G*C+(Z*S)//16->X
: . z' = z * cos(angle) - x * sin(angle);
: Z*C-(G*S)//16->Z
: Y*8->Y
: . x' = x * cos(angle) + z * sin(angle);
: P*C+(W*S)//16->U
: . z' = z * cos(angle) - x * sin(angle);
: W*C-(P*S)//16->W
: V*8->V
:
: . ----\-X ROTATION----\-
: . G acts as a placeholder for the Y variable, since we're performing operations on the actual Y variable and it cannot change.
: . y' = y * cos(angle) - z * sin(angle);
: Y->G
: G*N-(Z*M)//16->Y
: . z' = z * cos(angle) + y * sin(angle);
: Z*N+(G*M)//16->Z
: X*8->X
: . y' = y * cos(angle) - z * sin(angle);
: V->G
: G*N-(W*M)//16->V
: . z' = z * cos(angle) + y * sin(angle);
: W*N+(G*M)//16->W
: U*8->U
:
: Z+2000/64->Z
: W+2000/64->W
: Line((X+MOV)//Z+48,Y//Z+32,(U+MOV)//W+48,V//W+32)
: . Pxl-On(sign{GDB2}//sign{GDB2+2}+48,sign{GDB2+1}//sign{GDB2+2}+32)
: End
: DispGraph
: sub(COMP,(X+MOV)//Z+48,Y//Z+32)
: Output(5,5,CODE>Dec)
: sub(COMP,(U+MOV)//W+48,V//W+32)
: Output(1,5,CODE>Dec)
:End
:
:Lbl Sin
:-64
:Lbl Cos
:^256??128,sign{+^^oCosLUT}
:Return
:
:. COMP(x,y)
:Lbl COMP
:0->CODE
:If [r1]<0
:CODE or LEFT->CODE
:ElseIf [r1]>95
:CODE or RIGHT->CODE
:End
:If [r2]<0
:CODE or TOP->CODE
:ElseIf [r2]>64
:CODE or BOTTOM->CODE
:End
:Return
:
:
:
:
:
:
:
:DiagnosticOff
:Full
:[F7F7F7F7F708]->GDB1
:[F7F7F7F708F7]
:[F7F7F708F7F7]
:[F70808F708F7]
:[F70808F7F708]
:[F70808080808]
:[08F70808F7F7]
:[08F708080808]
:[08F708F7F708]
:[0808F7080808]
:[0808F708F7F7]
:[0808F7F708F7]
:[F7F7F7080808]
:[0808F7F7F708]
:[F708F708F708]
:Select(~1,+L1->[r1])
:For(256)
: Select(+1,cos()->{[r1]++}
:End
:0->[r1]
:L1->^^oCosLUT
:L1+256->^^oMOV
:L1+256+3->^^oINSIDE
:L1+256+9->^^oLEFT
:L1+256+14->^^oRIGHT
:L1+256+18->^^oBOTTOM
:L1+256+24->^^oTOP
:L1+256+28->^^oCODE
:
:0->theta
:0->T
:0->MOV
:
:0->CODE
:0->INSIDE
:2->LEFT
:4->RIGHT
:8->BOTTOM
:16->TOP
:Repeat getKey(15)
: ClrDraw
: If getKey(1):T+1->T:End
: If getKey(2):theta+1->theta:End
: If getKey(3):theta-1->theta:End
: If getKey(4):T-1->T:End
:
: If getKey(13)
: MOV+30->MOV
: ElseIf getKey(21)
: MOV-30->MOV
: End
:
: thetasub(Sin)->S
: thetasub(Cos)->C
: Tsub(Sin)->M
: Tsub(Cos)->N
:
: 0->CODE
: For(A,0,14)
: A*6+GDB1->B
: . X and G
: sign{B}->X->G
: . Y and O
: sign{B+1}->Y
: . Z and R
: sign{B+2}->Z
: . U and P
: sign{B+3}->U->P
: . V and F
: sign{B+4}->V
: . W and J
: sign{B+5}->W
:
: . ----\-Y ROTATION----\-
: . G acts as a placeholder for the X variable, since we're performing operations on the actual X variable and should change.
: . x' = x * cos(angle) + z * sin(angle);
: G*C+(Z*S)//16->X
: . z' = z * cos(angle) - x * sin(angle);
: Z*C-(G*S)//16->Z
: Y*8->Y
: . x' = x * cos(angle) + z * sin(angle);
: P*C+(W*S)//16->U
: . z' = z * cos(angle) - x * sin(angle);
: W*C-(P*S)//16->W
: V*8->V
:
: . ----\-X ROTATION----\-
: . G acts as a placeholder for the Y variable, since we're performing operations on the actual Y variable and it cannot change.
: . y' = y * cos(angle) - z * sin(angle);
: Y->G
: G*N-(Z*M)//16->Y
: . z' = z * cos(angle) + y * sin(angle);
: Z*N+(G*M)//16->Z
: X*8->X
: . y' = y * cos(angle) - z * sin(angle);
: V->G
: G*N-(W*M)//16->V
: . z' = z * cos(angle) + y * sin(angle);
: W*N+(G*M)//16->W
: U*8->U
:
: Z+2000/64->Z
: W+2000/64->W
: Line((X+MOV)//Z+48,Y//Z+32,(U+MOV)//W+48,V//W+32)
: . Pxl-On(sign{GDB2}//sign{GDB2+2}+48,sign{GDB2+1}//sign{GDB2+2}+32)
: End
: DispGraph
: sub(COMP,(X+MOV)//Z+48,Y//Z+32)
: Output(5,5,CODE>Dec)
: sub(COMP,(U+MOV)//W+48,V//W+32)
: Output(1,5,CODE>Dec)
:End
:
:Lbl Sin
:-64
:Lbl Cos
:^256??128,sign{+^^oCosLUT}
:Return
:
:. COMP(x,y)
:Lbl COMP
:0->CODE
:If [r1]<0
:CODE or LEFT->CODE
:ElseIf [r1]>95
:CODE or RIGHT->CODE
:End
:If [r2]<0
:CODE or TOP->CODE
:ElseIf [r2]>64
:CODE or BOTTOM->CODE
:End
:Return
:
:
:
:
:
:
: