Computer Science Canada Rotating |
Author: | SIXAXIS [ Sun Mar 02, 2008 2:03 pm ] | ||||
Post subject: | Rotating | ||||
I'm trying to make an image keep rotating forever, but I get the error
after about 10 seconds of running the program. I'm using an array, a for loop, and an image to rotate. Here is my code.
|
Author: | HeavenAgain [ Sun Mar 02, 2008 2:33 pm ] | ||||||
Post subject: | RE:Rotating | ||||||
this is where constant would kick in, maxint is a big number, bigger than your 9999999 however many 9s you have, so ....... see the problem? and array in here is not necessary.... you bascailly have the same picture, the difference is only the angle of seeing it... and plus you already have the built in rotate, why bother storing the same pictures and waste space right?
|
Author: | McKenzie [ Sun Mar 02, 2008 5:49 pm ] |
Post subject: | Re: Rotating |
You get an illegal picture because Turing only allows you to assign 1000 picture IDs. Fortunately, you only need 360 of them for your rotation. Store all 360 rotations of your picture in your array once, then just use your array. As HeavenAgain pointed out you will want to use mod to keep track of your angle. |
Author: | CodeMonkey2000 [ Sun Mar 02, 2008 10:03 pm ] |
Post subject: | RE:Rotating |
Actually you can cut that down to 36, each image represents 10 degrees. It's not that precise, but it's good enough, plus it's efficient. |