Point normals orientation

   5963   3   1
User Avatar
Member
164 posts
Joined: 4月 2008
Offline
Hi,

As part of a bigger thing, I'm trying to make the point normals of a grid to point to the closest point with a certain parameter value.
I've made a little sketch in ps how I think they should behave. (please find the image attached.)

It's based on a grid which has points with changing color value's over time. The normals should point to the closest brightest point. In a typical example there could be more than 1 ‘hero’ point, any point on the grid can become a ‘hero’ point.
At this moment the color values are controlled by several point attributes, but I will change this to a animated sphere and a transferAttribute approch.

The reason why I would like to get the normals behave like this is because I would like to copy circles to these points, the color affects there size. Since a bigger circle needs more room, I want the other circles to move from the larger one.

I think the solution lies within a vopsop, I found a neighbor vex node but I'm not really sure were to start.
I know a little vex but I would appreciate it if some one would like to try helping me to solve this one.

Attachments:
Squishy_Test_03_sidefx.hipnc (627.9 KB)
SetupNormals.png (140.3 KB)

Nick Nimble

VFX blog - http://www.nicknimble.com [nicknimble.com]
Facebook - http://www.facebook.com/nicknimble [facebook.com]
Twitter - https://twitter.com/Nick_Nimble [twitter.com]
User Avatar
Member
164 posts
Joined: 4月 2008
Offline
I've found the appropriate solution for this, it's actually quit simple. It's nothing more than clever use of the transferAttribute Sop.

In this setup I've used a sphere as a so called influence object, this object controls which disk are scaled or moved.
Basically the disk thats most close to the sphere is scaled up where the other ones are scaled down. Because the point color is transfered to the grid and the point color values are smoothed there's a falloff in scale.

The normals of the sphere (which just point strait out) are also transfered, the y normal axis is set to 0. This way the normals on the grid point away from the hero disk, which gives the other disks a direction to move in.
Since normals exists in a vector -1 to 1 space (Or something similar), this value can be used as a offset in the x and z axis. Multiplied by the size of the disk it gives a appropriate movement of the disks. The formula I've created results in small disks moving faster than large disks.

Of cource something similar could be done with some clever scripting in 2d compositing applications, but the cool thing about this method is that is totally procedural. Which allows one to add 2, 3 or even more influence objects. The grid object can be any deforming or not object, and the method is with some small modifications also scalable to a third dimension.

It's not finished jet, I've solved the biggest issues and I just wanted to share this with the community.

I currently work for a small studio in the VTR room, I'm in a position where I need to convince my bosses Houdini is a real addition to our Maya based 3d department. And, not futile, they need to free me from my VTR job ;-). Hope this will help a bit.

Attachments:
Squishy_Test_07_sidefx.hipnc (616.0 KB)

Nick Nimble

VFX blog - http://www.nicknimble.com [nicknimble.com]
Facebook - http://www.facebook.com/nicknimble [facebook.com]
Twitter - https://twitter.com/Nick_Nimble [twitter.com]
User Avatar
Member
164 posts
Joined: 4月 2008
Offline
I've found the appropriate solution for this, it's actually quit simple. It's nothing more than clever use of the transferAttribute Sop.

In this setup I've used a sphere as a so called influence object, this object controls which disk are scaled or moved.
Basically the disk thats most close to the sphere is scaled up where the other ones are scaled down. Because the point color is transfered to the grid and the point color values are smoothed there's a falloff in scale.

The normals of the sphere (which just point strait out) are also transfered, the y normal axis is set to 0. This way the normals on the grid point away from the hero disk, which gives the other disks a direction to move in.
Since normals exists in a vector -1 to 1 space (Or something similar), this value can be used as a offset in the x and z axis. Multiplied by the size of the disk it gives a appropriate movement of the disks. The formula I've created results in small disks moving faster than large disks.

Of cource something similar could be done with some clever scripting in 2d compositing applications, but the cool thing about this method is that is totally procedural. Which allows one to add 2, 3 or even more influence objects. The grid object can be any deforming or not object, and the method is with some small modifications also scalable to a third dimension.

It's not finished jet, I've solved the biggest issues and I just wanted to share this with the community.

I currently work for a small studio in the VTR room, I'm in a position where I need to convince my bosses Houdini is a real addition to our Maya based 3d department. And, not futile, they need to free me from my VTR job ;-). Hope this will help a bit.

Attachments:
Squishy_Test_07_sidefx.hipnc (616.0 KB)

Nick Nimble

VFX blog - http://www.nicknimble.com [nicknimble.com]
Facebook - http://www.facebook.com/nicknimble [facebook.com]
Twitter - https://twitter.com/Nick_Nimble [twitter.com]
User Avatar
Member
2624 posts
Joined: 8月 2006
Offline
I currently work for a small studio in the VTR room, I'm in a position where I need to convince my bosses Houdini is a real addition to our Maya based 3d department. And, not futile, they need to free me from my VTR job Wink. Hope this will help a bit

That should not be to hard.. Houdini actually works when you get it out of the box :roll:

R
Gone fishing
  • Quick Links