From c7e3d91d9e4fb2a4ea4312b01d6b9ea6ff66952c Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 22 Sep 2003 07:45:34 +0000 Subject: 2000-Feb-13 v2 --- stern.cpp | 74 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'stern.cpp') diff --git a/stern.cpp b/stern.cpp index a2ea075..6d17ebe 100644 --- a/stern.cpp +++ b/stern.cpp @@ -16,33 +16,9 @@ void Rotation(void); int key(void); #define COPYRIGHT "Dark Alliance (c) 1996-2000 DreamDemon" -#define PI 3.1415926 -#define Lines 36 +#define PI 3.14 +#define Lines 72 -static int World[Lines][3] = { - -60, 40, 20, -20, 40, 20, - -20, 40, 20, -20, 0, 20, - -20, 0, 20, 60, 0, 20, - 60, 0, 20, 60,-40, 20, - 60,-40, 20, -60,-40, 20, - -60,-40, 20, -60, 40, 20, - - -60, 40,-20, -20, 40,-20, - -20, 40,-20, -20, 0,-20, - -20, 0,-20, 60, 0,-20, - 60, 0,-20, 60,-40,-20, - 60,-40,-20, -60,-40,-20, - -60,-40,-20, -60, 40,-20, - - -60, 40, 20, -60, 40,-20, - -20, 40, 20, -20, 40,-20, - -20, 0, 20, -20, 0,-20, - 60, 0, 20, 60, 0,-20, - 60,-40, 20, 60,-40,-20, - -60,-40, 20, -60,-40,-20}; - - -/* Lines 72 static int World[Lines][3] = { 90, 0, 0, 10, 10, 10, 90, 0, 0, 10, 10,-10, 90, 0, 0, 10,-10,-10, 90, 0, 0, 10,-10, 10, @@ -62,8 +38,8 @@ static int World[Lines][3] = { 10, 10,-10, 10,-10,-10, -10, 10,-10, -10,-10,-10, 10, 10, 10, 10, 10,-10, 10,-10, 10, 10,-10,-10, -10,-10, 10, -10,-10,-10, -10, 10, 10, -10, 10,-10}; -*/ -float X, Y, Z, sX, sY, Xa, Ya, Za, sXs, sYs, D, Page, Xmid, Ymid; + +float X, Y, Z, sX, sY, Xa, Ya, Za, sXs, sYs, D, G, Page, Xmid, Ymid; float R, R1, R2, R3, Sr1, Sr2, Sr3, Cr1, Cr2, Cr3, mX, mY, mZ; void main(void) @@ -134,6 +110,7 @@ void InitProgram(void) R1 = 0; R2 = 0; R3 = 0.3; + G = 0.3; } void MainLoop(void) @@ -141,19 +118,42 @@ void MainLoop(void) int k; while((k=key()) != 27) { - R += 0.1; - if(R > (2 * PI)) R = 0; -// R -= 0.1; -// if(R < 0) R = 2 * PI; - R1 = R; - R2 = R; - R3 = R; - + switch(k) { + case 115: case 83: // S + R1 += G; + if(R1 > (2 * PI)) R1 = 0; + break; + case 101: case 69: // E + R2 += G; + if(R2 > (2 * PI)) R2 = 0; + break; + case 113: case 81: // Q + R3 += G; + if(R3 > (2 * PI)) R3 = 0; + break; + case 119: case 87: // W + R1 -= G; + if(R1 < 0) R1 = 2 * PI; + break; + case 100: case 68: // D + R2 -= G; + if(R2 < 0) R2 = 2 * PI; + break; + case 97: case 65: // A + R3 -= G; + if(R3 < 0) R3 = 2 * PI; + break; + default: break; + } -// WAIT 986, 8 clearviewport(); DrawObject(); + + outtextxy(10,10,"Esc - Quit"); + outtextxy(550,10,"Q W E"); + outtextxy(550,20,"A S D"); outtextxy(10,330,COPYRIGHT); + setvisualpage(Page); Page = 1 - Page; setactivepage(Page); -- cgit v1.2.3