POV-Ray : Newsgroups : povray.newusers : trying to fade an object : Re: trying to fade an object Server Time
29 Jul 2024 14:25:45 EDT (-0400)
  Re: trying to fade an object  
From: Florian Brucker
Date: 26 Sep 2005 14:07:17
Message: <433838d5@news.povray.org>
You have to make sure you add filter/transmit to *all* your pigments. It 
is not possible to do something like that:

#declare Hero = object {
   // your object
   texture { ... }
}

object {
   Hero
   pigment { rgb 1 filter 0.9 }
}

because that would use the last texture only for non-textured parts of 
the hero object. One way is to do sth like this:

//hero.inc

#ifndef(FILTER) #declare FILTER = 0; #end

#declare Hero = object {
   ...
   texture {
     pigment { ... filter FILTER }
     ...
   }
}


//main scene file

#declare FILTER = 0;
#include "hero.inc"
object { Hero translate somewhere }

#declare FILTER = 0.5;
#include "hero.inc"
object { Hero translate somewhereelse }

You'll have to include your hero file anew each time you change the 
FILTER setting, because it's evaluated at parse-time. An other option 
would be to let a macro create your hero object and call the macro with 
an appropriate filter parameter.

HTH,
Florian


Post a reply to this message

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