Planetside Software Forums

General => Terragen Discussion => Topic started by: alessandro on January 14, 2014, 06:48:31 AM

Title: Help needed with trigonometric functions
Post by: alessandro on January 14, 2014, 06:48:31 AM
Hello, I was wondering I'd you actually build a b/w gradient or a range of values between [0-PI] to be fed to a sin/cos or other trig functions.
I ask this because I'd like to experiment how to add some trig effects to existing terrains, so that for example, if you have a PF with a stretched X scale and some color offset that turns it into b/w stripes, I'd like to add some sin wave effect to those.
Thanks for any help.
Title: Re: Help needed with trigonometric functions
Post by: Matt on January 14, 2014, 08:50:56 PM
The trig functions in Terragen work with radians. Cos and Sin should take values between 0 and 2*PI (approximately 6.283), and Tan takes values between 0 and PI. Values outside these ranges wrap around of course.

Matt
Title: Re: Help needed with trigonometric functions
Post by: Matt on January 14, 2014, 08:52:18 PM
http://planetside.co.uk/wiki/index.php?title=Category:Trig
Title: Re: Help needed with trigonometric functions
Post by: alessandro on January 15, 2014, 12:37:23 PM
Thanks Matt, but how would you actually have a sin scalar, say ranging from 0 to PI, and use it as the input on a Merge Shader? I mean, how do you provide a specific input range to a Sin Scalar node?