Controlled Rotation of an Object

Ok, experts, here's the challange:

I would like to rotate an object by a specific number of degrees based on user interaction. If I could completely customize a "dial" that might work, but I don't believe that level of customization is available. 

Imagine that the user needs to turn a compass rose any number of degrees. I don't think the brute force method of 360 layers or states will do it. Is there a more elegant solution?

22 Replies
Russell Still

Hmmm... Seems to increment through the degrees if the user rotates the object slowly, but a faster movement drops increments. 

For example, rotate it slowly 90° to the right and all is well. Do the same rotation quickly and it shows a number much less than 90. The trigger which updates the variable doesn't seem able to keep up with increments quickly enough.


Russell Still

I think I figured a workaround. The dial variable has no trouble keeping up. I was trying to keep a separate degrees variable and that's the one that couldn't keep up. I'll bet if I wait until the user releases the object, THEN do the math, it should work perfectly.

Nope, that won't work. There isn't a trigger that executes on mouse_up. I tried using "object loses focus" but that didn't work either.




Basically, you click a button and it triggers an off-screen object traveling on a repeating motion path. Each time the motion path completes, the dial increment increases/decreases until a whole number is reached. The dial itself also has a motion path on it that remain constant/anchored (i.e. always up). When you click a button to move forward, the dial's motion path is triggered and the dial "slides" down. When the motion path completes, you actually jump to another slide that is a duplicate of the first with one important difference: the spin anchor point for the dial is relocated to be the center of the "piece" now in focus. 

It's a bit more complicated than this as you need a bunch of variables to keep track of what piece you are on, which direction the board is facing, and which pieces you can actually move to. I used an excel spreadsheet to design and determine what I would need to track and what variable changes would need to be made with each movement.

Now, with all of that said, the sad news is that Articulate broke this with an update and they haven't quite figured out how to fix it.... yet. 

Russell Still

It would have been really useful if Articulate would give us more than just quarter, half, and full turns in the Spin animation. Even adding one-eighth turns would be better than nothing. And if they'd allow us to specify the number of degrees in the animation, that would be enormously helpful.


Math Notermans

As the latest version of GSAP is now included in Storyline, you can use that quite easily to control any kind of rotation you need. To show i made a sample and gonna add that. The first one just rotates the arrows around the globe. The 24/7 clock can be controlled by the buttons as you see them in this sample.