POV-Ray : Newsgroups : povray.binaries.images : Megpov: how to do a superelipse? Do we need x^p=sign(x)*|x|^p? : Re: Megpov: how to do a superelipse? Do we need x^p=sign(x)*|x|^p? Server Time
19 Aug 2024 06:24:01 EDT (-0400)
  Re: Megpov: how to do a superelipse? Do we need x^p=sign(x)*|x|^p?  
From: Chris Huff
Date: 4 Jan 2001 16:39:13
Message: <chrishuff-40AC94.16404504012001@news.povray.org>
In article <3A548297.54B63D54@my-dejanews.com>, 
gre### [at] my-dejanewscom wrote:

> > Uh, I think "x^n = pow(x, n)" is more likely...
> 
> And is that undefined for  negative x and noninteger n? 

It is defined as "x raised to the power of n", and works fine with 
negative x and fractional values of n.


> That would explain my missing quadrants on my superellipsoid. Will 
> try Tor's code, but have you any examples of working s-e's, too?

Not for parametrics...I never messed with them very much. I think your 
problem is more of a problem with the parametric shape than the function 
evaluation. For isosurfaces, I usually use something like:
function {Radius - sqrt(x^c1 + y^c2 + z^c3)}

Which isn't the same as the superellipsoid primitive, but works.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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