POV-Ray : Newsgroups : povray.binaries.images : explanation of a blob bug Server Time
1 Oct 2024 05:20:47 EDT (-0400)
  explanation of a blob bug (Message 1 to 2 of 2)  
From: J  Grimbert
Subject: explanation of a blob bug
Date: 6 Sep 2000 03:19:27
Message: <39B5F00C.ADAF0D6@atos-group.com>
Someone recently post an image with an image with two broken blobs
(I'm unable to see the thread).

I think I have found the origin of the bug.

In get_element_bounding_sphere from blob.c, if an element has
any transformation, the bounding sphere is also transformed.

here the buggy code:

  if (Element->Trans != NULL)
  {
    r = sqrt(r2);
 
    MTransPoint(C, C, Element->Trans);
 
    Make_Vector(H, r, r, r);
 
    MTransDirection(H, H, Element->Trans);
 
    r = max(max(fabs(H[X]), fabs(H[Y])), fabs(H[Z]));
 
    r2 = Sqr(r) + EPSILON;
  }

Comments follow on the picture:
from a regular sphere of radius r (r2 is the square of the radius) 
 [translucent white sphere in the picture]
a vector is made [from the origin to the Magenta sphere at the corner of the
cyan box]
At the end, taking the greatest dimension of the vector would give back the 
radius.

But the transformation (only scale/rotate, as it is a vector, translate are
ignored) 
move the vector extremity (magenta ellipse on the yellow box)
The yellow box is the result of the transformation from the cyan box.

It is obvious (and exagerated on purpose on the picture) that taking the
coordinates
of the vector, sometimes (according to the transformations), is not correct to
define the
radius of a bounding sphere (the translucent ellipsoid is the result of the
transformation
of the first sphere : obviously, it won't fit in a sphere tangent to the vector
extremity.

The bug nature is odd:
With only rotate, it is ok
With only scale (uniform or not), it is ok
With a mix of uniform scale and rotate, it is ok
With a mix of non-uniform scale and rotate, it MAY be ok or NOT, according to
the parameters
(mainly of the transformations)


Post a reply to this message


Attachments:
Download 'bugblob1.jpg' (19 KB)

Preview of image 'bugblob1.jpg'
bugblob1.jpg


 

From: Tor Olav Kristensen
Subject: Re: explanation of a blob bug
Date: 7 Sep 2000 21:18:22
Message: <39B83D1E.C94A83F1@online.no>
"J. Grimbert" wrote:

> Someone recently post an image with an image with two broken blobs
> (I'm unable to see the thread).
>
> I think I have found the origin of the bug.
>
> In get_element_bounding_sphere from blob.c, if an element has
> any transformation, the bounding sphere is also transformed.
>
> ... 8< ...Snip !
>
> The bug nature is odd:
> With only rotate, it is ok
> With only scale (uniform or not), it is ok
> With a mix of uniform scale and rotate, it is ok
> With a mix of non-uniform scale and rotate, it MAY be ok or NOT, according to
> the parameters
> (mainly of the transformations)

Thank you very much Grimbert for looking into
this problem.

I too found that the defects appeared when doing
some combinations of non uniform scaling and
rotations.

(This problem has been BUGGING me some time now)

And to any programming TAG members (E.g. Chris ?):

Should this problem be discussed further in
poray.general or can this now be considered to
be a bug ?


Tor Olav
--
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

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