Function nodes give me headache

Started by Alf15000, March 11, 2013, 06:59:37 AM

Previous topic - Next topic

Alf15000

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]



jo

Hi,

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

Regards,

Jo

Alf15000

You're right  ;)

Here is a tgc file of my network : [attachurl=1]

Hetzen

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

Alf15000

#4
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 ?

mogn

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.

Alf15000

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.