MATHS - SINE
|Home||Tutorial Links||My Tutorials||Sample Materials||Freebies|
MATHS - SINE
Poser provides us with three functions from trigonometry. First in the list is the Sine maths function. Here we are going to look at what the Sine function produces in Poser (click here for an article on the trigonometry). The Sine function produces very similar results to the Cosine function, so check that article out for some other suggestions that work with both.
For any single number, sine returns a number between -1 and 1. Most of the time in Poser, we will be using another node to control the sine function, often a U or V node, but we can use just about any node.
Figure 1 shows what happens when we feed the sine function a U or V node - we get a regular wave, returning values between -1 and 1, and repeating endlessly (the green line shows Value_1=0.5, purple is Value_1=1, red is Value_1=2 and Blue is Value_1=4. The higher we set Value_1, the quicker our sine wave will repeat). Value_2 is ignored by the sine function.
Most of us will be used to measuring angles in degrees, with 360 degrees in a full circle. In the sine, cosine and tangent functions Poser measures angles in radians. A complete circle contains 2 times PI radians. PI represents the number of times the diameter of a circle fits into the circumference (so if a circle is 5 cm across, the circumference will be equal to 5 times PI). PI has an infinite number of decimal places, so the best we can do is use an estimated value for PI - to ten decimal places PI=3.1415926535 - and for just about any Poser requirement this really should be enough. Our 5 cm wide circle would thus have a diameter of 15.7079632675 cm.
This is important for us mostly because the sine wave repeats when our angle has gone round a full circle. If you want to use a U or V node to create a single complete sine wave, then you will need to set Value_1 of the sine maths function to 2 times PI, or 6.283185307.
Other constant values of use are PI itself, which produces the first half of the wave, and PI/2 (1.5707963265), which produces the first quarter of the wave
Figure 2 shows the sine function repeating three times. The middle Multiply node is not strictly necessary - I have included it here for clarity. Our U node provides a number than runs smoothly from 0 to 1. We plug the output from the U node into Value_1 of our Multiply node. Value_1 is set to PI (3.141593 in this case). We use Value_2 to control what multiple of PI we are going to feed to our Sine function. Here, we have set Value_2 to six. Our original range of 0 to 1 has now been turned into a range of 0 to 18.849558. When we feed that into our Sine function, we get three complete sine waves. Note that the sine wave produces results between 1 and -1. The node preview shows us values between 0 and 1 as shades of gray, but ignores the negative numbers, showing all negative numbers as black.
The basic use of the sine wave is to produce that regular repeating curve. Use it whenever you want smooth edges to a repeating pattern.
Plugging an image into a sine function with value_1 set to 1.5708 (half PI) acts in a similar way to a Bias node set to 0.8, brightening the image, but in a slightly different way that might work better with some pictures.
Plug any node into a sine function with value_1 set to PI (3.1416 is often close enough for us) to get an interesting effect.
Plug the repeating wave from figure 2 into an Abs node to get a series of ridges.