POV-Ray : Newsgroups : povray.newusers : Newbie texture syntax problems Server Time
27 Nov 2024 10:49:56 EST (-0500)
  Newbie texture syntax problems (Message 1 to 5 of 5)  
From: ZSpider
Subject: Newbie texture syntax problems
Date: 5 Jan 2003 09:08:08
Message: <3e183c48@news.povray.org>
Good morning,

Newbie here.  I've been going through an old pov script for the Enterprise
and updating the code so it works in 3.5.  Mostly what I have been doing
is tacking semicolons on declare statements and adding the pigment keyword
to textures to make the color fly right.  But now I've run into something
that
I can't get to work.  Here is the code:


#declare Line = texture
   { gradient <0 0 1>
     color_map
      { [0      0.0005 color Gridgray color Gridgray]
        [0.0005 1      color Clear    color Clear   ]
      }
      scale <1 1 25>
   }
#declare Saucer_top_texture = texture
   { Line
     color_map
       { [0      0.0005 color Gridgray color Gridgray]
         [0.0005 1      color Hullcol  color Hullcol ]
       }
     specular layer_specular
   }

I've messed with it and can't get it right.  The first thing I did was
enclose
the gradiant and color map in the Line texture inside a set of pigment
braces,
like this:

#declare Line = texture
   { pigment
       { gradient <0 0 1>
         color_map
           { [0      0.0005 color Gridgray color Gridgray]
             [0.0005 1      color Clear    color Clear   ]
           }
       }
     scale <1 1 25>
   }

That allowed that statement to work, but it hung on the next one.  Looking
at the old 3.1g documentation, I believe that the second statement is merely
a layered texture.  And reading 2.7.10.1 Declaring Layered Textures gave
me the impression that leaving off the texture wrapper in the second state-
ment was my problem.  I've been fooling with it for an hour now and I can't
get it to run.

Any help would be appreciated.

Thanks, Miker


Post a reply to this message

From: Ib Rasmussen
Subject: Re: Newbie texture syntax problems
Date: 5 Jan 2003 11:35:01
Message: <3E185EE4.7030804@ibras.dk>
ZSpider wrote:

I think you just need some commas:

 #declare Line = texture
    { pigment
        { gradient <0, 0, 1>
          color_map
            { [0,      0.0005 color Gridgray color Gridgray]
              [0.0005, 1      color Clear    color Clear   ]
            }
        }
      scale <1, 1, 25>
    }


/Ib


Post a reply to this message

From: Peter Hertel
Subject: Re: Newbie texture syntax problems
Date: 5 Jan 2003 14:52:53
Message: <3e188d15@news.povray.org>
Hi!
I rewrote the code to 3.5 syntax. Is this what you need?

#declare Line =
texture{
    pigment {
        gradient z // <0,0,1>
        color_map {
            [0      color Gridgray]
            [0.0005 color Clear]
        }
        scale <1,1,25>
    }
}

#declare Saucer_top_texture =
texture {Line}
texture {
    pigment {
        gradient z // ??
        color_map{
            [0 color Gridgray]
            [0.0005 color Hullcol]
        }
    }
finish {specular layer_specular}
}

This could of course be done in several ways.. I rewrote it the way you did,
but I'd prefer to do it like this:

#declare Texture1 = texture {...}
#declare Texture2 = texture {...}
#declare Layered_Texture =
texture {Texture1}
texture {Texture2}

or

#declare Layered_Texture =
texture {...}
texture {...}

A better way, IMHO!
Note that I haven't tried the texture on an object, but it parses. (You have
to #declare Gridgray.. etc. Of course.)
I reccomend DOC reading for color_map :  "6.7.1.3 Color maps"

Hope this helped.

-Peter


Post a reply to this message

From: ZSpider
Subject: Re: Newbie texture syntax problems
Date: 6 Jan 2003 07:10:06
Message: <3e19721e$1@news.povray.org>
Thank you, Ib and Peter.  You guys got me back on the road again!
I need to look over what you sent me and figure out why yours
worked and mine didn't.  I've found that some of the old files take
quite a bit of reworking to make them 3.5-compatible!

Thanks again, Miker


Post a reply to this message

From: ZSpider
Subject: Re: Newbie texture syntax problems
Date: 6 Jan 2003 11:58:47
Message: <3e19b5c7@news.povray.org>
Well, bad news.  I finally had to give up on converting the Enterprise
model to 3.5.  There were a huge amount of textures, and apparently
the syntax has changed quite a bit over the years.  Besides the problems
I already outlined, I started running into problems with image maps in
the textures, which I believe has been changed over to a material map.
It comes down to textures containing a pretty complex set of parameters,
and as a newbie it was just too much for me.

Thanks anyway, Miker


Post a reply to this message

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