POV-Ray : Newsgroups : povray.competition : ISF.RC (International Science Fiction Raytracing Competition) : Re: ISF.RC (International Science Fiction Raytracing Competition) Server Time
8 Oct 2024 04:24:15 EDT (-0400)
  Re: ISF.RC (International Science Fiction Raytracing Competition)  
From: How Camp
Date: 9 May 2006 10:37:13
Message: <4460a919$1@news.povray.org>
"Sven Littkowski" <sve### [at] jamaica-focuscom> wrote in message 
news:44609aba$1@news.povray.org...

> What does the #local keyword help me within the SDL if the OS overwrites 
> different files with new ones having the same name?


A simple example...  Let's say you've got two files, each defining two 
different objects (space ships, I gather, in your case):

File #1:

#local MyTexture = texture{ ... Lotsastuff ... }

#declare Ship001 =
union {
  blah blah blah
  texture {MyTexture}
}


File #2:

#local MyTexture = texture { ... Different Lotsastuff ... }

#declare Ship002 =
union {
  blah blah blah
  texture {MyTexture}
}

Now, you've got to have a main scene file somewhere to utilize these neat-o 
ships, right?

Main File:

object {Ship001}
object {Ship002}


These ships will come out with different textures, even though the actual 
files (#1 and #2) have the SAME texture names.  That's all Warp is saying. 
Take a look at the docs for more info about the #local vs. #declare 
differences.

It sounds, though, like you may be hinting at having include files that only 
include the *textures* for other people to use.  A texture repository, 
instead of an object repository.  Notice in the example above, the 
'#declare'd ships must have different names (001 vs 002).  If you're looking 
at giving a bunch of users access to pre-defined textures, then you'll need 
unique texture names (as you have been saying).  But Warp's point is that 
you can simply make sure each object (spacecraft) has a unique name, and 
require everybody to use #local variables when they create their object. 
Then, it doesn't matter if two people both define 'CoolBlue' in their 
objects... the local variable space will treat each one separately.

- How

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