POV-Ray : Newsgroups : povray.unofficial.patches : Math/formula assitance (isosurface) : Re: Math/formula assitance (isosurface) Server Time
2 Nov 2024 05:20:42 EDT (-0400)
  Re: Math/formula assitance (isosurface)  
From: Gilles Tran
Date: 12 Feb 2000 08:40:23
Message: <38A562DB.82D42F8@inapg.inra.fr>
TonyB wrote:

> How can I do this? The idea is that I bind the thing with box
> {-<R,H1,R>,<R,H2,R>}, so that it goes from square to circle. Perhaps, if
> there is a way, could someone explain how to "gradient" between other
> shapes? Say, a triangle or a star?

To "gradient" between shapes all just join the formulas like this :
f = f1*(1-y) + f2*y
so that the shape starts at f1 and ends at f2 when y goes from 0 to 1
(adapt to your own y values)
for instance :
isosurface {
  function {(abs(x)+abs(z))*(1-y)+(x^2+y^2+z^2)*y}
  contained_by {box {<-1,0,-1>,<1,1,1>}}
  eval
  sign 1
  threshold 1
  pigment{Red}
}

starts as a cube and ends as a sphere

G.


Post a reply to this message

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