POV-Ray : Newsgroups : povray.newusers : Trouble with my light code Server Time
13 Nov 2024 01:48:01 EST (-0500)
  Trouble with my light code (Message 1 to 3 of 3)  
From: Wade
Subject: Trouble with my light code
Date: 2 Sep 2001 23:53:33
Message: <3b92febd$1@news.povray.org>
I am very new to povray.  And i'm having trouble with my light code.  When I
render my scene it is just black.  If anyone can help me, I would appreciate
it.  Here is the code:

#include "colors.inc"

camera {
 location <5,0,0>
 look_at <0,0,0>
}
// create a point "spotlight" (cylindrical directed) light source
light_source
{
  0*x                     // light's position (translated below)
  color rgb <1,1,1>       // light's color
  spotlight               // this kind of light source
  cylinder                // this variation
  translate <40, 80, -40> // <x y z> position of light
  point_at <0, 0, 0>      // direction of spotlight
  radius 5                // hotspot (inner, in degrees)
  tightness 50            // tightness of falloff (1...100) lower is softer,
higher is tighter
  falloff 8               // intensity falloff radius (outer, in degrees)
}


// create a box that extends between the 2 specified points
box
{
  <-1, -1, -1>  // one corner position <X1 Y1 Z1>
  < 1,  1,  1>  // other corner position <X2 Y2 Z2>
color White
}

Wade


Post a reply to this message

From: Ken
Subject: Re: Trouble with my light code
Date: 3 Sep 2001 00:03:54
Message: <3B9301F7.AA2917C@pacbell.net>
First you need to wrap your pigment in the box statement with a pigment{}
wrapper. Otherwise you get a warning message and a black box because the
way you have it specified POV-Ray is ignoring it. Once you correct this
problem you still have a problem with the location of your light source.
You spotlight tightness makes a fairly small point by the time it reaches
the box and it is rotated away from the camera side of the box. Try the
code below for a starting point and work from there.


#include "colors.inc"

camera {
 location <5,0,0>
 look_at <0,0,0>
}
// create a point "spotlight" (cylindrical directed) light source
light_source
{
  0*x                     // light's position (translated below)
  color rgb <1,1,1>       // light's color
  spotlight               // this kind of light source
  cylinder                // this variation
  translate <40, 0, 0> // <x y z> position of light
  point_at <0, 0, 0>      // direction of spotlight
  radius 5                // hotspot (inner, in degrees)
  tightness 50            // tightness of falloff (1...100) lower is softer,
higher is tighter
  falloff 8               // intensity falloff radius (outer, in degrees)
}

// create a box that extends between the 2 specified points
box
{
  <-1, -1, -1>  // one corner position <X1 Y1 Z1>
  < 1,  1,  1>  // other corner position <X2 Y2 Z2>
pigment{color White}
}

-- 
Ken Tyler


Post a reply to this message

From: Wade
Subject: Re: Trouble with my light code
Date: 3 Sep 2001 00:26:31
Message: <3b930677@news.povray.org>
Thanks Ken it worked
Wade


Post a reply to this message

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