# Rotational Stump

Hi All

I want to continuously rotate a 3D object at varying velocity.
I want to switch its direction instantly. Clockwise- Anticlockwise.
I want to stop it instantly, tween its rotation randomly then start spinning again at exactly the correct angle. Like a boost or dip in speed.

After lots of forum trawling and some (fantastic Matthew Ragan articles (Love You)) I cobbled together a network that almost does the trick.

As a beginner, I was so hyped when it came together and …seemed… to work; the sense of personal development coupled with a deepening respect for TD was amazing!

However, on proper testing it fails with a visible jump on tween end. I’m stumped. Is the problem because I’m mixing ops with (learner) code? Is it because the change of LFO frequency causes a time warp!? If I’ve already calculated my end point, which seems to match the actual end point, how can this be!?

Stumped!

Any pointers much appreciated- thanx

Tweener TOX

Source TOE
spinningGeo.38.toe (23.5 KB)

Hey @Northernlite ,

i took the liberty to add a little CHOP network into your file as I believe that might be a good approach for your described requirements:

• a slider where you can control velocity in each direction. The velocity is an input to a Speed CHOP calculating distance over time.
• a button which will pick a random number via a Hold CHOP and add it for the time of 2 seconds to the velocity resulting in a random new position before returning to the previously selected velocity. The velocities `sign` is retrieved via a Function CHOP and then used to multiply with the random number to guarantee that the new position is in direction of the current velocity.

The values are all a bit extreme - just to make sure there is a big effect when you press the button. But that can be adjusted with the various Math CHOPs.

spinningGeo.39.toe (25.2 KB)

Hope this makes sense
Cheers
Markus

Wow, Thank You Markus: amazing!

I’m equally impressed and depressed by your OP ONLY solution. Is there a definitive resource easily explaining ops and more importantly, the interoperability of ops that I feel I’ve missed?

Cheers

Oh! I’ve come across this a few times now and can’t find an OP solution… how do I set the slider_velocity position thru code?

the slider is just there to give you easy access and you could run a `op('slider1').click(<value>)` where `<value>` would be a number between 0 and 1 - its accepting normalized values for it’s position.

Alternatively you could use a Constant CHOP and drive one of its value parameters the same way you are controlling the parameters of the iPar as well. When building it into a component, you could also create some custom parameters and the retrieve those via a Parameter CHOP or expression reference to control the velocity.

A definite source to operators is difficult as there is such an abundance of theoretical applications - therefor, while you might already know a lot of these things, I would point you to the intro workshop by Ben Voigt:

Best
Markus

Aaaah of course… I get it now. Your network has really helped boost my understanding- esp OP Function. It’s been very rewarding to explore your goal in a visual way. Go TD! Thank you so much!

1 Like