Forum: Poser - OFFICIAL


Subject: PP2014 Image Map Node: V_Offset = (V mod 0.03125) - V ...unexpected result

3dcheapskate opened this issue on Aug 12, 2019 ยท 24 posts


an0malaus posted Mon, 12 August 2019 at 4:45 AM

From the lore of Bagginsbill, the U and V inputs for most nodes, supply U and V when nothing is plugged into them. The values plugged in are subtracted from the inherent value, so plugging a constant 1 into V, gives V - 1. Plugging V into V, gives V - V, or a constant 0. So, (internal V) - (plugged in V - (V mod 0.03125)) gives +V mod 0.03125 which is a sawtooth with 32 teeth along the V axis.

Floor( 32 * V) will give 0..31 over the range 0..1, with 32 right at the last pixel where V = 1. So you could replace 32 with 31.999999 to ensure you never get 32. (Provided the internal float representation is not exactly the same as float(32))

Several folks, including myself, have done various scripts for taking an input value and turning it into a colour code or a string of digits. That kind of modulus and remainder chain function would be a good way to generate a sequence of values from an input number (seed). Randomisation is hard without recourse to much calculation.

However, doing something pseudo-random might be possible with a bit of pre-calculation.

Using the python commands in Poser's python shell:

>>> import random
>>> random.sample(xrange(32),32)
[2, 22, 1, 25, 23, 8, 15, 19, 21, 30, 5, 3, 29, 9, 6, 27, 28, 14, 13, 17, 10, 0, 24, 16, 7, 18, 11, 12, 4, 26, 31, 20]

gives a randomly ordered list you could package up into values that can be represented by feeding the various integers into inputs of ColorRamp nodes set to white, which chain together to divide up your input value into one of 32 different input ranges between 0 & 1. To introduce further randomisation, you could multiply your V input by one of the P node position coordinates and reapply the modulus, meaning if you move the object, the output values will be offset from their previous values.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.