|
![](/i/fill.gif) |
This image was inspired by one that I found on this board at some point. I
liked the concept and decided to try my own take. I can't find the
original now though. If anyone has a reference, I'd appreciate it. This
uses the Makegrass macro by Gilles Tran.
#version 3.6;
#include "mgrass.pov"
#include "functions.inc"
#declare fast=false;
#ifndef (fast)
#declare fast=true;
#end
//#declare cam=0;
#ifndef (cam)
#declare cam=1;
#end
// ----------------------------------------
#default {
texture {
pigment {
color rgb 1
}
finish {
ambient 0
diffuse 1
}
}
}
global_settings {
assumed_gamma 1.0
}
// ----------------------------------------
#switch (cam)
#case (0)
camera {
location <3.0, 0.0, -2.0>
direction 1.5*z
right x*image_width/image_height
look_at <0.0, 0.0, 0.0>
}
#break
#case (1)
camera {
location <1.0, 0.0, -4.0>
direction 1.5*z
right x*image_width/image_height
look_at <0.0, 0.0, 0.0>
}
#break
#case (2)
camera {
location <2.0, 0.0, 2.0>
direction 1.5*z
right x*image_width/image_height
look_at <0.0, 0.0, 0.0>
}
light_source {
<0, 0, 2>
color rgb 0.5
}
#break
#end
// ----------------------------------------
#if (!fast)
light_source {
<0, 0, 50>
color rgb 0.5
shadowless
}
sphere {
0.0, 100
no_shadow
}
#end
// ----------------------------------------
light_source {
<1, 1, -1.5>
color rgb 0.75
fade_distance 4.5
fade_power 2
#if (!fast)
area_light
<1, 0, 0>
<0, 1, 0>
5
5
jitter
adaptive 1
#end
}
light_source {
<-1, -5, -10>
color rgb 0.25
fade_distance 10
fade_power 2
#if (!fast)
area_light
<1, 0, 0>
<0, 1, 0>
5
5
jitter
adaptive 1
#end
}
sphere {
0.0, 1
no_shadow
texture {
pigment {
color rgb <0.0, 0.2, 0.0>
}
}
}
// ----------------------------------------
#if (!fast)
union {
// --------------------------------------
// Patch parameters
// --------------------------------------
// Final number of triangles = nBlade x nBlade x segBlade x 2 (or 4 if
dofold = true)
// --------------------------------------
#declare lPatch=50; // size of patch
#declare nBlade=10; // number of blades per line (there will
be nBlade x nBlade blades)
#declare ryBlade = 0; // initial y rotation of blade
#declare segBlade= 15; // number of blade segments
#declare lBlade = 25; // length of blade
#declare wBlade = 1; // width of blade at start
#declare wBladeEnd = 0.3; // width of blade at the end
#declare doSmooth=true; // true makes smooth triangles
#declare startBend = <0,1,0.3>; // bending of blade at start (<0,1,0>=no
bending)
#declare vBend = <0,-0.5,0>; // force bending the blade (<0,1,1> =
#declare pwBend = 3; // bending power (how slowly the curve
bends)
#declare rd = 459; // seed
#declare stdposBlade = 1; // standard deviation of blade position
0..1
#declare stdrotBlade = 360; // standard deviation of rotation
#declare stdBlade = 1.2; // standard deviation of blade scale;
#declare stdBend = 2; // standard deviation of blade bending;
#declare dofold = false; // true creates a central fold in the
blade (twice more triangles)
#declare dofile = false; // true creates a mesh file
#declare fname = "fgrass1.inc" // name of the mesh file to create
#declare grass = object { MakeGrassPatch( lPatch, nBlade, ryBlade, segBlade,
lBlade, wBlade, wBladeEnd, doSmooth, startBend, vBend, pwBend, rd,
stdposBlade, stdrotBlade, stdBlade, stdBend, dofold, dofile, fname) };
#declare R = seed(642);
#declare clump = 0;
#declare clumps = 4000;
#while (clump < clumps )
object {
grass
rotate <0, 180*rand(R), 0>
scale <0.002, 0.005*rand(R), 0.002>
translate <0, 1, 0>
rotate <-180*rand(R), 90-180*rand(R), 0>
}
#declare clump = clump+1;
#end
pigment { color rgb <0.0, 0.2, 0.0> }
}
#end
// ----------------------------------------
union {
#declare post=
cylinder {
<0, 0, 0>
<0, 1, 0>
1
scale <.0123, 0.3, .0123>
}
#declare rail =
union {
sphere {
<0, 0.1, 0>
0.005
}
sphere {
<0, 0.2, 0>
0.005
}
}
#if (!fast)
#declare total_railing = 10000;
#declare total_posts = 75;
#else
#declare total_railing = 500;
#declare total_posts = 10;
#end
#declare rails_per_post = int(total_railing / total_posts);
#declare ang = 0;
#declare dAng = 360/total_railing;
#declare cur_rail = 1;
#while (cur_rail <= total_railing)
#declare add_post = mod(cur_rail, rails_per_post);
#if (add_post = 0)
object {
post
translate <0, 1, 0>
rotate <90+45*(sin(0.1*ang)*sin(0.04*ang)*cos(0.01*ang)), ang, 0>
}
#end
object {
rail
translate <0, 1, 0>
rotate <90+45*(sin(0.1*ang)*sin(0.04*ang)*cos(0.01*ang)), ang, 0>
}
#declare ang = ang+dAng;
#declare cur_rail = cur_rail+1;
#end
}
// ----------------------------------------
#declare sheep =
union {
sphere {
<0, .1, 0>
.1
scale <1, 1, 1.5>
}
sphere {
<.05, 0, -.07>
.05
}
sphere {
<-.05, 0, -.07>
.05
}
sphere {
<.05, 0, .07>
.05
}
sphere {
<-.05, 0, .07>
.05
}
sphere {
<0, 0, 0>
.07
scale <1, 1, 1.4>
rotate <-30, 0, 0>
translate <0, .2, -.15>
}
sphere {
<0, .1, .15>
.02
}
}
#declare headless_sheep =
union {
sphere {
<0, .1, 0>
.1
scale <1, 1, 1.5>
}
sphere {
<.05, 0, -.07>
.05
}
sphere {
<-.05, 0, -.07>
.05
}
sphere {
<.05, 0, .07>
.05
}
sphere {
<-.05, 0, .07>
.05
}
sphere {
<0, .1, .15>
.02
}
}
#declare sheep_head =
sphere {
<0, 0, 0>
.07
scale <1, 1, 1.4>
rotate <-30, 0, 0>
translate <0, .2, -.15>
}
object {
sheep
rotate <0, 40, 0>
translate <0, 1, 0>
rotate <-83, 4, 0>
}
object {
sheep
rotate <0, -120, 0>
translate <0, 1, 0>
rotate <-100, -50, 0>
}
object {
sheep
rotate <0, 110, 0>
translate <0, 1, 0>
rotate <-83, -129, 0>
}
union{
object {
headless_sheep
}
object {
sheep_head
translate <0, -.2, .15>
rotate <60, 0, 0>
translate <0, .2, -.15>
}
rotate <0, 130, 0>
translate <0, 1, 0>
rotate <-60, -40, 0>
pigment { color rgb .01 }
}
Post a reply to this message
Attachments:
Download 'sheep1.jpg' (146 KB)
Preview of image 'sheep1.jpg'
![sheep1.jpg](/povray.binaries.images/attachment/%3Cweb.456c9d7cb7f06341bc81efaa0%40news.povray.org%3E/sheep1.jpg?ttop=443866&toff=4100&preview=1)
|
![](/i/fill.gif) |