change attribute which is behind the back

   4343   6   1
User Avatar
Member
303 posts
Joined: May 2007
Offline
i need the grid's point feed back different value,when it's front or back from the line by vop!

for example, the line's normal is forward, and if the grid's points is ahead from the line,the grid point's normal is forward too, and if the points is at the back of the line, the point's normal is reversed!

the picture shows my mean, wish you tell me how can i do it in vop!

Attachments:
reverse_back.jpg (176.0 KB)

https://vimeo.com/user3971456/videos [vimeo.com]
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
How about create 2 lines one for each direction , then create your vector attributes and use attribute transfer onto a point group .

Rob
Gone fishing
User Avatar
Member
8595 posts
Joined: July 2007
Offline
lets assume that you are taking that green vector as a direction from nearest point on the line
then you should be able to have access to that point's normal (yellow vector) from any of the green points as well

so just calculate dot product between green and it's corresponding yellow vector and if it is less than 0 just reverse green vector
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
175 posts
Joined: July 2005
Offline
I hope this is what you looked for.
Poindcloud functions are the way to go.

Attachments:
normalsFromCurve.hipnc (95.6 KB)

User Avatar
Member
303 posts
Joined: May 2007
Offline
my first pic is used attributetransfer,
peliosis your hipfile is very helpful for me,but can it feed back two different value like 0–1, to indicate weather it's at the front or back,

so i tried tamte's suggestion , but the result is not accuracy! just like this

Attachments:
bad_pos.jpg (168.9 KB)

https://vimeo.com/user3971456/videos [vimeo.com]
User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
You need to dot the normal from the curve with a vector representing the direction from your point on the grid to the closest point on the curve.

Attachments:
curve_normals.hip (71.3 KB)

Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
303 posts
Joined: May 2007
Offline
thank you very much
https://vimeo.com/user3971456/videos [vimeo.com]
  • Quick Links