Jump to content

What to do with coding examples of the documentation?


Recommended Posts


I am trying to learn vex and programming in general and i'm going over the documentation.

I encounter a example like this:

      string maps[] = { "Mandril.rat", "default.pic" };
      export float alength = 0;
    vector texclr, av[];

    texclr = texture(maps[s+t > 1], s, t);
    av = array( {1,0,0}, vector(nrandom()), t, texclr, {.5,0,0});

    if (fit(noise(s*8), 0, 1, .3, .7) > t)
        av = array(1, {0,1,0}, 0);

    Cf = spline("linear", s, av);
    alength = len(av);

from: https://www.sidefx.com/docs/houdini/vex/arrays.html

And i don't know what to do with this. I can't really understand it by looking at it, so i want to know what it does by viewing it in Houdini.

But it doesn't show anything when i put it in a wrangle, because of course it is part of a network.

How can i see what it's doing? Do i need to guess what the network is, and create it? 




Link to comment
Share on other sites

Well, maybe it makes sense to start from something less sophisticated then and check VEX tutorials where the code is explained. As well as try to solve some very basic tasks with VEX. 

Below this example, there is a code explanation. First, you declare a nested function (called "crazy") that returns an array of textures etc, etc

Edited by kiryha
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...