I'm trying to understand the rand.
What exactly is the $PT (and where to find a list of the different variables)
I created a random color node. Values like rand($PT) * 50 didn't work but rand($PT * 50) did?
Thanks and I'm sorry if a tutorial explains this. Haven't seen it?
noob: rand($PT*50)
5450 3 0- marvalgames
- Member
- 20 posts
- Joined: May 2016
- Offline
- Doudini
- Member
- 333 posts
- Joined: Oct. 2012
- Offline
rand() will give you a number between 0-1 so if you do (@ptnum *50) that will still be mapped to 0-1 adn the multiplier becomes like a seed. If you do (@ptnum) *50 that will multiply a random number between 0-1 by 50 therfor you will get values over 1 resulting in showing up white in the viewport.
you can use fit01 to range the random value you get between higher values.
fe: fit01(rand(@ptnum+12), 0, 10) which gives an output between 0-10
hope it helps.
edited to match @ptnum
you can use fit01 to range the random value you get between higher values.
fe: fit01(rand(@ptnum+12), 0, 10) which gives an output between 0-10
hope it helps.
edited to match @ptnum
Edited by Doudini - May 25, 2016 13:44:21
- Sean Rowe
- Member
- 39 posts
- Joined: July 2013
- Offline
- Cyzor
- Member
- 181 posts
- Joined: Feb. 2013
- Offline
Sean RoweI thought something similar had been on Erwin Santacruz's Houdini Tricks [houdinitricks.com] site once, but only see an introduction to the concept:
I can't seem to find a comprehensive list of the variables, i'll update if I find them
http://houdinitricks.com/quicktip-new-attribute-syntax-in-houdini-15/ [houdinitricks.com]
$BBX relbbox(@P).x
$BBY relbbox(@P).y
$BBZ relbbox(@p).z
$T @Time
$FF @Frame
$ST @SimTime
$SF @SimFrame
1/$FPS @TimeInc
From the internal help:
Geometry attributes
In HScript expressions on geometry you can reference the value of an attribute using `@attributename`. For example, you can use `@pscale` to get the value of the `pscale` (point scale) attribute on the current point.
For vector attributes such as `P` (position), you can use dot notation to grab a component, for example `@P.x`. You can use `.x/.y/.z` or `.1/.2/.3` or `.r/.g/.b`, whichever makes sense for the type of data.
Local variables
Nodes often provide variables that are useful for expressions on nodes of that type. For example, a node that operates over the points in a geometry will have a `@ptnum` variable representing the point number of the current point. The help for a node will list the local variables you can use in expressions on that type of node.
-
- Quick Links