POV-Ray : Newsgroups : povray.general : The copious free time of the POV-Ray group : Re: The copious free time of the POV-Ray group Server Time
11 Aug 2024 15:17:42 EDT (-0400)
  Re: The copious free time of the POV-Ray group  
From: Alexander Enzmann
Date: 1 Jul 1999 11:02:18
Message: <377B82D9.9C9D63C7@mitre.org>
Twyst wrote:
> 
> Matt Giwer <mgi### [at] giwersworldorg> wrote in message
> news:377969C4.90D5C3EE@giwersworld.org...
> > > See the thread below from this group about this subject. It was
> discussed
> > > in some detail.
> > >
> > >     Subject:  Check this out!!!
> > >        Date:  Mon, 22 Feb 1999 22:44:26 -0500
> > >        From:  Anthony Bennett <ben### [at] panamaphoenixnet>
> > >  Newsgroups: povray.general
> >
> > Thanks, the wheel has been rediscovered.
> >
> > So what is needed is the equation for the intersection of a line
> > and this thing. That should be the same as for the intersection
> > of a line and a common torus simply extended for n not equal to
> > 2. I'll put looking into that on my to do stack.
> 
> Actually, I was looking into this last night. I have some basic pov code -
> but be warned, it DOES NOT work properly.  depending on the values, it only
> shows quarter of a torus, due to degenerate triangles. (warning! do NOT put
> spheres at the vertices for values that give you degen. triangles. That's a
> REALLY good way to lock up Pov. )
> 
> The code that I have is here: http://24.108.7.134/supertoroid.pov
> 
> Also, looking into the pov code, the torii that are used in pov are actually
> 4th order polys, so modifying that isn't as easy as you would think.
> 
> I even thought of adding another keyword to the torus code.....

Note: a buch of interesting information on the toriodal variant of the
superquadric appeared in one of the Graphics Gems books.

Unlike the normal torus, you won't find an exact (general) solution for
the intersection of a ray with the surface.  This thing is way worse
than an three variable polynomial with integral powers.

For someone with time on their hands, what you need to do is to follow
the example of what I did in the superquadric code.  Chop the surface
into octants, find intersections with the bounding box+planes that
chopped it, then do a N-R solution.

The difficulty with this particular surface is that it doesn't guarantee
just one solution per octant.  Even worse, there is no simple way to
slice the octant to make that happen (yes, I thought about this one a
few years back and didn't think it was worth the time).

I suppose an interval arithmetic approach would work pretty well, but
that requires adding quite a bit of code.

Triangles are probably best here...

Xander


Post a reply to this message

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