POV-Ray : Newsgroups : povray.newusers : transmit question : Re: transmit question Server Time
30 Jul 2024 16:20:07 EDT (-0400)
  Re: transmit question  
From: Marvin Taylor
Date: 30 Jan 2004 11:13:27
Message: <401a82a7$1@news.povray.org>
Kneb wrote:
 > If I have declared an object earlier in a file, how can I change the
 > object's transparency when I'm using it in a pov scene?

<snip>

 > Can I change aspects of its color in the scene without having
 > a variable to refer to the color?

By using #macro rather than #define you can pass the parameter rather 
than using a variable; hopefully this works for you.

Also, see "Complex see-through objects" in p.advanced-users.

Cheers,
Marvin

//==============================================================
// In header file:
#macro SillyObject(xmit)
union {
    box{<-2,-2,-.5>,<2,2,.5> pigment{color Blue transmit xmit}}
    box{<-.5,-2,-2>,<.5,2,2> pigment{color Blue transmit xmit}}
    cylinder{y*2,y*2.5,.25 pigment{color Red transmit xmit}}
}
#end

//==============================================================
// The source file...
#include "colors.inc"

global_settings{assumed_gamma 1.0}
camera{location <2,3,-7> look_at 0}
light_source{<10,20,-10> rgb 1 parallel point_at 0}
plane{y,-2 pigment{color Green}}


SillyObject(0.5) //transmit .5 <==this is what I've been trying to use


Post a reply to this message

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