12. You can also use scripting to obtain the same result of the second method. For this, you need a sampler info node, and a material. Map the color of the material with a ramp, choose normal, and choose a grayscale ramp as before.
13.In the Expression Editor, write the expression that calculates the RMS, which is the following code line (in my case my sampler info node is samplerInfo1):
$distance = sqrt ( pow (samplerInfo1.pointCameraX,2)
+( pow(samplerInfo1.pointCameraY,2)
+(pow (samplerInfo1.pointCameraZ,2));
Set a maximum value which is equivalent to the old max used in the second method, and divide the distance by this max value, for example let it be 56. Then you will have to link the obtained value the ramp’s V coordinate (make sure your ramp is a v ramp in this case).
$MaxValue= 56;
ramp4.vCoord = $distance / $MaxValue;
Click on create to create your expression, and render the scene. You should obtain the same result as before.
|