POV-Ray : Newsgroups : povray.advanced-users : Isosurface CSG Server Time
24 Nov 2024 23:57:21 EST (-0500)
  Isosurface CSG (Message 1 to 2 of 2)  
From: pkowal
Subject: Isosurface CSG
Date: 3 Sep 2004 06:30:00
Message: <web.41384769856e2e9f486f61060@news.povray.org>
//I don't know why adding noise to isosurface csg object tears it apart.
//There's a simple example:

#include "functions.inc"

camera {
  location  <0, 0, -3.0>
  up <0, 1, 0>
  right <4/3, 0, 0>
  look_at <0, 0,  0>
}

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

isosurface {
 function {
  min(
   max((x*x+y*y+z*z)-1, -y),
   max((x*x+y*y+z*z)-1, y)
  )+f_noise3d(x,y,z)
 }
 contained_by { sphere { 0, 2.0 } }
 max_gradient 3
 pigment { color rgb<1, 1, 0> }
 translate <0.9, 0, 0>
}

isosurface {
 function {
  (x*x+y*y+z*z)-1+f_noise3d(x,y,z)
 }
 contained_by { sphere { 0, 2.0 } }
 max_gradient 3
 pigment { color rgb<1, 0, 0> }
 translate <-0.9, 0, 0>
}

// Any ideas?
// Thanks for help.
// Pawel


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Isosurface CSG
Date: 3 Sep 2004 17:08:40
Message: <4138dd58$1@news.povray.org>
pkowal wrote:

> //I don't know why adding noise to isosurface csg object tears it apart.
...

Because you added too much noise.
Try the code below.

Tor Olav

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version 3.6;

#include "functions.inc"
#include "colors.inc"

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

isosurface {
   function {
     min(
       max(x*x + y*y + z*z - 1, -y),
       max(x*x + y*y + z*z - 1,  y)
     ) +
     0.2*f_noise3d(10*x, 40*y, 10*z)
   }
   contained_by { sphere { <0, 0, 0>, 2 } }
   max_gradient 3
   pigment { color Yellow }
   translate 0.9*x
}

isosurface {
   function {
     x*x + y*y + z*z - 1 +
     f_noise3d(
       30*x*f_noise3d(10 + 2*x, 6*y, 2*z),
       y,
       20*z*f_noise3d(4*x, 3*y, 10 + 4*z)
     )*0.3
   }
   contained_by { sphere { <0, 0, 0>, 2 } }
   max_gradient 10
   pigment { color Red }
   translate -0.9*x
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

camera {
   location -4*z
   look_at 0*y
}

light_source { <-1,  1, -1>*100 color White*1.5 }

light_source { < 1, -1, -1>*100 color White*0.4 }

background { color rgb <0.5, 0.5, 0.6> }

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7


Post a reply to this message

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