POV-Ray : Newsgroups : povray.binaries.images : explanation of a blob bug : explanation of a blob bug Server Time
2 Nov 2024 17:00:56 EDT (-0400)
  explanation of a blob bug  
From: J  Grimbert
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


 

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