POV-Ray : Newsgroups : povray.newusers : explain delcare. : Re: explain delcare. Server Time
5 Sep 2024 22:17:50 EDT (-0400)
  Re: explain delcare.  
From: Ken
Date: 11 Jul 1999 22:29:45
Message: <378952BB.2C39E832@pacbell.net>
Tapper Ender wrote:
> 
> How does declaring something help?  organizational purposes or er...
> 
> anyone, tell me this simple thing.
> 
> im new

 It can save a lot of typing for one thing. When a pov function is declared
you can use multiple copies of the declare without having to type in all
of the variables more than one time. Even a number that you might have to
use several time can be declare. So instead of say typing 355.16878761
5 times in a scene you could declare it like #declare A = 355.16878761;
and then use it like this:

sphere{<0,0,0>,A }

So yes it is both organazational as well as ergonmic to do so. There are
some advanced features such as applying a texture to each triangle in
a mesh object where you are required to predeclare the texture before
you can use it. 

I suggest you go through the examples to see how the #declare function is
used in various application and it will start to make much more sense to
you. A good example would be the metals.inc file. It is logicaly layed
out and should make sense ig you see how many times the same declared
statement is used throughout the file.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

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