POV-Ray : Newsgroups : povray.general : Why doesn't this work (some #declare stuff) Server Time
10 Aug 2024 17:28:49 EDT (-0400)
  Why doesn't this work (some #declare stuff) (Message 1 to 6 of 6)  
From: Peter Hertel
Subject: Why doesn't this work (some #declare stuff)
Date: 30 Oct 1999 11:57:38
Message: <381b1572@news.povray.org>
I can't get thit to work... anyone know why??

I get an error : RValue to declare expected but cubic_spline found instead.
But why does it pass linear_spline? This works if you #declare font names..
why not this? I'm trying to make some system for making test renderings
easy. I'm not very good at povray, so I would appreciate a easy to
understand answer, not that I usually don't get it.. Thanks!

Btw.. anyone got  a nice plastic finish? Like the one on computers.

#include "colors.inc"

#declare Test = 0;


#if (Test)

        #declare screen_text = texture {pigment {White}}
        #declare Spline = linear_spline;

#else

        #declare screen_text = texture {pigment {White} finish {diffuse 0.3
reflection 0.3 specular 0.7}

        #declare Spline = cubic_spline;

#end

camera{
location <20,60,-50>
look_at <20,22,0>
}

light_source{<20,50,-100> White}

box{<0,6,0>,<40,44,6> texture{screen_text}}

prism{Spline 6,44,6 <0,0>,<0,0>,<40,0>,<20,-1.5>,<0,0>,<0,0> texture
{screen_text}}


Post a reply to this message

From: Robert Chaffe
Subject: Re: Why doesn't this work (some #declare stuff)
Date: 30 Oct 1999 12:16:03
Message: <381b19c3@news.povray.org>
Missing curly brace, perhaps?

Replace the following declaration:

        #declare screen_text = texture {pigment {White} finish {diffuse 0.3
reflection 0.3 specular 0.7}

with this one:

        #declare screen_text = texture {pigment {White} finish {diffuse 0.3
reflection 0.3 specular 0.7}   }

(Note the last curly brace to close the texture block.)

rc


Post a reply to this message

From: Chris Huff
Subject: Re: Why doesn't this work (some #declare stuff)
Date: 30 Oct 1999 12:37:37
Message: <381B1F66.422D3F9F@yahoo.com>
It passes by the line that declares linear_spline because of the #if
statement.
#include "colors.inc"

#declare Test = 0;//0 is the same as false


#if (Test)
        //because Test is 0, all this stuff is ignored and the #else
block is used instead.
        #declare screen_text = texture {pigment {White}}
        //You can't declare a variable as linear_spline! But this block
is ignored, so it doesn't matter.
        #declare Spline = linear_spline;

#else

        #declare screen_text = texture {pigment {White} finish {diffuse
0.3
reflection 0.3 specular 0.7}
        //You can't declare a variable as cubic_spline!
        #declare Spline = cubic_spline;

#end


Post a reply to this message

From: Peter Hertel
Subject: SV: Why doesn't this work (some #declare stuff)
Date: 30 Oct 1999 13:53:09
Message: <381b3085@news.povray.org>
I have to write it like this then... makes it a bit more difficult, but
thanks a lot..
well...  I use an include file, so I just added the finish in the mail
manually without test rendering.. that's why the last } weren't there :)

#declare Test = 1;

#if (Test)

        #declare screen_text = texture {pigment {White}}

#else

        #declare screen_text = texture {Plastic_White}
#end

camera{
location <20,60,-50>
look_at <20,22,0>
}

light_source{<20,50,-100> White}

box{<0,6,0>,<40,44,6> texture{screen_text}}

#if (Test)
prism{linear_spline 6,44,4 <0,0>,<40,0>,<20,-1.5>,<0,0> texture
{screen_text}}
#else
prism{cubic_spline 6,44,6 <0,0>,<0,0>,<40,0>,<20,-1.5>,<0,0>,<0,0> texture
{screen_text}}
#end


Post a reply to this message

From: Chris Huff
Subject: Re: SV: Why doesn't this work (some #declare stuff)
Date: 30 Oct 1999 14:19:43
Message: <381B3754.B974ACCE@yahoo.com>
Why not something like this instead of duplicating all that prism code?:

prism{
    6,44,6 <0,0>,<0,0>,<40,0>,<20,-1.5>,<0,0>,<0,0>
    #if (Test)    linear_spline #else    cubic_spline #end
    texture {screen_text}
}


Post a reply to this message

From: Peter Hertel
Subject: SV: SV: Why doesn't this work (some #declare stuff)
Date: 31 Oct 1999 08:58:24
Message: <381c4b00@news.povray.org>
won't work... I think spline have to be at the start of prism..

Chris Huff <chr### [at] yahoocom> wrote in message
news:381B3754.B974ACCE@yahoo.com...
> Why not something like this instead of duplicating all that prism code?:
>
> prism{
>     6,44,6 <0,0>,<0,0>,<40,0>,<20,-1.5>,<0,0>,<0,0>
>     #if (Test)    linear_spline #else    cubic_spline #end
>     texture {screen_text}
> }
>


Post a reply to this message

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