POV-Ray : Newsgroups : povray.beta-test : Bug in area light wrt matrix transform Server Time
27 Dec 2024 19:23:35 EST (-0500)
  Bug in area light wrt matrix transform (Message 1 to 1 of 1)  
From: Mike Andrews
Subject: Bug in area light wrt matrix transform
Date: 11 Jul 2007 07:55:02
Message: <web.4694c449b02d2b905e1e98150@news.povray.org>
This bug was discussed with respect to the 3.6 code in the following post:

http://news.povray.org/web.4639ad4565c782bbc717c9af0%40news.povray.org

I can now confirm that the same bug occurs in
3.7.0.beta.21a.msvc8-sse2.win32 (Jul 9 2007) version.

Recap of bug: a matrix transform containing a translate component does not
modify the axes of an area light correctly. This also shows up when using a
transform{} block because a matrix transform is used internally.

Location of bug: in the 3.6 code the bug was identified as MTransPoint()
being used to transform the axes in function Transform_Light_Source() in
file point.cpp

Fix for bug: replace MTransPoint() with MTransDirection() to transform the
axes.

The following code illustrates the bug:

// --- Start of areaLightMatrix.pov ---

// +w400 +h400
// Change useMatrix to 'on' to see problem

#declare useMatrix = off;

camera {
 up <0, 1, 0>
 right x*image_width/image_height
 location  <-3, 15, -25>
 angle     10
 look_at   0.5*y
}

plane {
  y, 0
  pigment { rgb 1 }
  finish { diffuse 1 ambient 0 brilliance 0.5 }
}

light_source {
  0, rgb 1
  area_light x,y, 2,2
  looks_like {
    union {
      sphere { <-1,-1,0>,0.05 }
      sphere { <-1,1,0>,0.05 }
      sphere { <1,-1,0>,0.05 }
      sphere { <1,1,0>,0.05 }
      scale 0.5
      pigment { rgb 0.9 }
      finish { ambient 1 diffuse 0 }
    }
  }
  #if (useMatrix)
    matrix < 1, 0, 0,
             0, 0,-1,
             0, 1, 0,
             0, 2, 0 >
  #else
    rotate -90*x
    translate 2*y
#end
}

cylinder { -y,0.5*y,0.02 translate < 0,0,-1> pigment { rgb 0 } }
cylinder { -y,0.5*y,0.02 translate <-1,0,0>  pigment { rgb 0 } }
cylinder { -y,0.5*y,0.02 translate < 0,0,0>  pigment { rgb 0 } }
cylinder { -y,0.5*y,0.02 translate < 1,0,0>  pigment { rgb 0 } }
cylinder { -y,0.5*y,0.02 translate < 0,0,1>  pigment { rgb 0 } }

// --- End of areaLightMatrix.pov ---


Post a reply to this message

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