mixing active and static modes
in
Programming Questions
•
1 year ago
I am guessing this error refers to rotateCube not being called properly??? I read other people who got this error and checked my curly brackets and such but nothing...what does this error mean exactly?
- /* 3D Cube movement with arrow keys
- When user hits LEFT the cube rotates left till user hits
- right then it rotates right etc*/
- import processing.opengl.*;
- char currentKey = 'n';
- void setup() {
- size(400, 400, P3D);
- }
- void draw() {
- if(keyPressed && key == CODED) {
- if(keyCode == UP) {
- currentKey = 'u';
- }
- if(keyCode == DOWN) {
- currentKey = 'd';
- }
- if(keyCode == LEFT) {
- currentKey = 'l';
- }
- if(keyCode == RIGHT) {
- currentKey = 'r';
- }
- }
- else {
- rotateCube(currentKey);
- }
- }
- rotateCube (char currentKey) {
- i+=.05;
- if(i == 2*PI) { i = 0; }
- if(currentKey == u) {
- rotateX(i);
- }
- if(currentKey == d) {
- rotateX(-i);
- }
- if(currentKey == r) {
- rotateY(i);
- }
- if(currentKey == l) {
- rotateY(-i);
- }
- }
1