POV-Ray : Newsgroups : povray.general : Feature request (spherize?) : Re: Feature request (spherize?) Server Time
11 Aug 2024 19:37:07 EDT (-0400)
  Re: Feature request (spherize?)  
From: Nieminen Mika
Date: 17 May 1999 08:18:34
Message: <373ffb0a.0@news.povray.org>
Rune S. Johansen <run### [at] get2netdk> wrote:
: I would like to see a new new keyword in POV-Ray

  Many people would like too... :)

: If the keyword was spherize [float] the following:
: box {
:    <-1,-1,-1>, <+1,+1,+1>
:    spherize 1.5
: }
: should make a rounded box from <-2.5,-2.5,-2.5> to <+2.5,+2.5,+2.5>.

: It should sort of extrude any shape in a spherical way so things get bigger
: and rounded.

  You have to first understand how povray works before you can understand
how easy/difficult this kind of transformation is.
  It's a fact that povray can only make linear transformations to objects.
The reason is the following:
  When povray calculates a transformation, it doesn't actually transform
the object but the ray which hits the object. For example, if you scale
the object twice of its original size, the inverse transformation as actually
applied to the rays, ie. they are scaled to be twice as small as usual.
  Why this way? Because objects are only mathemathical entities, not
physical polygons (perhaps triangle meshes are an exception). Raytracing
a sphere means actually calculating the intersection between a line and a
spherical surface (which is only a mathematical formula). Transforming the
mathematical surface would be a pain, but transforming the line is extremely
easy.
  A ray is a straight line. Linear transformation means that after the
transformation the ray is still a straight line.
  Non-linear transformation means that after the transformation the line
is not straight anymore, but curved. Calculating the intersection between
a mathematical surface and a curve is extremely difficult (in many cases
it's impossible without a slow approximation method).

  What you are suggesting here looks a lot like a non-linear transformation.

  People often think that there should be no problems with non-linear
transformations because they work so well in programs like 3D-studio. They
forget that those programs work with polygons and that those transformations
are made to the polygons themselves. You can't make those transformations
to mathematical formulas (well, actually it may be possible in some cases,
but it would be a pain).
  They also forget that it's the modeller who is making the transformation,
not the renderer. Povray is just a renderer, not a modeller.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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