POV-Ray : Newsgroups : povray.newusers : creating irregular surfaces : Re: creating irregular surfaces Server Time
30 Jul 2024 10:22:16 EDT (-0400)
  Re: creating irregular surfaces  
From: Hughes, B 
Date: 29 Jun 2004 00:58:01
Message: <40e0f6d9$1@news.povray.org>
"Martin" <1@1.1> wrote in message news:40e0dd80$1@news.povray.org...
> Hi, im trying work out to make good irregular surfaces on objects (that
> will show on both the object and the objects shadow). From the searching
> that i have done so far is that it seems that an isosurface might do
> what i am after. Basically i want to create a rough surface like you
> would find on the road.
>
> I have read a little on isosurfaces but im am unsure how to apply it to
> an object.

Well, the object needs to be the isosurface itself. Maybe a CSG
(intersection or difference) of the two, anyway.

Okay, I could be giving an incorrect or partial answer here but I think I'm
right enough to say that there are no surface deformations you can apply to
a predeclared object; unless you are working with something like mesh or
mesh2, or an isosurface to begin with, in which you could rearrange the
original surface.

Lets take your road idea:


#include "functions.inc"

isosurface {
  function {
  y // origin surface
  + // add the following function to it
  f_noise3d(x*5,y,z*5) // scale inversely by multiplying x,y and/or z
  *
  0.25 // effects amount of noise
  }
  contained_by {
    box { <-10,-1,-10>,<10,0,1000> } // maximum, or desired, dimensions
  }
  max_gradient 2
  pigment { color rgb 0.5 }
  finish { specular 0.1 roughness 0.1 }
}

camera { location <0,10,-1> look_at <0,5,10> }

light_source { <-100,100,-100>, color rgb <1,1,1> }

/* for round objects (rocks) you'd want to use x*x+y*y+z*z instead of y for
the origin surface, as well as a sphere {0,1} instead of a box */

-- 
Bob H.
http://www.3digitaleyes.com


Post a reply to this message

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