POV-Ray : Newsgroups : povray.newusers : Trouble defining a visible light source Server Time
26 Dec 2024 06:40:41 EST (-0500)
  Trouble defining a visible light source (Message 1 to 7 of 7)  
From: TheRealMorris
Subject: Trouble defining a visible light source
Date: 25 Nov 2021 17:20:00
Message: <web.61a00b1491a3b12e4f1a67df8bf7213@news.povray.org>
Hi,

I'm using Povray 3.7.0.8 (which is the version coming straight from the Ubuntu
21.10 archives) and I'm trying to define a visible light source. I found this in
the docs for povray 3.6 here:

http://www.povray.org/documentation/view/3.6.2/137/

So, just for a test I copy/pasted this into my scene:


light_source
{ <0,0,0> color 1
  looks_like
  { sphere
    { <0,0,0>,0.1
      color { rgb 1 }
      finish { ambient 1 }
    }
  }
  translate <10,20,30>
}


But I get this error:


File '/home/trm/light.pov' line 91: Parse Error: No matching } in 'sphere', {
found instead Fatal error in parser: Cannot parse input.

Line 91 is the "color { rgb 1 }" one ...


Did something change in the syntax in version 3.7 or is the example incorrect
(or am I missing something basic)?

Thanks for any tips


Post a reply to this message

From: Harald Jörg
Subject: Re: Trouble defining a visible light source
Date: 25 Nov 2021 17:51:41
Message: <874k7zsvbc.fsf@hajtower>
TheRealMorris writes:

> I'm using Povray 3.7.0.8 (which is the version coming straight from the Ubuntu
> 21.10 archives) and I'm trying to define a visible light source. I found this in
> the docs for povray 3.6 here:
>
> http://www.povray.org/documentation/view/3.6.2/137/
>
> So, just for a test I copy/pasted this into my scene:
>
>
> light_source
> { <0,0,0> color 1
>   looks_like
>   { sphere
>     { <0,0,0>,0.1
>       color { rgb 1 }
>       finish { ambient 1 }
>     }
>   }
>   translate <10,20,30>
> }
>
>
> But I get this error:
>
>
> File '/home/trm/light.pov' line 91: Parse Error: No matching } in 'sphere', {
> found instead Fatal error in parser: Cannot parse input.
>
> Line 91 is the "color { rgb 1 }" one ...
>
>
> Did something change in the syntax in version 3.7 or is the example incorrect
> (or am I missing something basic)?

The syntax of POV-Ray apparently has changed, 'color' is no longer
permitted outside a texture or pigment.  Replace

    color { rgb 1 }

with

    pigment { color rgb 1 }

and the scene should render.
-- 
Cheers,
haj


Post a reply to this message

From: TheRealMorris
Subject: Re: Trouble defining a visible light source
Date: 25 Nov 2021 18:05:00
Message: <web.61a0164cd163838f4f1a67df8bf7213@news.povray.org>
=?utf-8?Q?Harald_J=C3=B6rg?= <haj### [at] posteode> wrote:
> TheRealMorris writes:
>
> > I'm using Povray 3.7.0.8 (which is the version coming straight from the Ubuntu
> > 21.10 archives) and I'm trying to define a visible light source. I found this in
> > the docs for povray 3.6 here:
> >
> > http://www.povray.org/documentation/view/3.6.2/137/
> >
> > So, just for a test I copy/pasted this into my scene:
> >
> >
> > light_source
> > { <0,0,0> color 1
> >   looks_like
> >   { sphere
> >     { <0,0,0>,0.1
> >       color { rgb 1 }
> >       finish { ambient 1 }
> >     }
> >   }
> >   translate <10,20,30>
> > }
> >
> >
> > But I get this error:
> >
> >
> > File '/home/trm/light.pov' line 91: Parse Error: No matching } in 'sphere', {
> > found instead Fatal error in parser: Cannot parse input.
> >
> > Line 91 is the "color { rgb 1 }" one ...
> >
> >
> > Did something change in the syntax in version 3.7 or is the example incorrect
> > (or am I missing something basic)?
>
> The syntax of POV-Ray apparently has changed, 'color' is no longer
> permitted outside a texture or pigment.  Replace
>
>     color { rgb 1 }
>
> with
>
>     pigment { color rgb 1 }
>
> and the scene should render.
> --
> Cheers,
> haj

Thank you, that solves the issue.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Trouble defining a visible light source
Date: 26 Nov 2021 02:29:56
Message: <61a08cf4$1@news.povray.org>
Op 26/11/2021 om 00:03 schreef TheRealMorris:
> =?utf-8?Q?Harald_J=C3=B6rg?= <haj### [at] posteode> wrote:
>> TheRealMorris writes:
>>
>>> I'm using Povray 3.7.0.8 (which is the version coming straight from the Ubuntu
>>> 21.10 archives) and I'm trying to define a visible light source. I found this in
>>> the docs for povray 3.6 here:
>>>
>>> http://www.povray.org/documentation/view/3.6.2/137/
>>>

Tip: When using the POV-Ray documentation, always use the wiki version 
as that is the most up-to-date. Your document page can now be found here:

https://wiki.povray.org/content/Knowledgebase:Language_Questions_and_Tips#Topic_1

Personally, I most often start with:

https://wiki.povray.org/content/Reference:Keywords


-- 
Thomas


Post a reply to this message

From: Alain Martel
Subject: Re: Trouble defining a visible light source
Date: 26 Nov 2021 13:09:44
Message: <61a122e8@news.povray.org>
Le 2021-11-25 à 17:16, TheRealMorris a écrit :
> Hi,
> 
> I'm using Povray 3.7.0.8 (which is the version coming straight from the Ubuntu
> 21.10 archives) and I'm trying to define a visible light source. I found this in
> the docs for povray 3.6 here:
> 
> http://www.povray.org/documentation/view/3.6.2/137/
> 
> So, just for a test I copy/pasted this into my scene:
> 
> 
> light_source
> { <0,0,0> color 1
>    looks_like
>    { sphere
>      { <0,0,0>,0.1
>        color { rgb 1 }
>        finish { ambient 1 }
>      }
>    }
>    translate <10,20,30>
> }
> 
> 
> But I get this error:
> 
> 
> File '/home/trm/light.pov' line 91: Parse Error: No matching } in 'sphere', {
> found instead Fatal error in parser: Cannot parse input.
> 
> Line 91 is the "color { rgb 1 }" one ...
> 
> 
> Did something change in the syntax in version 3.7 or is the example incorrect
> (or am I missing something basic)?
> 
> Thanks for any tips
> 
> 
> 
Replace «color» with «pigment».
Note : The keyword «color»/«colour» is no longer needed. It's a leftover 
from previous versions. Pre version 3.3.

Use this instead :

light_source
{ <10,20,30> rgb 1
   looks_like
   { sphere
     { <0,0,0>,0.1
       pigment { rgb 1 }
       finish { ambient 1 }
     }
   }
}

The coordinate of the looks_like is always relative to the light_source 
location.


Post a reply to this message

From: TheRealMorris
Subject: Re: Trouble defining a visible light source
Date: 28 Nov 2021 07:45:00
Message: <web.61a37931d163838fffb1c8fe8bf7213@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> Op 26/11/2021 om 00:03 schreef TheRealMorris:
> > =?utf-8?Q?Harald_J=C3=B6rg?= <haj### [at] posteode> wrote:
> >> TheRealMorris writes:
> >>
> >>> I'm using Povray 3.7.0.8 (which is the version coming straight from the Ubuntu
> >>> 21.10 archives) and I'm trying to define a visible light source. I found this in
> >>> the docs for povray 3.6 here:
> >>>
> >>> http://www.povray.org/documentation/view/3.6.2/137/
> >>>
>
> Tip: When using the POV-Ray documentation, always use the wiki version
> as that is the most up-to-date. Your document page can now be found here:
>
> https://wiki.povray.org/content/Knowledgebase:Language_Questions_and_Tips#Topic_1
>
> Personally, I most often start with:
>
> https://wiki.povray.org/content/Reference:Keywords
>
>
> --
> Thomas

Thank you, that's a useful tip. The problem is that the wiki isn't usually what
comes up first when you do a google search but ok, I can work around that.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Trouble defining a visible light source
Date: 29 Nov 2021 02:14:40
Message: <61a47de0$1@news.povray.org>
Op 28/11/2021 om 13:42 schreef TheRealMorris:

> Thank you, that's a useful tip. The problem is that the wiki isn't usually what
> comes up first when you do a google search but ok, I can work around that.
> 

Bookmark the address? ;-)

-- 
Thomas


Post a reply to this message

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