Sunday, 18 September 2011

Third Code - Making the Cube Change as it Moves


The next step is to make the cube change as the mouse moved around. This was difficult is figure out but with a lot of experimenting I eventually got it.  I used a few lines of code from the tutorial from Ben Jack
  xpos = xpos + (mouseX-xpos)/30.0;
  ypos = ypos + (mouseY-ypos)/10.0;
i used this in the code. I then used xpos and ypos as coordinates for the box. because xpos and ypos are changing variables the box changed shape.

No comments:

Post a Comment