POVMAN

POV-Ray stuff from a part time POVver. Are you a POVMAN?

Tuesday, May 23, 2006

Tilting the Camera

POV-Ray by default tries to keep the camera level in the x-z plane, which keeps your images "upright". Well, in the image mentioned in the previous post I wanted a creepy camera angle so I deliberately tilted the camera.

camera { location <4,7,-35> rotate z*5
look_at <0,> }

There you are, nice and simple, a 5 degree tilt on the camera.

Monday, May 22, 2006

Fire

Well I've just posted my latest image in the news group that included lots of burning flames, look for "My Basement".

http://news.povray.org/povray.binaries.images/

These were done with media, and as media is such a P.I.T.A. I thought I'd post the code here with some info about what its doing. Hopefully anyone reading this will find it helpful.
difference {
sphere { <0,0,0>, 1 }
box { <4,0,4>, <-4,-4,-4> }
hollow
scale <2,20,2>
interior {
media {
intervals 5
samples 5
emission .6
density {
spherical
scale <3,20,3>
warp {
turbulence <.8,.07,.05>
}
density_map {
[0 rgb 0]
[.5 rgb 0]
[.6 rgb Orange]
[.7 color Yellow]
[.8 color Yellow]
[.9 color White]
[1 color White ]
}
}
}
}
texture {
pigment {
Clear
}
}
translate <0,5,0>
}

The Explanation.

I decided to create the burning flame inside a sphere, but as the flame is sitting in a dish in the final scene I used the difference to cut off the bottom of the sphere.

The Object has to be "hollow" to show the media.

The CSG is stretched vertically so that the flame can be tall. Note stretching the containing CSG will not effect the shape of the media!

Intervals and samples are set fairly low to speed rendering, increase these for final render. If you set these lower then the media becomes blocky, as if its made of layers. (YUK!)

emission is set to .6 so that the flames will be transparent, if set to 1 then the flame would appear solid.

The pattern dor the density is "spherical" basicly the overall shape I want is a stretched sphere so that from above the flame is round, and from the side, taller than it is wide.

The sphereical pattern is then stretched up and down to make the flame taller rather than a round ball.

The Warp is used to turbulate the pattern. Without this the media would appear as a perfect ball, that had been stretched by the scale statement above.

The density map is the trick. This defines the colors used in the flame. Density 1 represents the center of the pattern (sphere) and density 0 is outside the ball. Note here the useage of the "rgb 0", this is effectively no color, that is transparent. This is used to prevent the flames reaching the edge of the containg CSG. the flames would be cut off by the edge of CSG, so this needs to be prevented. Alternatively you could scale the pattern down.

Friday, May 12, 2006

Missile Source Code

I've recently donw a scene of a missile in flight. I've posted the SDL below, but knowing this Blog software it wont be formatted correctly, but there you go. You can get a better copy of the SDL over at the POV-Ray news groups, link on the right. There are a few interesting points I can raise about the resulting code, but I'll mention these in later posts ( if I remember )

To Note (note to self) my first ever use of light_group and object pattern media.

#include "colors.inc"
#include "glass.inc"
#include "stars.inc"
#include "shapes.inc"
#include "functions.inc"
#declare showFire = true;
#declare showSmoke = true;
camera {
// location <0,0,-25>// look_at <10,>
location <-40,-25,-25> look_at <0,>
// location <0,20,-1>// look_at <0,>
}
global_settings {max_trace_level 12 }
light_source { <-500, 2000, -500> color White
//area_light <50,0,0>,<0,0,50> 3,3
//jitter
//adaptive 1 media_interaction on media_attenuation on }
background { color <0.25,0.35,0.80> }
light_group {
union {
// sensor
box { <0,>, <-.1, -.2, -.2>
texture { pigment { leopard scale <20,.01,.01> pigment_map { [0 Orange*1.2] [.099 Orange*1.2] [.1 Black] [1 Black] } } finish { specular .1 roughness .001 ambient 0 } } } // glass sphere sphere { <0,0,0>,.4 scale <.7,1,1> interior{ ior 1.4 } texture { pigment { //Clear rgbt <0.858824,0.576471,0.439216,.9> } finish { specular .5 roughness .1 reflection { 0..5 } ambient 0 } } } // missile body union { cone { <0,0,0>,.5, <3,0,0>,1 } cylinder{ <3,0,0>, <9,0,0>,1 } cone { <9,0,0>,1, <13.5,0,0>,1.4 } cylinder{ <13.5,0,0>, <20,0,0>,1.4 } cone { <20,0,0>,1.4, <21.5,0,0>,1 } #declare r1 = 0; #while(r1 <>,<1,0>,<1,.8> rotate <-90,0,0> translate <4,1,0> rotate scale 1 } #declare r1 = r1 + 1; #end #declare r1 = 0; #while(r1 <>,<5,0>,<5.2,.8>,<4.9,1.8>,<2,1.8> rotate <-90,0,0> translate <14,1.4,0> rotate scale 1 } #declare r1 = r1 + 1; #end texture { pigment { White *1.5 }//*1.5 finish { specular .2 roughness 0.001 ambient 0 } normal { bumps scale .0001 bump_size .01 } } } translate <-21.5,0,0> rotate <30,0,0> }
#if(showSmoke = true)// smoke oject #declare pObject = union { cone { <2,0,0>,0, <15,0,0>,2 } cylinder{ <15,0,0>, <1000,0,0>,2 } };
//smoke trail cylinder { <2,0,0> <1000,0,0>, 4 hollow interior { media { intervals 5 //5 higher slows it up and gives smoother images samples 5 //5 lower = more blocky method 3 absorption 0.2 scattering { 1,color Gray25 extinction .4//1.2 //amount of above color subtracted as it passes through, darkens the cloud } density { pigment_pattern { object {pObject}} // pattern of the media warp { turbulence <.5,1,1> } color_map { [0 rgb 0] [.45 rgb 0] [.5 rgb 1] [1 rgb 1] } } } } texture { pigment { Clear } } }#end
#if(showFire = true)//jet exhaustdifference { sphere { <0,0,0>, 1 } box { <0,4,4>, <-4,-4,-4> } hollow scale <40,2,2> interior { media { intervals 5 //5 higher slows it up and gives smoother images samples 5 //5 lower = more blocky emission .3 //1 brightness of glowing media density { spherical scale <50,3,3> warp { turbulence <.8,.07,.05> } density_map { [0 rgb 0] [.6 rgb 0] [.7 color Yellow] [.8 color Yellow] [.9 color White] [1 color White] } } } } texture { pigment { Clear } } }
//cloud scape#end
light_source { <0,> color White*.1 media_interaction off media_attenuation on }global_lights on}// end of light_group

union { plane { y, 260 texture { finish {ambient 0 diffuse 0.7} pigment { bozo turbulence 1.00 translate 200*y color_map { [0.5, rgb 1 transmit 1.0] [1.0, rgb 1 transmit 0.6] } scale 0.125 } scale 1500 } } plane {y, 240} texture { finish {ambient 0 diffuse 0.7} pigment { bozo turbulence 0.35 translate 300*y color_map { [0.5, rgb 1 transmit 1.0] [0.8, rgb 1 transmit 0.5] } scale 10 warp {turbulence 0.7} scale 1/10 scale 0.125 } scale 2500 } texture { finish {ambient 0 diffuse 0.5} pigment { bozo turbulence 0.35 translate 400*y color_map { [0.5, rgb 1 transmit 1.0] [0.8, rgb 1 transmit 0.4] } scale 10 warp {turbulence 0.7} scale 1/10 scale 0.125 } scale 2500 } hollow double_illuminate //scale 1/200 no_shadow translate <0,0,100> rotate <40,0,-20>}
//end of scene


...just as I figured a disordered mess.

Monday, May 08, 2006

SOTW Released and SDL-Switch

Well, its here at last. Spaceship Of The Week has been released. I've posted the macros over in the POV-Ray news groups, and also a few samples. Although, thanks to A goof up with Outlook Express, I think I may well have posted the images twice, cane really be sure at this point.

An interesting point to note is I goofed at one point withan SDL Switch Statement and forgot to put a "#break" at the end of a "#range" statement and the code simple dropped straight through to the next "#range", meaning the code in both sections ran. I hadn't expected that!

Thats something I'll be using in future.