POV-Ray : Newsgroups : povray.newusers : #declaring a #declare Server Time
13 Nov 2024 01:50:11 EST (-0500)
  #declaring a #declare (Message 1 to 7 of 7)  
From: David Burnett
Subject: #declaring a #declare
Date: 19 Sep 2001 14:46:24
Message: <1000928816@bigfoot.com>
I'm playing with the source to LParser to add a few new formats, 
including a couple of pov-ray ones. While creating a example pov file I 
came across what I would classify is unexpected behaviour.

In texture.inc Jade is declared as....

#declare Jade = 
pigment {
    marble
    turbulence 1.8
    color_map { Jade_Map }
}

if in my pov file I use

#declare texture_3  = texture {Jade}	

I get a warning 

Parsing.........setup.pov:13: warning: Found pigment identifier that should be in
pigment statement.  

however if I use

#declare texture_3  = texture {
pigment {
    marble
    turbulence 1.8
    color_map { Jade_Map }
}
}	

I don't get a warning.

So what is going on, is this the expected behaviour, how do I get around 
it.

Dave
-- 
Posted By NewsBe 1.6.4
http://www.vargol.freeserve.co.uk/newsbe/


Post a reply to this message

From: Lothar Esser
Subject: Re: #declaring a #declare
Date: 19 Sep 2001 14:54:28
Message: <3BA8EA11.45445706@helix.nih.gov>
David Burnett wrote:

> I'm playing with the source to LParser to add a few new formats,
> including a couple of pov-ray ones. While creating a example pov file I
> came across what I would classify is unexpected behaviour.
>
> In texture.inc Jade is declared as....
>
> #declare Jade =
> pigment {
>     marble
>     turbulence 1.8
>     color_map { Jade_Map }
> }
>
> if in my pov file I use
>
> #declare texture_3  = texture {Jade}
>
> I get a warning
>
> Parsing.........setup.pov:13: warning: Found pigment identifier that should be in
pigment statement.
>
> however if I use
>
> #declare texture_3  = texture {
> pigment {
>     marble
>     turbulence 1.8
>     color_map { Jade_Map }
> }
> }
>
> I don't get a warning.
>
> So what is going on, is this the expected behaviour, how do I get around
> it.
>
> Dave
> --
> Posted By NewsBe 1.6.4
> http://www.vargol.freeserve.co.uk/newsbe/

In the example Jade is a pigment not a texture.

You should be able to use

#declare texture_3 = texture { pigment { Jade } }

--
Dr. Lothar Esser
NIH / NCI
Tel. 301-435-6163
email les### [at] helixnihgov


Post a reply to this message

From: Trevor Quayle
Subject: Re: #declaring a #declare
Date: 19 Sep 2001 15:01:40
Message: <3ba8eb94@news.povray.org>
i think it should be:
#declare texture_3  = texture {pigment{Jade} }

for pre-3.5 versions

i.e., declared pigments need to be in pigment wrappers (textures in texture
wrappers, etc.)

-tgq


--
camera{location z*13look_at 0}light_source{15 15looks_like{sphere{0 10
}pigment{rgb 1}finish{ambient 15}}}union{torus{3,0.5rotate x*90}cone{y
*4,.5,-y*8,0}cone{-x*4,.5,x*8,0}pigment{rgb<.7,.6,.4>}finish{ambient 0
diffuse 0reflection{1fresnel on metallic 1}}interior{ior 25}rotate 15}
plane{y,-7pigment{checker rgb 0rgb 1scale 4}finish{diffuse.1}}//   TGQ


Post a reply to this message

From: Bob H 
Subject: Re: #declaring a #declare
Date: 19 Sep 2001 19:15:59
Message: <3ba9272f@news.povray.org>
"Trevor Quayle" <Tin### [at] hotmailcom> wrote in message
news:3ba8eb94@news.povray.org...
> i think it should be:
> #declare texture_3  = texture {pigment{Jade} }
>
> i.e., declared pigments need to be in pigment wrappers (textures in
texture
> wrappers, etc.)

Yep, and just to reiterate: keep in mind that the wrapper of each kind of
statement needs to be repeated like that when redeclaring.  object,
material, texture, pigment, normal, finish, interior, media, density and
others.  I'm not sure of the complete list but most anything with braces {},
aside from CSG union, etc., though.  Just happens to be how POV-Ray works
with them.

Probably a good time to point out that layered textures can only be declared
one time through.  If trying to add layers into a previously declared
layered texture there will be a warning and it'll stop parsing.

Bob H.


Post a reply to this message

From: Ken
Subject: Re: #declaring a #declare
Date: 19 Sep 2001 22:38:22
Message: <3BA957B5.B6F538DF@pacbel.net>
"Bob H." wrote:

> Probably a good time to point out that layered textures can only be declared
> one time through.  If trying to add layers into a previously declared
> layered texture there will be a warning and it'll stop parsing.

How did you come by that knowledge, Bob?  :)

-- 
Ken Tyler


Post a reply to this message

From: Bob H 
Subject: Re: #declaring a #declare
Date: 19 Sep 2001 23:28:58
Message: <3ba9627a@news.povray.org>
"Ken" <tyl### [at] pacbelnet> wrote in message
news:3BA957B5.B6F538DF@pacbel.net...
>
> "Bob H." wrote:
>
> > Probably a good time to point out that layered textures can only be
declared
> > one time through.  If trying to add layers into a previously declared
> > layered texture there will be a warning and it'll stop parsing.
>
> How did you come by that knowledge, Bob?  :)

Repitition... and lots of it in my case.

Bob H.


Post a reply to this message

From: Ron Parker
Subject: Re: #declaring a #declare
Date: 20 Sep 2001 10:44:04
Message: <slrn9qk05m.c0u.ron.parker@fwi.com>
On Wed, 19 Sep 2001 18:16:04 -0500, Bob H. wrote:
>"Trevor Quayle" <Tin### [at] hotmailcom> wrote in message
>news:3ba8eb94@news.povray.org...
>> i think it should be:
>> #declare texture_3  = texture {pigment{Jade} }
>>
>> i.e., declared pigments need to be in pigment wrappers (textures in
>texture
>> wrappers, etc.)
>
>Yep, and just to reiterate: keep in mind that the wrapper of each kind of
>statement needs to be repeated like that when redeclaring.  object,
>material, texture, pigment, normal, finish, interior, media, density and
>others.  I'm not sure of the complete list but most anything with braces {},
>aside from CSG union, etc., though.  Just happens to be how POV-Ray works
>with them.

object is a special case.  You have to do this:

#declare Foo = sphere{0,1}

object{Foo}

-- 
#local R=rgb 99;#local P=R-R;#local F=pigment{gradient x}box{0,1pigment{gradient
y pigment_map{[.5F pigment_map{[.3R][.3F color_map{[.15red 99][.15P]}rotate z*45
translate x]}]#local H=pigment{gradient y color_map{[.5P][.5R]}scale 1/3}[.5F
pigment_map{[.3R][.3H][.7H][.7R]}]}}}camera{location.5-3*z}//only my opinions


Post a reply to this message

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