#include "colors.inc"
#include "metals.inc"
#include "glass.inc"
//相机
//这个位置车子刚好落在草地上了
camera {
location <20,2.0,-5>
direction z*1.5
right x*image_width/image_height
look_at <0.5,6,2.5>
}
//设置背景
//作为蓝色的天空
background { color SkyBlue }
//草地
plane {
y, -1.0
texture {
pigment {
color rgb<0.0,1.0,0.0>*0.8
}
normal {
bumps 1.25
scale 0.015
}
}
}
//为天空添加云彩
sphere {
<0, 0, 0>, 4000
hollow
texture{
pigment{
bozo turbulence 0.75
color_map {
[0.0 color rgb <0.95, 0.95, 0.95>]
[0.05 color rgb <1, 1, 1>]
[0.15 color rgb <0.85, 0.85, 0.85>]
[0.55 color rgbt <1, 1, 1, 1>]
[1.0 color rgbt <1, 1, 1, 1>]
}
scale 0.25 * 4000
}
finish {ambient 1 diffuse 0}
}
}
//阳光
//全局光照明
#macro GammaColor(COLOR,G,L)
rgb <pow(COLOR.red,G),pow(COLOR.green,G),pow(COLOR.blue,G)>*L
#end
#declare C_Sun = GammaColor(<255,255,255>/0.5,0.5,0.5);
#declare posSun=vaxis_rotate(vaxis_rotate(-z*10000,x,60),y,79);
light_source {
posSun
C_Sun*10//很强烈的白光
}
//申明彩虹的颜色
#declare r_violet1 = color rgbf<1.0, 0.5, 1.0, 1.0>;
#declare r_violet2 = color rgbf<1.0, 0.5, 1.0, 0.8>;
#declare r_indigo = color rgbf<0.5, 0.5, 1.0, 0.8>;
#declare r_blue = color rgbf<0.2, 0.2, 1.0, 0.8>;
#declare r_cyan = color rgbf<0.2, 1.0, 1.0, 0.8>;
#declare r_green = color rgbf<0.2, 1.0, 0.2, 0.8>;
#declare r_yellow = color rgbf<1.0, 1.0, 0.2, 0.8>;
#declare r_orange = color rgbf<1.0, 0.5, 0.2, 0.8>;
#declare r_red1 = color rgbf<1.0, 0.2, 0.2, 0.8>;
#declare r_red2 = color rgbf<1.0, 0.2, 0.2, 1.0>;
//创建彩虹
rainbow {
angle 42.5
width 5
distance 1.0e7
direction <-0.2, -0.2, 1>
jitter 0.01
color_map {
[0.000 color r_violet1]
[0.100 color r_violet2]
[0.214 color r_indigo]
[0.328 color r_blue]
[0.442 color r_cyan]
[0.556 color r_green]
[0.670 color r_yellow]
[0.784 color r_orange]
[0.900 color r_red1]
}
}
//车上部
box{
<-0.6,0.5,0.3>,
<0.6,0.7,-0.3>
texture{
pigment{color Red}
}
}
//车中部
box{
<-0.6,0.3,0.9>,
<0.6,0.5,-0.9>
texture{
pigment{color Red}
}
}
//车顶弯曲
cylinder{
<-0.6,0.5,0.3>,
<0.6,0.5,0.3>,
0.2
texture {pigment{color Red}}
}
//后面部分
cylinder{
<-0.6,0.5,-0.3>,
<0.6,0.5,-0.3>,
0.2
texture {pigment{color Red}}
}
//车灯
box{
<0.3,0.35,0.92>
<0.5,0.4,0.9>
material{
texture{
pigment{color rgbf<0.98,1.0,0.99,0.75>
//color rgbf<0.95,1,0,0.88>
}
finish{F_Glass4}
}
interior {I_Glass caustics 1}
}
}
box{
<-0.3,0.35,0.92>
<-0.5,0.4,0.9>
material{
texture{
pigment{color rgbf<0.98,1.0,0.99,0.75>}
finish{F_Glass4}
}
interior {I_Glass caustics 1}
}
}
box{
<0.3,0.35,-0.92>
<0.5,0.4,-0.9>
material{
texture{
pigment{color rgbf<0.98,1.0,0.99,0.75>}
finish{F_Glass4}
}
interior {I_Glass caustics 1}
}
}
box{
<-0.3,0.35,-0.92>
<-0.5,0.4,-0.9>
material{
texture{
pigment{color rgbf<0.98,1.0,0.99,0.75>}
finish{F_Glass4}
}
interior {I_Glass caustics 1}
}
}
//四个轮胎
cylinder{
<0.55,0.3,0.7>,
<0.45,0.3,0.7>,
0.1
texture {pigment{color Black}}
}
cylinder{
<0.55,0.3,-0.7>,
<0.45,0.3,-0.7>,
0.1
texture {pigment{color Black}}
}
cylinder{
<-0.55,0.3,0.7>,
<-0.45,0.3,0.7>,
0.1
texture {pigment{color Black}}
}
cylinder{
<-0.55,0.3,-0.7>,
<-0.45,0.3,-0.7>,
0.1
texture {pigment{color Black}}
}
//再加入一个光照
//让车子侧面看起来亮一些
light_source{
<2,4,-3> color White
}