POV-Ray : Newsgroups : povray.advanced-users : Write macro-generated objects to file? : Re: Write macro-generated objects to file? Server Time
29 Jul 2024 00:23:49 EDT (-0400)
  Re: Write macro-generated objects to file?  
From: Florian Brucker
Date: 24 Jul 2003 11:00:45
Message: <3f1ff49d$1@news.povray.org>
Hey Torsten!

What is the problem with using File-Output-Macros only?

<code>
#include "colors.inc"

camera {
    location 5
    look_at 0
}

light_source { 100 White }

#macro Thingy(X1,X2,Filename,AutoInclude)
    #fopen MyFile Filename write
    #write(MyFile, "sphere { 0,1 scale ",X1," translate ",X2," }")
    #fclose MyFile
    #if (AutoInclude) #include Filename #end
#end

object {
    Thingy(<1,0.2,3>,2,"thingy.inc",on)
    pigment { Green }
}
</code>

The only problem is that you'll have the overhead of writing to disk /
parsing include-files every render, but that should not be the problem.

HTH,
Florian


Post a reply to this message

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