Planetside Software Forums

General => Terragen Discussion => Topic started by: Alf15000 on March 11, 2013, 06:59:37 AM

Title: Function nodes give me headache
Post by: Alf15000 on March 11, 2013, 06:59:37 AM
Hi everybody !

To begin with function nodes, I decided to make a fully procedural cube. After few hours, I found a way to achieve my goal, but I set my last condition (X < Z ?) randomly until it works. And I don't understand why it works ;-)

Someone can explain me with examples why this condition works ?

The node network : [attach=1]

Final result : [attach=2]


Title: Re: Function nodes give me headache
Post by: jo on March 11, 2013, 08:04:03 AM
Hi,

It would be best if you could either post a project with your network or a clip of the network.

Regards,

Jo
Title: Re: Function nodes give me headache
Post by: Alf15000 on March 11, 2013, 08:10:03 AM
You're right  ;)

Here is a tgc file of my network : [attachurl=1]
Title: Re: Function nodes give me headache
Post by: Hetzen on March 11, 2013, 11:36:27 AM
Your logic should work out as , if x>Length(4) then 0 else 1, then if x<0 then 0 else previous conditional. Do the same with z then attach both axis checks to your last conditional.

A simple shape shader would be a better option for this function, but as a learning exercise you're not far off, and like everything there's several ways of doing the same thing.

Cheers

Jon
Title: Re: Function nodes give me headache
Post by: Alf15000 on March 11, 2013, 01:00:26 PM
Thank you for your answer  :)

But I still don't understand why (x < z) ? x : z works well. Where are going this values ? For one point : admit that X is greater than Z. Condition is false so : Z... But where is going Z, wich variable ?
Title: Re: Function nodes give me headache
Post by: mogn on March 12, 2013, 08:46:53 AM
Quote from: Alf15000 on March 11, 2013, 01:00:26 PM
Thank you for your answer  :)

But I still don't understand why (x < z) ? x : z works well. Where are going this values ? For one point : admit that X is greater than Z. Condition is false so : Z... But where is going Z, wich variable ?

The z is not going any where. The get position gets you a static array of of x,z points that not changed by the blue notes.
What changes, are the calculated values feed into the displacement node. The displacement node then applies the values
to the exact same points as the from the get position node.
Hope this gives sense.
Title: Re: Function nodes give me headache
Post by: Alf15000 on March 13, 2013, 05:18:59 AM
A little more understandable, but I think I need to use function nodes again and again... It's not so easy to "think function nodes" for a beginner like me ;-)

Thank you for your answer.