POV-Ray : Newsgroups : povray.general : POV-Ray Includes - Standards : Re: POV-Ray Includes - Standards Server Time
1 Aug 2024 02:23:10 EDT (-0400)
  Re: POV-Ray Includes - Standards  
From: nemesis
Date: 4 Dec 2006 06:15:00
Message: <web.457402fe47def5ca3976a8750@news.povray.org>
hello, here's some more food for thought regarding aliased includes:


/* test.pov */
#include "test1.inc"


light_source { 4-8*z 1 }

object { test1_sphere
        //texture { t_sph }
        //texture { test2_t_sph }
        translate z*5
}

/* test1.inc */
#include "test2.inc"

#local test2_t_sph = t_sph // <- *1* povray parser makes included declare
local to this file...

#declare test1_sphere = sphere { 0, 1
        texture { test2_t_sph } // <- ... we use it prefixing with our
chosen alias ...
}

#undef t_sph // <- *2* ... and undef all included #declares at the end


/* test2.inc */
#declare t_sph = texture {
        pigment { rgb y }
        finish { diffuse .6 phong .9 phong_size 50 }
}


It works well. If you uncomment the given textures in test.pov, it won't
render, since the symbols are hidden as expected.

So, if povray's parser gives us a help in making steps *1* and *2* a
reality, we can get better symbol scoping with very little effort.


Post a reply to this message

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