POV-Ray : Newsgroups : povray.bugreports : Re: Strange behaviour? Server Time
23 Dec 2024 19:04:04 EST (-0500)
  Re: Strange behaviour? (Message 1 to 1 of 1)  
From: Ron Parker
Subject: Re: Strange behaviour?
Date: 6 Oct 1999 20:46:59
Message: <37fbed83@news.povray.org>
On Wed, 6 Oct 1999 01:17:27 -0400, Mark Wagner wrote:
>The problem only occurs when scaling by <-1,-1,-1>.  Scaling by <-1,1,1>,
><1,-1,1>, <1,1,-1>, or anything else doesn't cause problems.

(Crossposted to bugreports)

Ah, now it begins to make sense.  See, when you scale a sphere it 
multiplies the radius and the center by the scale factor unless it
either already has a nonuniform transform in its list or the scale
factor itself is nonuniform; in those two cases it uses the usual,
more sophisticated methods.

Obviously, making the radius negative is a bad thing.  Here's the
fix, in the function Scale_Sphere in spheres.c:

   if (Sphere->Trans == NULL)
   {
     VScaleEq(Sphere->Center, Vector[X]);

-    Sphere->Radius *= Vector[X];
+    Sphere->Radius *= fabs(Vector[X]);
 
     Compute_Sphere_BBox(Sphere);
   }


Post a reply to this message

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