POV-Ray : Newsgroups : povray.advanced-users : SOR used to work, but no longer Server Time
26 Jun 2024 08:27:45 EDT (-0400)
  SOR used to work, but no longer (Message 1 to 5 of 5)  
From: SharkD
Subject: SOR used to work, but no longer
Date: 24 Jul 2010 22:30:12
Message: <4c4ba1b4$1@news.povray.org>
When I created the following SOR object in 3.6.1 it worked, but in 3.6.2 
and the beta it no longer works. Why does it no longer work, and what 
can I do to fix it?


#include "GSprites_Scene_settings.inc"      // Source of the camera and 
lighting code
#local Tiles_Width = 64;
#local Tube_Radius = Tiles_Width/2/cos(pi/4) * 5/4;
#local Wid = Tiles_Width/2;
#local Angle_Start = acos(Wid/Tube_Radius);
#local Angle_Incrm = 2/8 * Angle_Start;
sor
{
   11,
   <
     cos(Angle_Start - 8 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 8 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 8 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 8 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 7 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 7 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 6 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 6 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 5 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 5 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 4 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 4 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 3 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 3 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 2 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 2 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 1 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 1 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 0 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 0 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 0 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 0 * Angle_Incrm) * Tube_Radius,
   >
   pigment {rgb 1}
   translate Wid
}


-- 
http://isometricland.com


Post a reply to this message

From: SharkD
Subject: Re: SOR used to work, but no longer
Date: 24 Jul 2010 23:23:33
Message: <4c4bae35$1@news.povray.org>
Oops. Check this code instead.





#local Tiles_Width = 64;
#local Tube_Radius = Tiles_Width/2/cos(pi/4) * 5/4;
#local Wid = Tiles_Width/2;
#local Angle_Start = acos(Wid/Tube_Radius);
#local Angle_Incrm = 2/8 * Angle_Start;
sor
{
   11,
   <
     cos(Angle_Start - 8 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 8 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 8 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 8 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 7 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 7 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 6 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 6 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 5 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 5 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 4 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 4 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 3 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 3 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 2 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 2 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 1 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 1 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 0 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 0 * Angle_Incrm) * Tube_Radius,
   >
   <
     cos(Angle_Start - 0 * Angle_Incrm) * Tube_Radius - Wid,
     sin(Angle_Start - 0 * Angle_Incrm) * Tube_Radius,
   >
   pigment {rgb 1}
   translate Wid
}


Post a reply to this message

From: clipka
Subject: Re: SOR used to work, but no longer
Date: 25 Jul 2010 04:44:19
Message: <4c4bf963$1@news.povray.org>
Am 25.07.2010 04:30, schrieb SharkD:
> When I created the following SOR object in 3.6.1 it worked, but in 3.6.2
> and the beta it no longer works. Why does it no longer work, and what
> can I do to fix it?

Due to rounding errors, the first two and last two points in the SOR 
happen to have a negative X coordinate. While 3.6.1 seems to have 
accepted such values, 3.6.2 and 3.7 don't.

To fix it, you may explicitly set the offending points' X coordinates to 
zero. Alternatively, enclose the X coordinates in a "max(0, ...)" 
expression to force them into the non-negative domain.


Post a reply to this message

From: SharkD
Subject: Re: SOR used to work, but no longer
Date: 25 Jul 2010 04:44:46
Message: <4c4bf97e$1@news.povray.org>
The workaround was to clip the values at 0, like so:

#local Tiles_Width = 64;
#local Tube_Radius = Tiles_Width/2/cos(pi/4) * 5/4;
#local Wid = Tiles_Width/2;
#local Angle_Start = acos(Wid/Tube_Radius);
#local Angle_Incrm = 2/8 * Angle_Start;
sor
{
   11,
   <
     max(0,cos(Angle_Start - 8 * Angle_Incrm) * Tube_Radius - Wid),
     sin(Angle_Start - 8 * Angle_Incrm) * Tube_Radius,
   >
   <
     max(0,cos(Angle_Start - 8 * Angle_Incrm) * Tube_Radius - Wid),
     sin(Angle_Start - 8 * Angle_Incrm) * Tube_Radius,
   >
   <
     max(0,cos(Angle_Start - 7 * Angle_Incrm) * Tube_Radius - Wid),
     sin(Angle_Start - 7 * Angle_Incrm) * Tube_Radius,
   >
   <
     max(0,cos(Angle_Start - 6 * Angle_Incrm) * Tube_Radius - Wid),
     sin(Angle_Start - 6 * Angle_Incrm) * Tube_Radius,
   >
   <
     max(0,cos(Angle_Start - 5 * Angle_Incrm) * Tube_Radius - Wid),
     sin(Angle_Start - 5 * Angle_Incrm) * Tube_Radius,
   >
   <
     max(0,cos(Angle_Start - 4 * Angle_Incrm) * Tube_Radius - Wid),
     sin(Angle_Start - 4 * Angle_Incrm) * Tube_Radius,
   >
   <
     max(0,cos(Angle_Start - 3 * Angle_Incrm) * Tube_Radius - Wid),
     sin(Angle_Start - 3 * Angle_Incrm) * Tube_Radius,
   >
   <
     max(0,cos(Angle_Start - 2 * Angle_Incrm) * Tube_Radius - Wid),
     sin(Angle_Start - 2 * Angle_Incrm) * Tube_Radius,
   >
   <
     max(0,cos(Angle_Start - 1 * Angle_Incrm) * Tube_Radius - Wid),
     sin(Angle_Start - 1 * Angle_Incrm) * Tube_Radius,
   >
   <
     max(0,cos(Angle_Start - 0 * Angle_Incrm) * Tube_Radius - Wid),
     sin(Angle_Start - 0 * Angle_Incrm) * Tube_Radius,
   >
   <
     max(0,cos(Angle_Start - 0 * Angle_Incrm) * Tube_Radius - Wid),
     sin(Angle_Start - 0 * Angle_Incrm) * Tube_Radius,
   >
   pigment {rgb 1}
   translate Wid
}


Post a reply to this message

From: SharkD
Subject: Re: SOR used to work, but no longer
Date: 25 Jul 2010 08:51:57
Message: <4c4c336d$1@news.povray.org>
On 7/25/2010 4:44 AM, clipka wrote:
> Due to rounding errors, the first two and last two points in the SOR
> happen to have a negative X coordinate. While 3.6.1 seems to have
> accepted such values, 3.6.2 and 3.7 don't.
>
> To fix it, you may explicitly set the offending points' X coordinates to
> zero. Alternatively, enclose the X coordinates in a "max(0, ...)"
> expression to force them into the non-negative domain.

Heh. We posted at the same time!


-- 
http://isometricland.com


Post a reply to this message

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