POVMAN

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

Monday, July 03, 2006

Roofing Tiles

I was after a pattern to represent roof tiles. I've tried the cells pattern before but is was never quite what it wanted. Here's what I came up with...

#include "colors.inc"
camera { location <15,20,-30> look_at <0,0,0>}
light_source{<-50, 100, -50>color White}
background { color <0.25,0.35,0.80> }
#declare myPatt = function(x,y,z){(y - int(y)) - (int(x)/2)};
box{<-10,-10,-10>,<10,10,10>
rotate <45,0,0>
texture {
pigment { function {myPatt(x,y,z)} pigment_map{[0 White][1 Black]}} scale 2 translate <10,0,0>}
}

Friday, June 16, 2006

Pigment Pattern Isosurface

I was looking through the "functions.inc" file the other night when I noticed that a function can be based on a evaluating a pigment. I knew you could create a pigment based on the object pattern, so...

I thought it might be possible to create an isosurface that evaluates an object pattern pigment.

A quick question on the news groups and the kind people there told me it would be possible but slow.

So I can now build a complex CSG shape, put it in an object pattern pigment, put that in a function and have an isosurface built to my specs.

But!, you ask , why would you do that if it's slow and you have already buit the shape in CSG? The answer is that I could add noise to the pattern. This might work well for a weathered statue. So I'll be giving this a try in the next couple of days, and let you know how it turns out.

Wednesday, June 14, 2006

Clipping

Interesting side affect of using the "clipped_by". I had an object thatwas made up of a Cylinder and two spheres, I wanted to chop off the front edge, and on a whim I decided to use the "clipped_by / bounded_by" method discussed in the manual.

Rather than just shearing the front of the object as I expected it cut the object open, exposing the interior of the shape.

The more normal method of using a "difference" does not expose the inside.

This might be worth experimenting with!

Friday, June 09, 2006

Aspect Ratio

A Little known ( or at least little used ) feature of the camera is the Aspect ratio. I've used this in the past when I've rendered a non-standard size image. If you make and extra wide image you have to widen the aspect ratio or the image gets deformed.

Anyway, last night I actually used the aspect ratio to create an effect rather than avoid one.

I placed the camera close to the nose of a sheep. By playing with the aspect ratio I was able to get one of these "HUGE NOSE" shots you sometimes see on TV. There are other ways to get the same effect by changing the camera type for instance. However as POV-Ray is an ongoing learning experience every idea is a new arrow for your bow.

To change the aspet ratio, include the "up" and "right" settings in your camera block.

up <0,1,0> right <1,0,0>

Friday, June 02, 2006

Clouds Macro

I'm currently working on a macro to produce clouds. It s not finished yet so I cant post anything but you might find the principal interesting.

Currently I pass the macro a Size,Count, Samples,Seed and Flat-Bottom parameters.

Size is the length of the side of a box in which the could will appear ( the macro returns a box with a cloud in it).

Count is used to produce a blob made with a number of spheres equal to the count. This Blob is then used in an object pattern media statement in the box.

Samples is the number of samples used by the media.

Seed is the random seed value used by macro to place blob elements.

Flat-Bottom if true, is used used to move most of the blob spheres in the bottom third of the box, upwards, in effect flattening the bottom of the cloud.

Overall its going quite well. But sadly as media takes so long to render the macro is going to take a lot of effort to perfect. I will post it when finished.

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.