Whatsinaname Posted January 3, 2016 Share Posted January 3, 2016 (edited) Simple setup: I wanted to create a color gradient on a grid inside a PointVOP. In order to do so I fed P into a length operator and plugged that into a fit and finally into Cd. Result: Gradient around origin, as length gets larger the further away P in question is from that origin. Now, I wanted to have the same gradient but coming from an arbitrary point. So I created a sphere (primitive, so It has only got one point), moved it slightly in X and plugged it into the PointVOP's second input. To get the distance from P to that sphere's P, I created an Import Point Attribute fed and OpInput2 into its file input, set it to vector and attribute to P. The I subtracted this (sphere) P from the original (grid) P, to get the distance and then plugged that into length in order to colour the grid relative to the (sphere) P. As a result I get the very same gradient around the origin as I had in the first example, which made me think P (sphere) is somehow interpreted as being 0,0,0 so I am wondering what I'm missing. color_length.hipnc Edited January 3, 2016 by Phlok Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted January 4, 2016 Share Posted January 4, 2016 (edited) hi fred, there is a node called 'distance' in VOP. Also I don´t think you should feed a primitive to pointvop. If you did, it would constantly try to compare single points from each input, which it cant because a primitive does not have points. I used the centroid of your sphere as a constant parameter that gets subtracted from each point on your grid. i hope thats what you wanted.. color_length_01.hipnc Edited January 4, 2016 by konstantin magnus Quote Link to comment Share on other sites More sharing options...
mestela Posted January 4, 2016 Share Posted January 4, 2016 (edited) Your original method is fine. The problem is your 'import point attribute' vop will default to use @ptnum as the lookup point, here you need to explicitly tell it to only use @ptnum==0 as the point to lookup from the 2nd input. Create a constant, integer type, value 0, attach it to the ptnum input of the input point attribute vop, the ramp will then jump to where you expect. Edited January 4, 2016 by mestela 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.