Jump to content
Sign in to follow this  
Whatsinaname

Import Point Attribute seems not to read my point attribute or simple

Recommended Posts

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 by Phlok

Share this post


Link to post
Share on other sites

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 by konstantin magnus

Share this post


Link to post
Share on other sites

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.

 

post-7292-0-77095500-1451888992_thumb.pn

Edited by mestela
  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×