|
|
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
|
|
|
|
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
|
|