H16 point node

   2017   1   0
User Avatar
Member
24 posts
Joined: May 2009
Offline
Hi,
Trying to learn houdini and following tutorials shows how to use the old point node, but how do i use the new point node?
I would like to create Cd with expression (1-$PT/$NPT) in the red channel, however from my understanding that is hscript, and the new node is vex. Trying to use (1-@ptnum/@numpt) doesnt work, it just gives me a constant red value (i am changing the vexpression to value)
User Avatar
Member
2040 posts
Joined: Sept. 2015
Offline
Your only doing integer math, which means results get rounded off (floored) to 0.

ptnum/numpt being integers only ever give 0(rounded), so 1-0 only ever give the 1 that you see for your results.

You need to cast the integers to floats, so you get the ‘fractional’ values.

Try this:

@Cd = (1.0- float(@ptnum)/float(@numpt))
Edited by BabaJ - March 15, 2017 08:57:10
  • Quick Links