POV-Ray : Newsgroups : povray.newusers : Newbie - Want to create a square flood light : Re: Newbie - Want to create a square flood light Server Time
28 Jul 2024 22:18:02 EDT (-0400)
  Re: Newbie - Want to create a square flood light  
From: Trevor G Quayle
Date: 7 Jun 2007 11:35:02
Message: <web.4668252c9713ab9c150d4c10@news.povray.org>
> An area light with projected_through should work.  You just need to make
> sure the area light is far enough away from the projected_through rectangle
> to get the amount of softness you want.

I've thown together a quick macro and scene to demonstrate this below.  The
radius and falloff angles work the same as for spotlights, however, the
tightness parameter cannot be duplicated.

//START
global_settings {ambient_light 1}

camera{
  up y*image_height
  right x*image_width
  angle 60
  location <0,30,-30>
  look_at  <0,0,0>
}

#macro RecAreaLight(SIZ,GSIZ,RADIUS,FALLOFF)
  #local
ASIZ=SIZ*(tan(radians(FALLOFF))-tan(radians(RADIUS)))/(tan(radians(FALLOFF))+tan(radians(RADIUS)));
  #local DIST=(SIZ.x+ASIZ.x)/(2*tan(radians(FALLOFF)));
  area_light
  <ASIZ.x, 0, 0> <0, 0, ASIZ.y>
  GSIZ.x,GSIZ.y
  adaptive 1
  jitter
  translate y*DIST
  projected_through{box{-<SIZ.x,0,SIZ.y>/2,<SIZ.x,0,SIZ.y>/2}}
#end


#declare P=<4,6>; //light size
#declare G=<4,4>; //area light grid size
#declare RA=30; //radius angle
#declare FA=45; //falloff angle

light_source{
  0
  rgb 2
  fade_power 1
  fade_distance 5
  RecAreaLight(P,G,RA,FA)
  looks_like{box{-<P.x,0,P.y>/2,<P.x,0,P.y>/2} pigment{rgb 1} finish{ambient
1 diffuse 1}}
  rotate x*30
  rotate y*90
  translate y*5
}

plane{y,0 pigment{rgb 1}}
sphere{y*2,2 pigment{rgb 1}}
//END


-tgq


Post a reply to this message

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