POV-Ray : Newsgroups : povray.general : light_source in object Server Time
1 Aug 2024 00:24:41 EDT (-0400)
  light_source in object (Message 1 to 4 of 4)  
From: joe
Subject: light_source in object
Date: 7 Jul 2006 11:40:00
Message: <web.44ae7f55b23eae858b5be8a0@news.povray.org>
I'm making a lamp post with a light_source but cannot get past the error...
"light source must be defined using new syntax"  Any tips?

// Persistence of Vision Ray Tracer Scene Description File
// File: ?.pov
// Vers: 3.5
// Desc: Basic Scene Example
// Date: mm/dd/yy
// Auth: ?
//

#version 3.5;

#include "colors.inc"
#include "golds.inc"
#include "metals.inc"
#include "math.inc"
#include "textures.inc"


global_settings {
  assumed_gamma 1.0
}

// ----------------------------------------

camera {
  location  <0.0, 80, -25>

  look_at   <0.0,72,  0.0>
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.3 rgb <1,1,1>]
      [0.7 rgb <0,0,0>]
    }
  }
}


plane {
  y, -1
  pigment { color rgb <0.7,0.5,0.3> }
}

#declare postradius=2;
#declare postheight=60;
#declare crossradius=.5;
#declare crosslength=12;
#declare crossheight=48;
#declare crossballradius=1;
#declare headsidewidthtop=10;
#declare headsidewidthbottom=6;
#declare headheight=12;
#declare headbasewidth=5;
#declare headtopwidth=9;
#declare headbasethickness=.25;
#declare glassthickness=.25;
#declare sideframewidth=.5;
#declare sideframethickness=.06;


#declare crossball=sphere {<0,0,0>,crossballradius
 texture {T_Brass_1A }
}

#declare post=cylinder{<0,0,0><0,postheight,0>postradius
 texture {
  pigment {color Black}
  finish {F_MetalA }
 }
}

#declare cross=cylinder
{<-crosslength/2,crossheight,0><crosslength/2,crossheight,0>crossradius
 texture {
  pigment {color Black}
  finish {F_MetalA }
 }
}


#declare Lightbulb = union {
    merge {
      sphere { <0,0,0>,1 }
      cylinder {
        <0,0,1>, <0,0,0>, 1
        scale <0.35, 0.35, 1.0>
        translate  0.5*z
      }
      texture {
        pigment {color rgb <1, 1, 1>}
        finish {ambient .8 diffuse .6}
      }
    }
    cylinder {
      <0,0,1>, <0,0,0>, 1
      scale <0.4, 0.4, 0.5>
      texture { Brass_Texture }
      translate  1.5*z
    }
    rotate -90*x
    scale .5
  }


#declare headside=union{

 #declare a=(headtopwidth-headbasewidth)/2;
 #declare b=headheight;

 polygon { 10

<-headbasewidth/2,0><headbasewidth/2,0><headtopwidth/2,headheight><-headtopwidth/2,headheight><-headbasewidth/2,0>

<(-headbasewidth/2)+sideframewidth,sideframewidth><(headbasewidth/2)-sideframewidth,sideframewidth>

<(headtopwidth/2)-sideframewidth,headheight-sideframewidth><(-headtopwidth/2)+sideframewidth,headheight-sideframewidth>
<(-headbasewidth/2)+sideframewidth,sideframewidth>


 }

 rotate x*atan2d(a,b)

}

#declare lamphead=union{
 box
{<-headbasewidth/2,0,-headbasewidth/2><headbasewidth/2,headbasethickness,headbasewidth/2>}
//base
 object {headside rotate y*0 translate z*headbasewidth/2}
 object {headside rotate y*90 translate x*headbasewidth/2}
 object {headside rotate y*180 translate z*-headbasewidth/2}
 object {headside rotate y*270 translate x*-headbasewidth/2}

 texture {
  pigment {color Black}
  finish {F_MetalA }
 }



 light_source {
  <0, 0, 0>
    color White
      looks_like { Lightbulb }
  }


}


#declare lamppost=union {
 object {post}
 object {lamphead translate y*postheight}
 object {cross}
 object {crossball translate <-crosslength/2,crossheight,0>}
 object {crossball translate <crosslength/2,crossheight,0>}
}

object  {lamppost}


Post a reply to this message

From: Trevor G Quayle
Subject: Re: light_source in object
Date: 7 Jul 2006 12:40:00
Message: <web.44ae8e301362a4ddc150d4c10@news.povray.org>
Move the lightsource declaration before the texture in the union.

-tgq


Post a reply to this message

From: joe
Subject: Re: light_source in object
Date: 7 Jul 2006 12:50:00
Message: <web.44ae90281362a4dd8b5be8a0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> Move the lightsource declaration before the texture in the union.
>
> -tgq

Thank you!  Is that in the docs?


Post a reply to this message

From: Trevor G Quayle
Subject: Re: light_source in object
Date: 7 Jul 2006 15:45:01
Message: <web.44aeb8cf1362a4ddc150d4c10@news.povray.org>
"joe" <nomail@nomail> wrote:
> "Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> > Move the lightsource declaration before the texture in the union.
> >
> > -tgq
>
> Thank you!  Is that in the docs?

I don't think so.  But it's just a general syntax rule for texture,
material, etc.

-tgq


Post a reply to this message

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