Hey,
using a point sop I can
Add color : rand($myvalue + 1) , rand($myvalue + 2) , rand($myvalue + 4)
and I can see $myvalue being used to drive the color on the points
$myvalue is a Primitive attribute, and obviously the point sop adding it to my point color.
How can I do this in a point Wrangle?
Problem being, I want to reference the $myvalue from a primitive and add it to the point. I don't want to attr promote in sops or anything like that.
Thanks!
Add color point wrangle
14235 3 0- ludwigvon
- Member
- 27 posts
- Joined: June 2016
- Offline
- Enivob
- Member
- 2544 posts
- Joined: June 2008
- Offline
- mawi
- Member
- 242 posts
- Joined: Jan. 2008
- Offline
Keep in mind that each point might have several connected primitives.
Here is a way to get average value from primitives.
Here is a way to get average value from primitives.
@avgValue = 0;
//Fetch points conected primitives and store in array
int prims[] = pointprims(0,@ptnum);
foreach(int i; prims){
@avgValue += prim(0,"value",i);
}
@avgValue /= len(prims);
- old_school
- Staff
- 2540 posts
- Joined: July 2005
- Offline
Most efficient way I know to drive random values into a vector is to use the vector rand(val1, val2) variant of the rand() function where there is a bound geometry attribute float myvalue:
This will drive three random values in to Cd colour.
@Cd = rand(f@myvalue+1, f@myvalue+2);
There's at least one school like the old school!
-
- Quick Links