POV-Ray : Newsgroups : povray.newusers : How can I print a vector to the screen? : Re: How can I print a vector to the screen? Server Time
28 Nov 2024 00:34:16 EST (-0500)
  Re: How can I print a vector to the screen?  
From: Steve
Date: 15 Apr 2002 08:43:57
Message: <slrnablebn.vmr.steve@zero-pps.localdomain>
On Mon, 15 Apr 2002 07:13:37 +0200, Sebastian H. wrote:
> Steve wrote:
>> Is there a way to print a vector using #debug?  And if so could someone
>> please give an example?
>> 
> 
> Try this:
> 
> // ----------
> //
> // Simply "returns" a vector in a string in POV-Ray notation
> //
> #macro v_string (V)
>   concat ("<", str (V.x, 0, 4),", ", str (V.y, 0, 4),", ", str (V.z, 0, 
> 4),">")
> #end

Thanks that syntax is what I needed. 
 
> 
> #declare Wanna_see_this_vector = <2, 0.1, 12.5>;
> 
> // Should print <2, 0.1, 12.5> to the debug output
> #debug v_string (Wanna_see_this_vector)
> // ----------
> 

Thanks again, I may incorporate soemthing liek this.  I just hope my 
3.5 hasn't expired on me. 

-- 
#local i=.1;#local I=(i/i)/i;#local l=(i+i)/i;#local ll=(I/i)/l;box{<-ll,
-((I/I)+l),-ll><ll,-l,ll>pigment{checker scale l}finish{ambient((I/l)/I)+
(l/I)}}sphere{<i-i,l-l,(I/l)>l/l pigment{rgb((I/l)/I)}finish{reflection((
I/l)/I)-(l/I)specular(I/l)/I}}light_source{<I-l,I+I,(I-l)/l>l/l} // Steve


Post a reply to this message

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