|
|
Alain <aze### [at] qwertyorg> wrote:
> > Hi,i made this simple scene: a red light source through a projector(a small
> > prism) , a large box to define an interior and a media, and finally a mirror
> > (define by points of spline) and a cylinder for test the reflection. I have also
> > 2 camera, by the ortographic camera, as you can see rendering the scene, are
> > visible the correct rays of light of a source light (thanks to interior inside
> > box) but i don't understand why i dont' see the rays of light reflected by the
> > mirror. While if i active the 'camera behind' you can see that the photons
> > reflected on a cylinder correctly!
> > How can i do to show the rays of light reflected by the mirror like the rays
> > that hits the mirror?
> > I posted a code of scene.
> >
> > #include "colors.inc"
> > #include "textures.inc"
> > #include "shapes.inc"
> > #include "metals.inc"
> > #include "glass.inc"
> > #include "woods.inc"
> > #include "stones.inc"
> >
> >
> >
> >
> > //
> > global_settings {
> > assumed_gamma 1
> > max_trace_level 15
> > photons {
> > spacing 0.000025
> > count 1800000
> Use spacing OR count, never both.
> > max_trace_level 15
> media 1,2
> Without this, there are no photons deposited in the media. Adjust the
> values as needed.
> >
> > }
> > }
> >
> > // ortographic camera
> > camera {
> > orthographic
> > location<00.0, 110.0,30.0>
> > look_at<0.0, 0.0, 30.0>
> >
> > }
> > // camera behind
> > /*camera {
> > location<15.0, 50.0,70.0>
> > look_at<15.0, 10.0, 40.0>
> > blur_samples 50
> >
> > } */
> >
> > declare a= 1;
> > declare b=0.61;
> > declare Projector = prism {
> > linear_spline
> > 5, 5.004, 4,
> > <0,0>,<-a,b>,<a,b>,<0,0>
> > pigment {Yellow}
> >
> > }
> > Projector
> Not needed unless you want the projector to be visible.
> A beter instanciation would be:
> object{ Projector pigment {Yellow} }
> and remove the pigment from the declaration.
> >
> > light_source{<0,5.002,-0.1>
> >
> > color Red *200
> > photons {refraction on reflection on}
> >
> > projected_through { Projector }
> >
> > } //end of light_source
> >
> > //box for interior
> > box {
> > <-67, 0, -10>, //
> > < 67, 10, 60> //
> > hollow
> > texture {pigment {color rgbf 1}}
> > //texture {pigment {Blue}}
> >
> > interior {
> > media {
> > scattering {1, color White extinction 0}
> > // emission color White*0.2
> > method 3
> > intervals 1 samples 4
> > }
> > }
> > //photons {target}
> photons{pass_through}
> > }
>
> This box need hollow. As it is now, it can't contain the media.
> You may need more samples, possibly something like 100...
> Remove intervals, you don't need it to set it with the default value
> that should not be changed.
> photons{pass_through} is needed so that the photons actualy reatch your
> mirror.
>
> >
> >
> > // cylinder for test reflection
> > cylinder {
> > <0, 0, 30>, //
> > <0, 30, 30>, //
> > 14.0 // raggio
> > //open //
> > //texture { P_Silver1 }
> > pigment{White}
> > //photons {target}
> >
> >
> > }
> >
> >
> >
> > #declare mirror =
> > union {
> >
> > prism {
> > cubic_spline
> > 2,
> > 8,
> > 56,
> > <-48.500000, 40.500000>,
> > <-48.500000, 40.500000>,
> > <-46.956445, 41.531168>,
> > <-45.574971, 42.461886>,
> > <-44.333273, 43.305708>,
> > <-43.212883, 44.073862>,
> > <-42.198386, 44.775732>,
> > <-41.276812, 45.419218>,
> > <-40.440374, 46.008760>,
> > <-39.675929, 46.552711>,
> > <-38.975541, 47.055922>,
> > <-38.332364, 47.522584>,
> > <-37.740461, 47.956339>,
> > <-37.194656, 48.360364>,
> > <-36.692357, 48.735995>,
> > <-36.227347, 49.087338>,
> > <-35.796160, 49.416532>,
> > <-35.395729, 49.725477>,
> > <-35.023326, 50.015864>,
> > <-34.676523, 50.289204>,
> > <-34.354393, 50.545856>,
> > <-34.053565, 50.788154>,
> > <-33.772312, 51.017183>,
> > <-33.509077, 51.233921>,
> > <-33.262452, 51.439254>,
> > <-33.031164, 51.633989>,
> > <-32.814897, 51.818141>,
> > <-32.611649, 51.993177>,
> > <-32.420477, 52.159700>,
> > <-32.240518, 52.318264>,
> > <-32.070983, 52.469375>,
> > <-31.911149, 52.613501>,
> > <-31.760940, 52.750536>,
> > <-31.619089, 52.881467>,
> > <-31.485045, 53.006654>,
> > <-31.358299, 53.126432>,
> > <-31.238379, 53.241112>,
> > <-31.124852, 53.350982>,
> > <-31.017735, 53.455897>,
> > <-30.916190, 53.556557>,
> > <-30.819875, 53.653190>,
> > <-30.728477, 53.746009>,
> > <-30.641700, 53.835213>,
> > <-30.559273, 53.920990>,
> > <-30.481245, 54.003190>,
> > <-30.407043, 54.082329>,
> > <-30.336448, 54.158556>,
> > <-30.269257, 54.232014>,
> > <-30.205279, 54.302836>,
> > <-30.144337, 54.371148>,
> > <-30.086491, 54.436809>,
> > <-30.031336, 54.500210>,
> > <-29.978726, 54.561454>,
> > <-29.928528, 54.620638>,
> > <-48.500000, 40.500000>,
> > <-29.928528, 54.620638>
> > }
> >
> > //pigment {color rgb< 0, 1, 1> filter 1}
> > //finish {ambient 0 diffuse 0 reflection Blue conserve_energy}
> >
> > texture {Chrome_Metal}
> > finish { reflection 1 metallic 1.0 diffuse 0 conserve_energy}
> You don't need conserve_energy for a perfect mirror with no transparency
> at all.
> >
> > photons {
> > target
> > reflection on
> > refraction off
> >
> > }
> > }
> > mirror
> >
> >
>
> >
> >
>
> Alain
Ok! It works, I rewrote a code by providing your suggestions. There is one thing
that I did not understand: since i want to differentiate rays of light direct to
mirror and rays of light reflected by the mirror i put in a source light :
'color White' and in the final part of code of mirror i put:
pigment {color rgb < 0, 1, 1> filter 1}
finish {ambient 0 diffuse 0 reflection Red }
(as you can see in the code that i posted) . In this case the risulting of
reflection is better than if i use a first solution: that is the color red on a
source light and :
texture {Chrome_Metal}
finish { reflection 1 metallic 1.0 diffuse 0 }. If you render the two different
solution you can note the difference of reflection in the terminal part of
mirror.
This is the code . I added another simmetric mirror.
#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"
#include "metals.inc"
#include "glass.inc"
#include "woods.inc"
#include "stones.inc"
//
global_settings {
assumed_gamma 1
max_trace_level 15
photons {
//spacing 0.000025
count 1800000
max_trace_level 15
media 30,2
}
}
// ortographic camera
camera {
orthographic
location <00.0, 110.0,30.0>
look_at <0.0, 0.0, 30.0>
}
// camera behind
/*camera {
location <15.0, 50.0,70.0>
look_at <15.0, 10.0, 40.0>
blur_samples 50
} */
//camera3
//vista relativa alla camera 3
/*camera {
location <-33.0, 47.0,33.0>
look_at <0.0, 0.0, 30.0>
} */
declare a= 1;
declare b=0.61;
declare Projector = prism {
linear_spline
5, 5.004, 4,
<0,0>, <-a,b>,<a,b>, <0,0>
pigment {Yellow}
}
Projector
light_source{ <0,5.002,-0.1>
//color Red *200
color White
photons {refraction on reflection on}
projected_through { Projector }
} //end of light_source
//box for interior
box {
<-67, 0, -10>, //
< 67, 10, 60> //
hollow
texture {pigment {color rgbf 1}}
//texture {pigment {Blue}}
interior {
media {
scattering {1, color White extinction 0}
// emission color White*0.2
method 3
samples 10
}
}
photons{pass_through}
//photons {target}
}
// cylinder for test reflection
cylinder {
<0, 0, 30>, //
<0, 30, 30>, //
14.0 // raggio
//open //
//texture { P_Silver1 }
pigment{White}
//photons {target}
no_reflection
}
#declare mirror =
union {
prism {
cubic_spline
2,
8,
56,
<-48.500000, 40.500000>,
<-48.500000, 40.500000>,
<-46.956445, 41.531168>,
<-45.574971, 42.461886>,
<-44.333273, 43.305708>,
<-43.212883, 44.073862>,
<-42.198386, 44.775732>,
<-41.276812, 45.419218>,
<-40.440374, 46.008760>,
<-39.675929, 46.552711>,
<-38.975541, 47.055922>,
<-38.332364, 47.522584>,
<-37.740461, 47.956339>,
<-37.194656, 48.360364>,
<-36.692357, 48.735995>,
<-36.227347, 49.087338>,
<-35.796160, 49.416532>,
<-35.395729, 49.725477>,
<-35.023326, 50.015864>,
<-34.676523, 50.289204>,
<-34.354393, 50.545856>,
<-34.053565, 50.788154>,
<-33.772312, 51.017183>,
<-33.509077, 51.233921>,
<-33.262452, 51.439254>,
<-33.031164, 51.633989>,
<-32.814897, 51.818141>,
<-32.611649, 51.993177>,
<-32.420477, 52.159700>,
<-32.240518, 52.318264>,
<-32.070983, 52.469375>,
<-31.911149, 52.613501>,
<-31.760940, 52.750536>,
<-31.619089, 52.881467>,
<-31.485045, 53.006654>,
<-31.358299, 53.126432>,
<-31.238379, 53.241112>,
<-31.124852, 53.350982>,
<-31.017735, 53.455897>,
<-30.916190, 53.556557>,
<-30.819875, 53.653190>,
<-30.728477, 53.746009>,
<-30.641700, 53.835213>,
<-30.559273, 53.920990>,
<-30.481245, 54.003190>,
<-30.407043, 54.082329>,
<-30.336448, 54.158556>,
<-30.269257, 54.232014>,
<-30.205279, 54.302836>,
<-30.144337, 54.371148>,
<-30.086491, 54.436809>,
<-30.031336, 54.500210>,
<-29.978726, 54.561454>,
<-29.928528, 54.620638>,
<-48.500000, 40.500000>,
<-29.928528, 54.620638>
}
prism {
cubic_spline
2,
8,
56,
<48.500000, 40.500000>,
<48.500000, 40.500000>,
<46.956445, 41.531168>,
<45.574971, 42.461886>,
<44.333273, 43.305708>,
<43.212883, 44.073862>,
<42.198386, 44.775732>,
<41.276812, 45.419218>,
<40.440374, 46.008760>,
<39.675929, 46.552711>,
<38.975541, 47.055922>,
<38.332364, 47.522584>,
<37.740461, 47.956339>,
<37.194656, 48.360364>,
<36.692357, 48.735995>,
<36.227347, 49.087338>,
<35.796160, 49.416532>,
<35.395729, 49.725477>,
<35.023326, 50.015864>,
<34.676523, 50.289204>,
<34.354393, 50.545856>,
<34.053565, 50.788154>,
<33.772312, 51.017183>,
<33.509077, 51.233921>,
<33.262452, 51.439254>,
<33.031164, 51.633989>,
<32.814897, 51.818141>,
<32.611649, 51.993177>,
<32.420477, 52.159700>,
<32.240518, 52.318264>,
<32.070983, 52.469375>,
<31.911149, 52.613501>,
<31.760940, 52.750536>,
<31.619089, 52.881467>,
<31.485045, 53.006654>,
<31.358299, 53.126432>,
<31.238379, 53.241112>,
<31.124852, 53.350982>,
<31.017735, 53.455897>,
<30.916190, 53.556557>,
<30.819875, 53.653190>,
<30.728477, 53.746009>,
<30.641700, 53.835213>,
<30.559273, 53.920990>,
<30.481245, 54.003190>,
<30.407043, 54.082329>,
<30.336448, 54.158556>,
<30.269257, 54.232014>,
<30.205279, 54.302836>,
<30.144337, 54.371148>,
<30.086491, 54.436809>,
<30.031336, 54.500210>,
<29.978726, 54.561454>,
<29.928528, 54.620638>,
<48.500000, 40.500000>,
<29.928528, 54.620638>
}
// if i want reflection red
pigment {color rgb < 0, 1, 1> filter 1}
finish {ambient 0 diffuse 0 reflection Red conserve_energy}
// with this the reflection is not good as above
//texture {Chrome_Metal}
//finish { reflection 1 metallic 1.0 diffuse 0 }
photons {
target
reflection on
refraction off
}
}
mirror
Post a reply to this message
|
|