POV-Ray : Newsgroups : povray.general : Contour map -- plane vs. isosurface : Contour map -- plane vs. isosurface Server Time
30 Jul 2024 20:29:04 EDT (-0400)
  Contour map -- plane vs. isosurface  
From: How Camp
Date: 27 Jun 2008 08:50:00
Message: <web.4864e13d83231c9ec59235590@news.povray.org>
Back in 2000, Warp posted an interesting isosurface pigment to help someone
asking about contour maps:

http://news.povray.org/povray.advanced-users/thread/<3A2CEC7C.83FC2739@psu.edu>/

I've modified the code slightly, and am attempting to do something simple (I
think).  I'd like to create a contour pigment that can be applied to either an
isosurface (with results similar to Warp's) or to a plane where the contour
lines match up with the 3D gradient pattern.

I'm having trouble understanding how to correctly implement a non-gradient
pigment that can be applied to either the isosurface or the plane.  Surely I'm
making this way harder than it really is...?

My (incorrect) attempt to modify Warp's code looks like this:

-------

#version 3.6;
#include "functions.inc"

#declare f_isobar =
function { y-f_noise3d(x,y,z) }

#declare CMap =
color_map{
   [0.0 rgb <0, 0.0, 0.0>]
   [0.1 rgb <0, 0.0, 0.0>]
   [0.1 rgb <1, 0.7, 0.2>]
   [1.0 rgb <1, 0.7, 0.2>]
}

#declare PContour =
pigment
{
   gradient y
   color_map {CMap}
   scale <1, 1/4, 1>
}

#declare PContour2 =
pigment{
   function {f_isobar(x,y,z)}
   color_map {CMap}
   scale <1, 1/4,1>
 }

camera {location <0, 15, 0> look_at 0}
light_source {<50, 200, -100>, 1}

isosurface
{
  function { f_isobar(x,y,z) }
  contained_by {box {<-5,0,-5><5,1,5>}}
  scale <1,4,1>
  pigment {PContour}
  finish { specular .25 }
}

plane {y, 0.5 scale <1,4,1> pigment{PContour2} finish { specular .25 }}


Post a reply to this message

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