POV-Ray : Newsgroups : povray.text.scene-files : Isosurface egg revisited (also a tear!) Server Time
27 Dec 2024 04:13:51 EST (-0500)
  Isosurface egg revisited (also a tear!) (Message 1 to 1 of 1)  
From: Jerry Anning
Subject: Isosurface egg revisited (also a tear!)
Date: 29 Nov 1998 15:41:58
Message: <3661B1A8.E0913BF0@dhol.com>
Here is an updated version of the Isosurface egg code I recently
posted.  I turned it into a macro, added bounding, and parametrized it. 
For an egg, try parameters of 5 and 6.  For a tear, try 1.1 and 2.

// Begin POV code

// Isoegg.pov - an Isosurface egg shape

#version 3.1;

global_settings { assumed_gamma 1.0 ambient_light <.846, 1.041, 1.041> } 

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

light_source { <20, 50, -100> color rgb <1.103, .993, .772> }

#include "colors.inc"

#macro Fixcols(Badcol)
  color rgb <pow(Badcol.red, 2.2), pow(Badcol.green, 2.2),
pow(Badcol.blue, 2.2)>
  filter Badcol.filter transmit Badcol.transmit
#end

#macro Egg(A, B)
  #local C = (2 * A + 1) / (B * 2);
  isosurface
    {
      function { 1 - sqrt((x / ((A - y) / B)) * (x / ((A - y) / B)) +
                                     y        *            y        +
                          (z / ((A - y) / B)) * (z / ((A - y) / B))) }
        accuracy .0001
        max_trace 1
        bounded_by { box <-C , -1, -C>, <C, 1, C> }
        sign -1
        method 1
    }
#end

sky_sphere { pigment { Fixcols(CornflowerBlue) } }

object
  {
    Egg(1.1, 2)
    texture
      {
        pigment
          {
            Fixcols(BrightGold)
          }
        finish
          {
            specular 1
            roughness .0001
            metallic
            brilliance 3
          }
      }
    scale 5
  }

// End POV code

Jerry Anning
cle### [at] dholcom


Post a reply to this message

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