Search - User list
Full Version: Vop Sops ...
Root » Technical Discussion » Vop Sops ...
circusmonkey
I seem to of come unstuck slightly. See the file attached 2 methods for creating a colour ramp from the centre of some geometry. But I seem to of come unstuck and need a couple of pointers.

vopsop_point_in_Bounding_box :- Works fine except for the fact I cannot move the geo at the sop level. I realize that I should add to the current point. but my effort has made things somewhat worse. Which makes me think I have made a bit more of a mistake than I thought.

vopsop_using_UV :- This uv version does the same thing, but I can never get values in the details view of 1 at the centre and zero at the edge. Would love to know why and where I have gone wrong using the ramp vop

rob
graham
I'd take the position of each point relative to the center of the geometry and compare it to the maximum distance a point in the geometry is away from the center and use that to drive my ramp.

In the attached file I stash the centroid position of the geometry in a Detail attribute. I then subtract that from the position of each point and get the length of the resultant vector to see how far a point is from the center of the geometry. After that I AttributePromote the maximum distance value to a Detail attribute. Finally I divide the current point's distance from the center by the max value and then use that to control the ramp lookup.
circusmonkey
Graham , thanks for the reply it has certainly made me realize there are far more simpler ways to achieve the goal. I cannot believe I missed just using an attribute create for the centroid. Instead of hacking around with nodes in vops I will jam this example up on my site !

Thanks

Rob
tjeeds
And not that it matters but I wanted to have a crack as well. Here's everything rolled into a single VOP.
graham
The downside I found of doing it all in one and using a bounding box approach to find the maximum distance is that it breaks down quiet easily as soon as your geometry is transformed. If the grid is flat it gives the correct maximum distance, but as soon as you transform it then it no longer provides an accurate value and your color values begin to change.
tjeeds
Ah, good point Graham. I suppose it's not really any different than fitting the relative bounding box to 1-0-1, is it?
graham
The problem is basically that when you use the distance formula and the bbox side lengths to calculate the max distance, you are calculating the maximum possible, not the actual maximum distance. While the grid is planar, the bbox is the same as the geometry and you have points that are located in the corners of the box (equal to the max distance away). When you rotate the geometry your actual point distances from the center aren't changing, but the size of the bbox is as it reshapes itself, so the max possible distance changes.

You could actually put in a loop instead of the bbox method and loop over all the points to get the max distance, but then you get lovely O(n^2) processing of all your points.
circusmonkey
Graham , its good to see a good explanation about the use of bounding box vop.

rob
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB