POV-Ray : Newsgroups : povray.text.scene-files : Onion Cube Isosurface Server Time
31 Oct 2024 14:12:00 EDT (-0400)
  Onion Cube Isosurface (Message 1 to 1 of 1)  
From: Ken
Subject: Onion Cube Isosurface
Date: 12 Dec 1999 08:20:16
Message: <3853A0B7.59A11861@pacbell.net>
An isosurface function demonstration that mimics the onion pattern
in POV-Ray.


#declare T = pi;
#declare A = pi;
  
#declare X =   A*sin(T)*(1-A*2)*(1/2);
#declare Y = 2*A*cos(T)*(1-A*2)*(1/2);
#declare Z = (-1+A)*(2+(A*2))*cos(T)*2;

#declare Onion_Cube =
   function { cos(5*(sqr(sqr(x)+sqr(y)+sqr(z)))) -
              sin(5*(sqr(sqr(X)+sqr(Y)+sqr(Z)))) }

// You can come close to the original with just this function -
// function { cos ( 5*( sqr ( sqr(x) + sqr(y) + sqr(z) ))) }

#declare Onion_Tex =
  texture {
   pigment { onion
    color_map {
                [.2 rgb<1,0,0>]
                [.4 rgb<0,0,1>]
                [.6 rgb<0,1,0>]
                [.8 rgb<1,1,0>]
              }
             }
           }

isosurface { function { Onion_Cube } threshold 0 accuracy 0.001
     texture { Onion_Tex 
        finish { ambient .35 diffuse .5
              }
            }
            rotate 45*y 
            rotate 45*-x
       }

-- 
Wishing you Seasons Greetings, A Merry Christmas, and A Happy New Year !
Ken Tyler -  1200+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

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