POV-Ray : Newsgroups : povray.general : Re: explanation of a blob bug : Re: explanation of a blob bug Server Time
9 Aug 2024 01:23:58 EDT (-0400)
  Re: explanation of a blob bug  
From: J  Grimbert
Date: 8 Sep 2000 03:28:25
Message: <39B8952C.65D9A48B@atos-group.com>
Tor Olav Kristensen wrote:
> 
> "J. Grimbert" wrote:
> 
> >
> > 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 ?

I am not a TAG member, but hereafter is my bugfix
but we need a consensus before being allowed to post in bug-report.



--- blob.c.old  Thu Sep  7 18:41:28 2000
+++ blob.c      Thu Sep  7 18:44:55 2000
@@ -2468,7 +2468,8 @@
 static void get_element_bounding_sphere(BLOB_ELEMENT *Element, VECTOR Center,
DBL *Radius2)
 {
   DBL r, r2 = 0.0;
-  VECTOR C, H;
+  VECTOR C;
+  BBOX local_BBox;
 
   switch (Element->Type)
   {
@@ -2514,12 +2515,10 @@
 
     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]));
-
+    Make_BBox(local_BBox ,0,0,0,r,r,r);
+    Recompute_BBox(&local_BBox, Element->Trans);
+    r= max(max(fabs(local_BBox.Lengths[X]),fabs(local_BBox.Lengths[Y])),
+               fabs(local_BBox.Lengths[Z]));
     r2 = Sqr(r) + EPSILON;
   }


Post a reply to this message

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