POV-Ray : Newsgroups : povray.advanced-users : Superellipsoids not very efficient? : Re: Superellipsoids not very efficient? Server Time
28 Jul 2024 16:26:43 EDT (-0400)
  Re: Superellipsoids not very efficient?  
From: Mike Williams
Date: 8 Nov 2004 11:16:16
Message: <Q4$MSCAw82jBFwGf@econym.demon.co.uk>
Wasn't it Mike Thorn who wrote:
>There's not really a lot I can do about it because I'm not really
>a mathematical kind of person so using an isosurface is out of the
>question, but I'm just curious: is the superellipsoid really that
>inefficient of an object or is it just the fact that I have 1024 of them?

I nearly replied saying that the f_superellipsoid isosurface is much
slower than the superellipsoid object, but then I noticed that using a
single isosurface to generate 1024 small superellipsoids isn't much
slower than generating one large isosurface superellipsoid. That almost
put it into contention with 1024 small real superellipsoid objects. 

In the following code, "Roundness" is the same as the value that you
would use for superellipsoid{<Roundness,Roundness>}, and "Size"
specifies how many there are in each direction, so 32 gives 32*32=1024.
The top surface of the tiles is at y=0.

#declare Roundness = 0.05;
#declare Size = 32;

#include "functions.inc"

camera { location  <-1, 1, -4> look_at <0, 0.3, 0> angle 30}
background {rgb 01}
light_source {<-100,200,-100> colour rgb 1}

#declare F=function{- f_superellipsoid(x,y,z,Roundness,Roundness)}

isosurface {
  function {F(mod(abs(x*Size),2)-1,y+1,mod(abs(z*Size),2)-1)}
    max_gradient 21
    contained_by{box {<-1,-1/Size,-1><1,0,1>}}
    pigment {checker rgb 0.9, rgb 0.5 scale 2/Size}
    finish {phong 0.5 phong_size 10}
}

sphere {y*0.5, 0.5 pigment {rgb 0.2} finish{phong 1 reflection 0.8}}


Post a reply to this message

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