среда, 30 сентября 2009 г.

Практика POV-Ray

POV-Ray - графический инструмент построения 3д сцен. Был разработан лет 30 назад, весит 12 мг, но позволяет очень много. Завлекла идея программировать картинки.

Убил 2 часа времени на ЭТО:



Update И еще 30 минут на доделку:




#include "colors.inc"
#include "textures.inc"

camera {
location <5, 13, -40>
look_at <0, 0, -5>
angle 48
}

#declare Steel = texture {
pigment { color rgb < 0.450, 0.450, 0.450> }
finish {
ambient 0.20
diffuse 0.75
brilliance 1.00
phong 0.70
phong_size 10.00
metallic
}
}

#declare Fire = texture {
pigment { color rgb < 0, 0, 1> }
finish {
ambient 0.5
diffuse 0.5
}
}

#declare Energy = texture {
pigment { color rgb < 1, 0, 0> }
finish {
ambient 0.5
diffuse 0.5
}
}


//Halo
cylinder {
<0, 1, 0>
<0, 0, 0>
7
texture { Steel }
}

//Body
union {
cylinder {
<0, -3, -12>
<0, -3, -3.5>
1
texture { Steel }
}

sphere {
<0, -3, -3.5>, 1
texture { Steel }
}

sphere {
<0, -3, -12>, 1
texture { Steel }
}
}

//Left gandola
cylinder {
<-2, -0.5, -13>
<-2, -0.5, -8>
0.5
texture { Steel }
}

//Left Fire
cone {
<-2, -0.5, -25>, 0.1
<-2, -0.5, -13>, 0.4
texture { Fire }
}

//Left energy indicator
cone {
<-2, -0.5, -7>, 0.4
<-2, -0.5, -8>, 0.5
texture { Energy }
}

//Right gandola
cylinder {
<2, -0.5, -13>
<2, -0.5, -8>
0.5
texture { Steel }
}

//Right Fire
cone {
<2, -0.5, -25>, 0.1
<2, -0.5, -13>, 0.4
texture { Fire }
}

//Right energy indicator
cone {
<2, -0.5, -7>, 0.4
<2, -0.5, -8>, 0.5
texture { Energy }
}

//Bridge
cone {
<0, 1, 0>, 2.5
<0, 1.2, 0>, 2
texture { Steel }
}

//Halo ferm
mesh {
triangle {
<-0.2, -3, -8>, <-0.2, -3, -4>, <-0.2, 0, -2>
texture { Steel }
}
triangle {
<0.2, -3, -8>, <0.2, -3, -4>, <0.2, 0, -2>
texture { Steel }
}
triangle {
<0.2, -3, -4>, <-0.2, -3, -4>, <-0.2, 0, -2>
texture { Steel }
}
triangle {
<-0.2, 0, -2>, <0.2, 0, -2>, <0.2, -3, -4>
texture { Steel }
}

triangle {
<-0.2, 0, -2>, <-0.2, 0, -4>, <-0.2, -3, -8>
texture { Steel }
}
triangle {
<0.2, 0, -2>, <0.2, 0, -4>, <0.2, -3, -8>
texture { Steel }
}
triangle {
<0.2, 0, -4>, <-0.2, 0, -4>, <-0.2, -3, -8>
texture { Steel }
}
triangle {
<0.2, -3, -8>, <-0.2, -3, -8>, <0.2, 0, -4>
texture { Steel }
}

}

//Left gandola ferm
prism {
linear_sweep
linear_spline
4,4.3,7,
<0,0>, <3,6>, <0,9>, <-6,9>, <-3, 6>, <-9,0>, <0,0>
texture { Steel }
rotate <-45,-90,0>
scale 0.3
translate <-1, -4, -9.3>
}

//Right gandola ferm
prism {
linear_sweep
linear_spline
4,4.3,7,
<0,0>, <3,6>, <0,9>, <-6,9>, <-3, 6>, <-9,0>, <0,0>
texture { Steel }
rotate <-135,-90,0>
scale 0.3
translate <-1, -2, -9.3>
}


light_source {
<10, 30, -25>
color White
}

light_source {
<10, -30, -5>
color White
}



Думаю, если бы использовал OpenGL, это заняло бы столько же времени, но зато можно было бы заюзать этот объект скажем в игре... а так просто получилась тупая картинка...

1 комментарий:

Sultan Morozov комментирует...

Прикольно и почему же такие вещи все игнорируют?