POV-Ray : Newsgroups : povray.newusers : Writing a .inc file : Re: Writing a .inc file Server Time
28 Jul 2024 14:26:19 EDT (-0400)
  Re: Writing a .inc file  
From: Jim Holsenback
Date: 8 Aug 2008 05:55:22
Message: <489c180a@news.povray.org>
"Jug" <nomail@nomail> wrote in message 
news:web.489bf2df611ced9672762ce30@news.povray.org...
> Hi,
>  I am new to POV-Ray and have no previous programming experience, so 
> please
> forgive me if this is a simple question.  I a trying to write an .inc file 
> of
> an etched tile.  I want the tile and the lettering to be two different 
> colors
> and to be able to easily edit the colors of the tile from the scene file I 
> add
> it into.  I know that if I do not include a color/texture in the .inc file 
> I
> can define the it in the scene, but it makes the tile and writing the same
> color/texture.  Is there a way I can determine or change the color/texture 
> of
> the individual components of the tile from the scene file?  I would also 
> like
> to be able to easily change  the pigment, texture, and finish of the tile 
> in
> the .inc file from the scene file.  Do I need to include the standard .inc
> files, such as colors, textures, or stones1 into my .inc file, or will it 
> work
> if I include them in the scene?  I have included my tile below and added 
> in the
> color and texture as an example of what I am trying to do.  Thanks a lot 
> for any
> help you can give me.
>
> Jug

it's all about order ..... in your scene file if you have #include 
"colors.inc" before you have #include "myobject.inc" it will know about the 
colors without having those entries in the .inc file also. if your object 
had just one texture or pigment, you could build you object in the .inc file 
without any mention of color. Back in your scene file (.pov) you could call 
your object like this:  object {MyObject {pigment Green}} since your object 
has more that one pigment/texture i'd make the .inc file a macro that way 
you could call your object like this: MyObject (T_Stone1, Green) or MyObject 
(T_Stone2, Blue)

hope this helps
Jim


Post a reply to this message

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