|
|
Thanks for the reply Dennis ... Here is my code below ... and after looking
at your cool media/photon/radiosity project .... I have to say ... don't
laugh.
The media object and the media "switch" are at the end of the code
Thanks,
Michael
// ==== Standard POV-Ray Includes ====
#include "colors.inc" // Standard Color definitions
#include "textures.inc" // Standard Texture definitions
#include "functions.inc" // internal functions usable in user defined
functions
global_settings { max_trace_level 100 ambient_light color White }
#declare Glass_Interior = interior { fade_distance 6 fade_power 2 }
// Draw Outside Object Switches
#declare dgrass = 0; #declare dsky = 1; #declare outsidelight = 1;
// Draw Wall Object Switches
#declare dceiling = 1; #declare dNwall = 1; #declare dEwall = 1;
#declare dfloor = 1; #declare dSwall = 1; #declare dWwall = 1;
#declare detail = 0;
// Set Room Units
#declare inches = 1; #declare foot = 12*inches;
#declare Rlen = 30*foot; #declare Chei = 20*foot; #declare Wthi =
10*inches;
#declare Rwid = 20*foot; #declare Fhei = 1*inches;
// Define Cameras
#declare Cam1 = camera { perspective
location <0.000, 5.000, -10.000>
angle 70.000 // FovX < Zoom >
look_at < 0.000, 0.000, 0.000 >
}
#declare NorthCam = camera { location < 0, (Chei-Fhei)/2,Rwid-(20*foot)
> look_at < 30, (Chei-Fhei)/4, Rwid > angle 70 }
#declare SouthCam = camera { location < 0, 30, 100 > look_at < 0, 30, 0
> }
#declare EastCam = camera { location <-100, 30, 0 > look_at < 0, 30, 0
> }
#declare WestCam = camera { location < 100, 30, 0 > look_at < 0, 30, 0
> }
//#declare TopCam = camera { location < 0, Chei-1, 0 > look_at < 0,
0, 0 > angle Rwid }
#declare TopCam = camera { location < -Rlen+5, Chei/2, 0 > look_at <
0, 0, 0 > } //angle 120 }
camera { NorthCam } // Edit this line to change cameras
// END Standard declares ******************************
// START Outside **************************************
background { Blue-.5 }
#if ( dgrass ) plane { y, -1 pigment { Green } } #end
#if ( dsky )
#declare EarthRadius = 6379439.6; // in meters (thus, 1 pov unit
=~= 1 m)
#declare CloudHeight1 = 1500.0; // in meters, still
#declare CloudPigment = pigment { bozo
turbulence 0.65
octaves 6
omega 0.7
lambda 2
color_map { [0.0 0.1 color rgb
<0.85, 0.85, 0.85> color rgb <0.75, 0.75, 0.75>]
[0.1 0.5 color rgb
<0.75, 0.75, 0.75> color rgbt <1,1,1,1>]
[0.5 1.0 color rgbt
<1,1,1,1> color rgbt <1,1,1,1>]
}
}
// Low clouds
sphere { < 0, -EarthRadius, 0 > EarthRadius+CloudHeight1
pigment { CloudPigment scale 1000 }
finish { ambient 1 }
hollow
}
// High clouds
sphere { < 0, -EarthRadius, 0 > EarthRadius+2*CloudHeight1
pigment { CloudPigment scale < 10000, 10000 ,20000 > rotate
< 310, 69, 10 > }
finish { ambient 1 }
hollow
}
// Fog
fog { color Grey
fog_type 2
fog_alt 100
distance 1000
}
#end
// END Ouside *****************************************
// START Room Textures ********************************
#declare WallPigment = pigment { brick
color Grey/5, // color of
mortar
color White // color of brick
//brick_size <2*foot,1*foot,1> // size
of brick (optional)
//mortar 1 // width of
mortar (optional)
scale 4
}
#declare CeilingPigment = pigment { Yellow + Red + Tan*2 + White*2 }
#declare FloorTexture = texture { #if ( detail )
pigment { bozo
frequency .5
color_map {
[0.0 color
Gray/3 ]
[0.1 color
Gray/2 ]
// [0.2 color
Gray ]
// [0.6 color
Gray*2 ]
[1.0 color
White ]
}
scale 50
}
normal { bumps 8
bump_size .06
accuracy 0.2
turbulence 5
}
finish { ambient .3
diffuse 0.7
//brilliance 6
reflection 0.06
//phong 0.75
//phong_size 80
irid {
// Iridescence (Newton's thin film interference)
0.15
// intensity
thickness 0.25
// film's thickness [0.0]
turbulence 0.1
// film's thickness turbulence
}
}
#else
pigment { Gray }
#end
}
// END Room Textures **********************************
// START Drawing Room *********************************
#if (dceiling)
box { <-Rlen-Wthi, Chei, -Rwid>, <Rlen, Chei+Wthi, Rwid> pigment {
CeilingPigment } } //normal { CeilingNormal } }
#end
#if (dfloor)
box { <-Rlen, 0, -Rwid>, <Rlen, Fhei, Rwid> texture { FloorTexture }
}
#end
#if (dSwall)
box { < -Rlen -Wthi, Fhei, -Rwid >, < Rlen+Wthi, Chei, -Rwid-Wthi >
pigment { WallPigment } } //normal { WallNormal } }
#end
#if (dWwall)
box { < -Rlen, Fhei, -Rwid - Wthi >, < -Rlen -Wthi, Chei, Rwid >
pigment { WallPigment } } //normal { WallNormal } }
#end
#if (dEwall)
box { < Rlen, Fhei, Rwid >, < Rlen+Wthi, Chei, -Rwid-Wthi > pigment {
WallPigment } } //normal { WallNormal } }
#end
#if (dNwall)
difference { box { < -Rlen-Wthi, Fhei, Rwid >, <Rlen+Wthi, Chei,
Rwid+Wthi > pigment { WallPigment } } //normal { WallNormal } }
// Cut Windows
box { <-1.5*foot, 2*foot, Rwid - Wthi - 1 > < 1.5*foot,
15*foot, Rwid + Wthi + 1 > }
// box { <-1.5*foot, 2*foot, Rwid - Wthi - 1 > < 1.5*foot,
15*foot, Rwid + Wthi + 1 > translate x*(12*foot) }
// box { <-1.5*foot, 2*foot, Rwid - Wthi - 1 > < 1.5*foot,
15*foot, Rwid + Wthi + 1 > translate -x*(12*foot) }
}
#end
// END Drawing Room *************************************
//*****************************************************************************
// Define & Draw Stained Glass
//*****************************************************************************
#declare MainGlass = box { < -17.500, -80.000, -0.120 >, < 17.500, 80.000,
0.120 > }
#declare CircleGlass = cylinder { -0.125*y,0.125*y,16.000 rotate
<90.000,0.000,0.000> translate <0.000,10.000,0.000> }
#declare CrossGlass = merge { box { < -15.500, -3.000, -0.125 >, < 15.500,
3.000, 0.125 > translate <0.000,10.500,0.000> }
box { < -3.000, -25.000, -0.125 >, < 3.000,
25.000, 0.125 > }
}
#declare SG1 = // Stained Glass Object
union { difference { box { < -18.000, -80.000, -0.250 >, < 18.000, 80.000,
0.250 > } // Frame
box { < -15.500, -77.500, -0.300 >, < 15.500, 77.500,
0.300 > }
}
// Cross and Circle Frame
union { torus { 16.000,0.300 rotate
<90.000,0.000,0.000> translate <0.000,10.000,0.000> }
cylinder { -25.000*y,25.000*y,0.300 translate
<-3.000,0.000,0.000> }
cylinder { -25.000*y,25.000*y,0.300 translate
<3.000,0.000,0.000> }
cylinder { -16.000*y,16.000*y,0.300 rotate
<0.000,0.000,90.000> translate <0.000,7.500,0.000> }
cylinder { -16.000*y,16.000*y,0.300 rotate
<0.000,0.000,90.000> translate <0.000,13.500,0.000> }
cylinder { -3.000*y,3.000*y,0.300 rotate
<0.000,0.000,90.000> translate <0.000,25.000,0.000> }
cylinder { -3.000*y,3.000*y,0.300 rotate
<0.000,0.000,90.000> translate <0.000,-25.000,0.000> }
}
// Cut Cross Glass
object { CrossGlass
texture { pigment { color Brown
transmit .5
filter .8
}
finish { ambient 0.5
diffuse 0.5
reflection 0.05
specular 0.25 roughness 0.01
}
}
}
// Cut Main Glass
difference { object { MainGlass }
object { CircleGlass }
object { CrossGlass }
texture { pigment { color Violet
transmit .3
filter .8
}
finish { ambient 0.5
diffuse 0.5
reflection 0.05
specular 0.25 roughness 0.01
}
}
}
// Cut Circle Glass
difference { object { CircleGlass }
object { CrossGlass }
texture { pigment { color Yellow
transmit .5
filter .8
}
finish { ambient 0.5
diffuse 0.5
reflection 0.05
specular 0.25 roughness 0.01
}
}
}
} // End union SG1
object { SG1 translate <0,105,Rwid+Wthi/2> }
//*****************************************************************************
// Define Light Source and Media
//*****************************************************************************
#if (outsidelight)
light_source { <-300000,390000,250000> White*0.5
area_light x*1.5,z*1.5,4,4 adaptive 1
circular
media_attenuation 1
media_interaction 1
}
#end
light_source { <0, Chei-20, -Rwid+Wthi > .1 // small interior light
media_attenuation 0
media_interaction 0
}
#declare dmedia = 1; // <<<<<<< MEDIA SWITCH
#if ( dmedia ) // haze media
box { < -Rlen, Fhei, 0 >< Rlen, Chei, Rwid+Wthi/2 >
pigment { rgbt 1 }
hollow
interior { media { //absorption .4
scattering { 1, 0.07
extinction 0.01
}
samples 80,100 //30,100
}
}
}
#end
Post a reply to this message
|
|
|
|
I looked at your code...
I think you have parts of the media object in
a non-hollow object.
Parts of your scene have no texture assigned.
The sky_sphere, background and fog don't work
well with media (3.3.2.1). Use a big inverted
sphere or something for sky.
The scale of your objects is quite large, the
clouds in particular are at the edge of the
resolution of the floating point numbers in pov.
I tend to use 1 pov unit = 1 foot or so...
Here's a similar scene I made tests with...
--- Code ---
// Persistence of Vision Ray Tracer Scene Description File
// File: stained.pov
// Vers: 3.6
// Desc: a test of stained glass and media
// Date: 12/20/2006
// Auth: Tim Attwood
//
#version 3.6;
#include "colors.inc"
#include "stones.inc"
global_settings {
assumed_gamma 1.0
}
// --- camera, lights & background ----------------------------------------
camera {
location <2.5, 0.7, -4.0>
direction 1.5*z
right x*image_width/image_height
look_at <1.0, 0.0, 0.0>
}
light_source {
<-30, 40, 30>
color rgb <1, 1, 1>
}
light_source {
<5, 5, -30>
color rgb <.1, .1, 1>*0.2
media_interaction off
}
// --- textures -----------------------------------------------------------
#declare Stained_Glass = texture {
pigment {
crackle solid
color_map {
[0 Red transmit 0.1 filter 0.8]
[0.2 Yellow transmit 0.1 filter 0.8]
[0.4 Blue transmit 0.1 filter 0.8]
[0.6 Red transmit 0.1 filter 0.8]
[0.8 Yellow transmit 0.1 filter 0.8]
[1 Orange transmit 0.1 filter 0.8]
}
scale 0.2
}
}
texture {
pigment {
crackle
color_map {
[0 Black]
[0.02 Black]
[0.03 Clear]
[1 Clear]
}
scale 0.2
}
};
#declare Dust = material {
texture {
pigment {Clear}
}
interior {
media {
scattering {
2, 0.07 extinction 0.01
}
method 3
samples 30,100
}
}
};
#declare Wall = texture {
pigment {
brick Gray50,Firebrick
scale 0.025
}
};
#declare Floor = texture {
hexagon
texture { pigment{Tan*0.9} },
texture { pigment{Tan} },
texture { T_Stone17 scale 3}
scale <0.4,1,0.2>
};
// --- scene --------------------------------------------------------------
// floor
plane {y,-1 texture {Floor}}
// windows
union {
box {<-2,0,2>,<-1,1.6,2.001>}
box {<-0.8,0,2>,<0.2,1.6,2.001>}
box {<0.4,0,2>,<1.4,1.6,2.001>}
texture {Stained_Glass}
}
//wall
difference {
box {<-10,-1,1.8>,<10,10,2.2>}
box {<-2,0,0>,<-1,1.6,3>}
box {<-0.8,0,0>,<0.2,1.6,3>}
box {<0.4,0,0>,<1.4,1.6,3>}
texture {Wall}
}
// sky
sphere {<0,0,0>,100 inverse pigment {White}}
// media object
box {
<-2,-1,-1>,<4,1.6,1.999> hollow
material {Dust}
}
Post a reply to this message
|
|