|
|
On 06/17/2018 09:12 PM, jr wrote:
>
> "the idea" is very simple, I would like to animate some visible, emissive media
> objects such that they move through other, not directly seen (contained) media.
> the effect I'm after is that the additive effect of the differently coloured
> media when intersecting should reveal the outline of the "hidden" objects
> through the colour change(s).
>
>
With v3.8 user_defined{} density is an option. The scene below does
something close to what you want - I think.
Bill P.
//------------------------------------------
#version 3.8;
global_settings { assumed_gamma 1 }
#default { finish {ambient 0.000 } }
#declare Grey20 = srgb <0.2,0.2,0.2>;
background { color Grey20 }
#declare Camera00 = camera {
perspective
location <3,3,-3.001>
sky y
angle 35
right x*(image_width/image_height)
look_at <0,0,0>
}
#declare White = srgb <1,1,1>;
#declare Light00 = light_source { <50,150,-250>, White }
#declare Red = srgb <1,0,0>;
#declare CylinderX = cylinder { -1*x, 1*x, 0.01 pigment { Red } }
#declare Green = srgb <0,1,0>;
#declare CylinderY = cylinder { -1*y, 1*y, 0.01 pigment { Green } }
#declare Blue = srgb <0,0,1>;
#declare CylinderZ = cylinder { -1*z, 1*z, 0.01 pigment { Blue } }
#declare SphereMediaContainer = sphere { <0,0,0>, 1 }
#declare SphereHidden = sphere { <0.2,0.1,0.2>, 0.3 }
#declare BoxForReveal = box { <-0.5,-0.5,-0.5>,<0.3,0.4,0.3> }
#include "functions.inc"
#declare FnSphereHidden = function {
pattern { object { SphereHidden } }
}
#declare FnBoxForReveal = function {
pattern { object { BoxForReveal } }
}
#declare FnZero = function (x,y,z) { 0 }
#declare Density00 = density {
user_defined {
function { FnBoxForReveal(x,y,z) },
function { FnSphereHidden(x,y,z)*FnBoxForReveal(x,y,z) },
function { FnZero(x,y,z) },,
}
}
#declare Media00 = media {
method 3
samples 100
emission rgb <1,1,1>
density { Density00 }
}
#declare Clear100 = srgbt <1,1,1,1>;
#declare Texture00 = texture { pigment { color Clear100 } }
#declare Interior00 = interior { ior 1 media { Media00 } }
#declare Material00 = material {
texture { Texture00 }
interior { Interior00 }
}
#declare ObjectMediaContainer = object {
SphereMediaContainer
material { Material00 }
hollow
}
//--- scene ---
camera { Camera00 }
light_source { Light00 }
object { CylinderX }
object { CylinderY }
object { CylinderZ }
object { ObjectMediaContainer }
//------------------------------------------
Post a reply to this message
|
|