# Accumulated Rotation

Hi, been cracking my head over how to do this.
Appreciate if someone can point me in the right direction.

I have a panel chop detecting mouse movement.
Drag right and a cube rotates say 30 degrees.
Mouse out and back again on another segment of panel as separate panel event, rotating FROM last pose at 30 degrees to 40 degrees.

Forum mentioned Object chop but l still can’t wrap my head around this to accumulated the rotation.
Much appreciated.
cheers!

Hey, I had to work something like this out the other day for a very similar situation. Panning a 2d canvas/work area around cumulatively with the mouse movements only while rmb is pressed.

Ill try and upload a .toe later when I have access to my pc in a couple days but this is how I went about handling that generally speaking:

1. First I got u/v coordinates from a panel chop.

2. Then created a panel dat to listen for while pressed, and button up

3. I created 2 tables that held coordinates/ info (in my case x and y transforms)

Table 1 held the actual transforms being applied to the object being moved
Table 2 held the offsets from the coordinates in table 1 starting from when the bottom was pressed.

1. in the panel dat,
• while pressed would constantly update table 2 with current coordinate values in real time.
-Button up would set table 1 = table 1 plus table two and then reset table 2 to 0
1. convert both dats to chops then add like attributes together (x and x offset for example)
The sum is you accumulated offset

Sorry if that’s kind of hard to follow, pulling what I did out of memory, I’ll try and upload a better example in a few days

Hi Lucas,
Thanks for the pointer!
Yes l get the gist of your suggestion.
l did try the same approach using Hold and Logic chop but just couldn’t get it to work.
Shall get down to your table data method the minute l’m on my laptop.
A .toe file later would still be awfully nice.
Many thanks Lucas!
Cheers.

Here’s a stripped down file of what I had been doing attached - pressing r resets the rotations.

• the frame that the u/v values come from should be square else the u’s movement will be scaled differently than the v.
I’m sure there’s a way to normalize this pretty easily with some maths but haven’t messed with it yet.

Hope that helps!
accumulatedRotationExample.1.toe (6.87 KB)

Thanks thanks thanks Lucas!