1
$\begingroup$

I am using OSC data streams from game pad analog sticks to control transforms of objects in the viewport. Specifically, the X and Y stick axes are driving X and Z axis rotation of a mesh object. It works well enough. The OSC input range is from 0 to 1, which I am using a Map Range node to scale +/- 90 degree rotations on either axis.

The motion is currently linear. What I would like to do is adjust the scaling disproportionately, to have more fine movement around the central point (0.5) and then broader movement closer to the extremes (approaching 0 or 1). For example, from 0 to 0.25 would be mapped from -90 to -22 degrees, 0.25 to 0.75 would be mapped from -22 to +22 degrees, and 0.75 to 1.00 would map from +22 to +90 degrees.

I thought this could be accomplished with a Curve Interpolation node, but I haven't had any success with this. I expected the x axis of the graph would represent scale input values from min to max and the y axis would represent the redistribution of those value from min to max, but from my testing, this does not appear to be the case.

This seems like it would be pretty straightforward, but I can't seem to find the correct application of nodes to achieve a non-linear range mapping. How can I do this?

$\endgroup$

2 Answers 2

0
$\begingroup$

I figured it out. It turns out that the Curve Interpolation node was behaving as I expected it to in the question above. It wasn't apparent enough for some reason until I connected it to an Evaluate Interpolation node, and then connecting the outflow into the Interpolation port of the Map Range node. This seems to have the same effect as plugging the outflow of the Curve Interpolation directly into the Interpolation port of the Map Range node, and enabling the Interpolate switch on Map Range - as I had done originally - so I don't know why it works now when it didn't before.

Expanding the Node tab to the right of the Node Tree window and editing the graph in the Properties drop-down provides a lot more control for drawing and editing the graph. I can now fine tune dead zone muting on the analog sticks as well!

$\endgroup$
1
  • $\begingroup$ Hi @greg! Glad it's fixed. When the time has elapsed, it would be good if you could mark your own answer as accepted (with the tick). $\endgroup$
    – Robin Betts
    Commented Dec 21, 2022 at 6:05
0
$\begingroup$

An extra tip here. The Float Curve node is much better for situations like this. It works on any value remapped to a 0-1 range and doesn't need an additional node to do the evaluations.

I'd be interested to see the outcome of this project!

$\endgroup$
2
  • $\begingroup$ Hello @Callmepro! Please excuse my ignorance, but I do not see a Float Curve Node when searching the Add node menu. I am using v2.3.0 of Animation Nodes. I am very interested to try your suggestion, though! $\endgroup$
    – greg
    Commented Dec 22, 2022 at 17:35
  • $\begingroup$ My mistake, i thought you were using geometry nodes. I don't know the equivalent for Animation nodes $\endgroup$
    – Callmepro
    Commented Dec 23, 2022 at 13:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .