Achaiah
04-30-2008, 09:05 PM
Apologies if this has been asked before (yes I did browse through the forum but I'm a WWJ newbie :) )
I'm having some trouble using the state iterators in my code. I'm trying to provide functionality that will zoom in and out over the same point based on user input (just like you would be able to do in WWJ with a mouse wheel, except that my input comes from another device).
My approach is that every time I get a new value as input, I create a new AltitudeIterator and apply it to the view via view.applyStateIterator(...). Unfortunately, that approach refuses to work like the mouse wheel would. It seems that every call to applyStateIterator(...) stops any currently running iterator even if it is in the middle of iterating and then reapplies the new iterator. The end result is that the animation is really jittery, jumpy and unworkable unless the inputs are spaced far enough apart for the current StateIterator to finish. Sadly, in my case the updates happen very frequently.
Compare this with the mouse, where even if you scroll the wheel multiple times in quick succession, the iterators seem to get buffered or merged or something along those lines and the entire motion is smooth from start to finish.
Has anyone else run into the same problem? I would greatly appreciate a solution or a couple of pointers.
Thanks!
I'm having some trouble using the state iterators in my code. I'm trying to provide functionality that will zoom in and out over the same point based on user input (just like you would be able to do in WWJ with a mouse wheel, except that my input comes from another device).
My approach is that every time I get a new value as input, I create a new AltitudeIterator and apply it to the view via view.applyStateIterator(...). Unfortunately, that approach refuses to work like the mouse wheel would. It seems that every call to applyStateIterator(...) stops any currently running iterator even if it is in the middle of iterating and then reapplies the new iterator. The end result is that the animation is really jittery, jumpy and unworkable unless the inputs are spaced far enough apart for the current StateIterator to finish. Sadly, in my case the updates happen very frequently.
Compare this with the mouse, where even if you scroll the wheel multiple times in quick succession, the iterators seem to get buffered or merged or something along those lines and the entire motion is smooth from start to finish.
Has anyone else run into the same problem? I would greatly appreciate a solution or a couple of pointers.
Thanks!