|
|
Hi guys. I have to simulate a rays of light of a line laser.
(http://laserlineoptics.com/powell_primer.html) I do this with a Projector (a
small prism) and a standard light source. I dont' understand why if i use a
spotlight doesn't work , that is the line that is projected on the box is short
but if i use a standard light source the line that is projected seems to be
correct. Another question : why don't if i multiply a color of 'red principal
light' by a constant i see also the ray of light that hits internal diagonal
bars? the code is this:
//-----------------------------------------------
#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"
#include "metals.inc"
#include "glass.inc"
#include "woods.inc"
#include "stones.inc"
// camera normale
camera {
location <00.0, 20.0,-40.0>
look_at <0.0, 10.0, 0.0>
blur_samples 50
}
// camera 2
/*camera {
location <10.0, 20.0,30.0>
look_at <-10.0, 10.0, 0.0>
blur_samples 50
} */
declare a= 1;
declare b=0.54;
declare Projector = prism {
linear_spline
3, 3.002, 4,
<0,0>, <-a,b>,<a,b>, <0,0> //outer rim
texture{ pigment{ color Red } }
}
// principal light
light_source{ <0,3.001,-0.1>
//light_source{ <0,3.001,-0.9>
color Red // if i multiply *100 i see light on internal bar
/*spotlight
radius 10
falloff 20
tightness 20
point_at <0, 3.015, 2> */
projected_through { Projector }
} //end of light_source
Projector
// box test laser line
box {
< 125, 10, 95>
texture { DMFLightOak }
translate z*-45
}
#declare bars =
union {
box {
texture {
T_Stone25 // predefinita da stones.inc
//pigment {Green}
//scale 10 //
}
}
box {
texture {
T_Stone25 // predefinita da stones.inc
//pigment {Green}
//scale 10 //
}
}
rotate y*-45
translate x*-0.2
translate z*-6
}
bars
//another light
light_source { <5, 30, -30> color White }
//------------------------------------------------
Post a reply to this message
|
|
|
|
Christian Froeschlin <chr### [at] chrfrde> wrote:
> CRIS wrote:
>
> > Rather about my second question, maybe I explained bad, if i put in the
> > spotlight source : 'color Red * 1' i don't see the light on the internal bars
> > but if i put (for example) 'color Red * 200' i see the red line on the internal
> > bars.
>
> your light source, bars and projection object all end on x = 0,
> this coincidence is likely to get you into numerical issues. Also,
> at a grazing angle diffuse illumination is close to 0 but becomes
> visible if you boost the light power by 200.
Hi Christian i have another question , I insert in my scene a mirror and i noted
that if i leave a spotlight source the reflection (on a cylinder that i put in a
scene) doesn't work. Instead if i put a normal source light the reflection works
correctly. I think this is due on the settings on a spotlight to falloff and
tightness to 0. But i need this setting as you suggested me in the previus post.
There is a way to leave falloff and tightness to 0 so that also the reflection
work correctly? I posted a code. ( i commented spotlight now). Thanks a lot.
#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"
#include "metals.inc"
#include "glass.inc"
#include "woods.inc"
#include "stones.inc"
declare rapportoAngoloApertura= 0.54;
global_settings {
assumed_gamma 1
max_trace_level 15
photons {
spacing 0.025
count 18000000
max_trace_level 15
}
}
// camera look of reflection of mirror
camera {
//orthographic
location <15.0, 50.0,120.0>
look_at <15.0, 10.0, 40.0>
blur_samples 50
}
// projector
declare a= 1;
declare b=rapportoAngoloApertura;
declare Projector = prism {
linear_spline
3, 3.002, 4,
//funzia riflessione 3, 3.1, 4,
<0,0>, <-a,b>,<a,b>, <0,0> //outer rim
texture{ pigment{ color Green } }
}
light_source{ <0,3.001,-0.2>
color Red *250
// if i put spotlight the reflection of mirror doesn't work...
/*spotlight
radius 80
falloff 0
tightness 0
point_at <0, 3.015, 2>
photons {refraction off reflection on} */
projected_through { Projector }
//shadowless
} //end of light_source
//mirror
prism {
cubic_spline
1,
5,
56,
<-48.500000, 16.500000>, //punto di controllo
<-48.500000, 16.500000>,
<-46.956445, 17.531168>,
<-45.574971, 18.461886>,
<-44.333273, 19.305708>,
<-43.212883, 20.073862>,
<-42.198386, 20.775732>,
<-41.276812, 21.419218>,
<-40.440374, 22.008760>,
<-39.675929, 22.552711>,
<-38.975541, 23.055922>,
<-38.332364, 23.522584>,
<-37.740461, 23.956339>,
<-37.194656, 24.360364>,
<-36.692357, 24.735995>,
<-36.227347, 25.087338>,
<-35.796160, 25.416532>,
<-35.395729, 25.725477>,
<-35.023326, 26.015864>,
<-34.676523, 26.289204>,
<-34.354393, 26.545856>,
<-34.053565, 26.788154>,
<-33.772312, 27.017183>,
<-33.509077, 27.233921>,
<-33.262452, 27.439254>,
<-33.031164, 27.633989>,
<-32.814897, 27.818141>,
<-32.611649, 27.993177>,
<-32.420477, 28.159700>,
<-32.240518, 28.318264>,
<-32.070983, 28.469375>,
<-31.911149, 28.613501>,
<-31.760940, 28.750536>,
<-31.619089, 28.881467>,
<-31.485045, 29.006654>,
<-31.358299, 29.126432>,
<-31.238379, 29.241112>,
<-31.124852, 29.350982>,
<-31.017735, 29.455897>,
<-30.916190, 29.556557>,
<-30.819875, 29.653190>,
<-30.728477, 29.746009>,
<-30.641700, 29.835213>,
<-30.559273, 29.920990>,
<-30.481245, 30.003190>,
<-30.407043, 30.082329>,
<-30.336448, 30.158556>,
<-30.269257, 30.232014>,
<-30.205279, 30.302836>,
<-30.144337, 30.371148>,
<-30.086491, 30.436809>,
<-30.031336, 30.500210>,
<-29.978726, 30.561454>,
<-29.928528, 30.620638>,
<-48.500000, 16.500000>,
<-29.928528, 30.620638> // punto di controllo
texture {Chrome_Metal}
finish { reflection 1 metallic 1.0 diffuse 0 conserve_energy}
translate z*27
translate x*3
photons {
target
reflection on
}
}
Projector
// cylinder for test reflection
cylinder {
5 // raggio
//open // elimina le facce piane
texture { T_Stone25 }
//pigment { Green }
translate x*-10
translate z*8
}
Post a reply to this message
|
|