3dcheapskate opened this issue on Sep 13, 2021 ยท 20 posts
3dcheapskate posted Mon, 13 September 2021 at 4:07 AM
What I'm trying to do you ask ?
I'm trying to control all the legs of a millipede from a single dial, details over at HiveWire - The first four segments of a millipede - not sure if this'll go anywhere :)
I'm doing all the maths within the CR2 itself using valueOps. Part of this involves calculating sines/cosines, which I'm doing via a simple valueOpKey lookup table. The table has values from 0 to 360 in steps of 10, which seems sufficiently accurate for my purposes. Like this:
The key value, marked by the red box in that screenshot, is calculated by adding two values which each have ranges of 0-360, giving a resultant range of 0-720. So I've temporarily concocted a Heath-Robinsonesque set of valueOps to ensure that the result of adding two 0-360 numbers will be modulo 360.
However, I want one of those two numbers being added together to have an unlimited range in order to represent multiple cycles - i.e. 360 is one cycle, 720 is two cycles, etc. My Heath-Robinsonesquerie will be unmamnageable if I try to extend it.
Therefore I'm looking for an alternative way to do the modulo 360. I found this Computing Mod Without Mod paper on the internet, but I don't think that any of those approaches can be taken using valueOps.
Another idea I had was to use another valueOpKey lookup table to reduce the input value to the 0-360 range, like this:
However, the interpolation is NOT linear as I thought, and goes totally haywire. Maybe I'm missing something simple here ?
Any thoughts, ideas, suggestions would be appreciated. Except for "do it in Python" - that's the coward's way out ! :)
The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.
*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).