Jump to content

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
Link to comment
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
Link to comment
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
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...