POV-Ray : Newsgroups : povray.advanced-users : vlength( ) : Re: vlength( ) Server Time
30 Jul 2024 02:13:38 EDT (-0400)
  Re: vlength( )  
From: Pabs
Date: 9 Jun 2000 01:26:51
Message: <39408048.98CDDC1B@hotmail.com>
SamuelT wrote:

> So, is there a way to get a perfect average from a vector number?

try
$ vec = <1.1, 1.0, 0.9> //initialize the vector
$ av = (vec.x+vec.y+vec.z)/3.0 // get the average
#debug concat(str(av,0,5),"\n") //output the average - 0.90000 - 5 decimal places
 or use .red, .green & .blue instead of .x, .y & .z but .x, .y & .z work as well
you could also create a macro
#macro average(vec)
 ((vec.x+vec.y+vec.z)/3.0)
#end
or did you want something else

Pabs


Post a reply to this message

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