POV-Ray : Newsgroups : povray.binaries.images : New attempt at a cratered asteroid : Re: New attempt at a cratered asteroid Server Time
5 Nov 2024 18:27:05 EST (-0500)
  Re: New attempt at a cratered asteroid  
From: Mark Birch
Date: 25 Jun 2006 22:15:00
Message: <web.449f4297559e4b454daddc090@news.povray.org>
Thought I'd have a go at this one...

// Asteroid
#version 3.6;
// ==============================================================
#default{finish{ambient 0}}
#global_settings{assumed_gamma 1.0 max_trace_level 5}

#declare f_bozo1 = // similar to noise3d
function{pigment{bozo scale 0.5 color_map{[0 color rgb 0] [1 color rgb 1]}}}

#declare f_craters =
function{
  pigment{
    crackle form <1.2, 0, 0> // never really played with this one, thaks
Yadgar!
    scale 0.3
    color_map{
      [0.00 color rgb 1.00] // centre of crater, lowest part
      [0.30 color rgb 0.80] //
      [0.35 color rgb 0.40] // rim, higher than surrounding area
      [0.40 color rgb 0.5] // level of area outside the crater
      [1.00 color rgb 0.5]
    }
  }
}

/*
the f_craters function is subtracted from the basic asteroid shape, so the
lowest points get the highest numbers, since you are subtracting more.
*/

// --------------------------------------------------------------
isosurface{
  function{
    (x*x)+(y*y*1.8)+(z*z*1.5)-1 // basic sphere function, scaled to be more
elliptical
    +f_bozo1(x,y,z).red*0.35 // deforms the ellipse shape
    +f_craters(x,y,z).red*0.05 // adjust the '*0.05' part to change the
depth of the craters
  }
  contained_by{box{<-1, -1, -1>, <1, 1, 1>}}
  threshold 0
  accuracy 0.001
  max_gradient 4
  texture{pigment{color rgb 1} finish{diffuse 0.6}}
}

light_source{<-10, 10, -5> color rgb 1}
light_source{< 10, -10, -5> color rgb<0.2, 0.4, 1.0>*0.25}

camera{
  location <0, 1, -4>
  up y*(image_height/image_width)
  right x
  sky y
  look_at <0, 0, 0>
  angle 36
}
// -------------------------------------------------- end of file


Post a reply to this message


Attachments:
Download 'asteroid.jpg' (6 KB)

Preview of image 'asteroid.jpg'
asteroid.jpg


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.