I wanted to play around with the OpenGL code from a couple weeks ago and had a very long drawn out and frustrating session. I'm not sure if I hit a bug or not because I 'think' what I was doing should have worked, but it didn't.
I had the center sphere and a smaller one rotating, and depending on mouseX, the smaller object would change its distance from the large sphere. Change the mouseY would alter the zoom. the random dots in the background also adjust to mouseY. All is good. Except I wanted a second smaller sphere, also rotating and changing its distance based on mouseX but in the opposite way. What I mean by this is that I wanted the two spheres to be equal distance from the center but in opposite directions, creating a mirrored effect.
See the full gallery on Posterous I made a variable, and set it to "0-mouseX" and it didnt' work, always showing the second sphere inside the larger one. When I did a println on it, it was returning the correct value though. Just to be safe, I manually set the variable to a static negative number to ensure I could place an object at a negative position and it worked. But for some reason, I could not use mouseX in the "shape" declaration. Because I spent so long trying to work out this problem, I was not able to progress it much further than was done in class.
Posted via email from
Exploded