POV-Ray : Newsgroups : povray.newusers : value testing Server Time
26 Nov 2024 21:36:55 EST (-0500)
  value testing (Message 1 to 2 of 2)  
From: Justin Smith
Subject: value testing
Date: 20 Nov 2003 19:45:02
Message: <web.3fbd5eea7621ac5a4a5634560@news.povray.org>
If I have something which uses random variables, or any other method of
obtaining values where I am unsure what they would be, is there a way to
have these numbers written to a file so I can examine the results?

I have a trace() function picking random points on an isosurface, and I want
to know what the normals are at each point. I need to know what kinds of
averages I get in order to correctly write a macro I'm working on.


Post a reply to this message

From: Mike Williams
Subject: Re: value testing
Date: 20 Nov 2003 23:32:29
Message: <JuuB0CA7IZv$EwuH@econym.demon.co.uk>
Wasn't it Justin Smith who wrote:
>If I have something which uses random variables, or any other method of
>obtaining values where I am unsure what they would be, is there a way to
>have these numbers written to a file so I can examine the results?
>
>I have a trace() function picking random points on an isosurface, and I want
>to know what the normals are at each point. I need to know what kinds of
>averages I get in order to correctly write a macro I'm working on.

The conventional way of doing that is to use #debug, which outputs
string information to the Message pane. As you want to output numeric
information, you'll need to use str() to convert the numbers to strings.
You'll probably also want to use concat() to format the output. 

#debug concat("<",str(MyPoint.x,0,-1),","
                  str(MyPoint.y,0,-1),","
                  str(MyPoint.z,0,-1),">\n")

Or you could use one of the formatting macros from strings.inc

#include "strings.inc"
#debug VStr(MyPoint)
#debug "\n"

If you find that you really do need to write the info to a file, then
you'll need to look at the documentation for #fopen and #write

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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