Forum: Poser - OFFICIAL


Subject: Material Room - Draw a line on a Surface

RichardCoffey opened this issue on Oct 10, 2010 · 35 posts


bagginsbill posted Thu, 14 October 2010 at 2:52 PM

Tears don't fall in perfectly straight lines. We need some wiggle in the segment.

Making the assumption that the tear is mostly going down (not horizontal) we can get by with simply wiggling the x value. I will use a low-frequency fractal sum node for this purpose. The exact scale of this will need tuning for any particular use, but the technique would be the same in all cases.

I want to maintain control of the exact start and end points, but I don't really care where the line goes in between. To do this, I need a function that starts at 0, goes to 1 in the middle, then back down to 0 at the end. I call this sort of function a "pulse". There are many functions that can be used, but my favorite is this one:

def pulse(x, k): return Gain(4 * x * (1 - x), k)

The k value is used to shift the pulse edges wider or narrower. But the middle is always 1 and the ends are always 0.

Using this formula, I modify the calculation of rx as follows:

add some wiggle in the x position - wx is the amount of wiggle

wx = .08

reduce the wiggle to 0 at start and end of segment so they don't move

wxm = wx * Gain((4 * seg.ct * (1 - seg.ct)), .8)
fs = 2

apply the wiggle

rx = (seg.pcx + wxm * (FractalSum(fs, fs, fs, 1, 0, .5, .93) - 1)) / mR

 


Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)