POV-Ray : Newsgroups : povray.general : Rays path Length : Re: Rays path Length Server Time
29 Apr 2024 05:21:29 EDT (-0400)
  Re: Rays path Length  
From: Bald Eagle
Date: 15 Jan 2018 10:15:00
Message: <web.5a5cc49bf30201835cafe28e0@news.povray.org>
Nope:
You don't put the function in the light_source definition, you define a pigment
pattern based on the function, and apply that to your shape.


http://wiki.povray.org/content/Reference:Function_Pattern


==============================================================

#version 3.71;

global_settings {
 assumed_gamma 1
}

#include "colors.inc"
#include "textures.inc"

#declare xC = 50;
#declare yC = 0;
#declare zC = -50;

#declare xL = -50;
#declare yL = 0;
#declare zL = -50;

camera {
        perspective
        up <0,1,0>
        right x*image_width/image_height
        location <xC, yC, zC>
        look_at <0, 0, 0>
        }

light_source {
                 <xL, yL, zL>
                  fade_distance 1
                  fade_power 0
                  media_interaction off
                  media_attenuation off
                 }

//plane {y, -20 texture {pigment {White}} }

#declare Scale = 0.02;
#declare FnDist = function (x,y,z) {sqrt(x*x + y*y + z*z)*Scale}
#declare  Fn =
function (x,y,z) {
 FnDist (x-xC, y-yC, z-zC) +
 FnDist (x-xL, y-yL, z-zL)
}

cone {<0, 0, 0>, 10, <0, 0, -30>, 0
 texture {
  pigment {function {Fn (x, y, z)}}
 }
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.