VEX Orient Randomize Single Axis Value

   8683   3   0
User Avatar
Member
100 posts
Joined: 10月 2013
Offline
Hi,

I'm trying to randomize points from a heightfield_scatter node using Attribute Wrangle after it.

@N = set(0,0,1);
@pscale = fit(rand(@ptnum),0,1,.75,1.5);
@porient = (0,fit(rand(@ptnum),0,1,0,180),0);

The pscale portion works, but the @porient line does not. These nodes are followed by a for each loop with a copy to points in the middle. The objects are scaled correctly, but they all have the same, unchanged rotation value.

Any ideas?

Thanks,

Adnan
User Avatar
Member
8766 posts
Joined: 7月 2007
Offline
there is no such thing as @porient
there is p@orient where p means that it is vector4 as it's a quaternion
since it is one of known attributes you can also just type @orient in wrangle and Houdini automatically create it as vector4 quaternion
float angle = fit01(rand(@ptnum),0,360);
p@orient = eulertoquaternion(radians(set(0, angle, 0)), 0);
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
100 posts
Joined: 10月 2013
Offline
Thanks a lot Tomas! That worked perfectly.

Adnan
User Avatar
Member
157 posts
Joined: 7月 2005
Offline
Just came across this today. Worked great!

Thanks Tomas.
Floyd Gillis
  • Quick Links