samsam

Hi!

Long time lurker first time poster :)

I'm trying to base the normal direction of the peak node based on vertex colors (derived from a texture hooked up to textureToArray).

So if its red then peak pushes out along the normals and if its blue then peak pushes in along the normals. Anything in between red and blue then interpolate.


my first attempt was to use textureToArray -> splitRGBA. This allowed me to separate the red and blue channels but i wasn't sure where to go from there and how to hook it all up to the inNormalPP of the peak (vectorArray). I tried experimenting with the various array nodes i.e. createArray, array2array etc. but I didn't get to far.

Any Idea's?

Reply 0 0
plarson
Welcome. :)

If I get what you have in mind, you want vertex colors to determine whether the peak node pushes in or out along the normal? Then you don't need to do anything with inNormalPP, just use negative weight on the peak node. Using a point node you can grab the R and B values, and then combine them as desired for a weight output. Here's an example scene with that. ma vtxColor_toPeakWeightPP.ma    

Capture.JPG 
Reply 0 0
Pizzaman
Use the point Node... and simply add the normal to the transform of your points :
$TX = $TX+($WEIGHT*$NX);
$TY = $TY+($WEIGHT*$NY);
$TZ = $TZ+($WEIGHT*$NZ);

... with the influence per point connected to the inputWeightPP.
You can then do whatever you want with the normals.
Reply 0 0
Reply