InitCanv(); ScaleWindow(-2.7, -2, 2.7, 2); Colour("red"); // Label("a, A, s, S, d, D to rotate",-1,1); //showcube("black"); //draw cube in black Render(cube[0]); StepModel(); //Start the model running
//function StepModel() if(x!= "") { Clear(); // cx.clearRect(-canvas.width/2, -canvas.height/2, canvas.width, canvas.height); //wipe clean switch(x){ //Which button has been pressed? case "a": rotate(1, 2); //Rotate about the 0 axis break; case "A": rotate(2, 1); //Reverse rotate about the 0 axis break; case "s": rotate(2, 0); break; case "S": rotate(0, 2); break; case "d": rotate(0, 1); break; case "D": rotate(1, 0); break; case "z": //Zoom - reduce the distance r r = r - .1; break; case "Z": r = r + .1; break; } // showcube("blue"); Render(cube[0]); showmat(); } if (x!="q"){ setTimeout('StepModel()',40); }else{Label('Stopped',2,2);};