POV-Ray : Newsgroups : povray.binaries.images : Invitation: The Gate is Never Locked : Re: Invitation: The Gate is Never Locked Server Time
2 Aug 2024 20:20:34 EDT (-0400)
  Re: Invitation: The Gate is Never Locked  
From: Kirk Andrews
Date: 17 Jun 2007 20:10:02
Message: <web.4675cbe1753da728d9b8bbd0@news.povray.org>
> Kirk,
>
> It appears that I need a little help on your "image as function" code.  If I
> try to render the object (see below) POVray tells me this:
>
> {
>  function
>  {
>   GateF(x,y,z)
>  }
> Parse Error: Expected '.', } found instead
>
> Did I misunderstand your sample?
>
> -Allan

Pov is looking for "function {GateF(x,y,z).gray}"  It will always require
..gray or .red etc. if you are using a pigment function (including a
bitmap).

Here's my whole code for the gate:


#declare PGate =  //The bitmap pigment
pigment {
  image_pattern {
    jpeg "Gate/GateStructure4.jpg"
  }
}

#declare GateF =  //convert to function
function {
  pigment {PGate scale 10000*z}
}

#declare Gbumps =  //bumps applied
function {
  pigment {
    bumps
    scale .01
    color_map {
      [0 rgb 0]
      [1 rgb 1]
    }
  }
}

#declare GPlaneF =  //the pigment function is infinite in the z direction.
This limits it and allows for some rounding of the edges when combined with
the bumps pigment
function {
  pigment {
    gradient z
    color_map {
      [0.0 rgb 0]
      [0.1 rgb 1]
      [0.9 rgb 1]
      [1.0 rgb 0]
    }
    scale .1*z
  }
}

#declare IsoGate =
isosurface {
  function {(GateF(x,y,0).gray -.5 +
Gbumps(x,y,z).gray*.5)*GPlaneF(x,y,z).gray}
  contained_by { box { 0, <1,.999,.05> } }
  accuracy 0.001
  max_gradient 35
  scale 2*y
  translate -1*x
  translate 1*x
}


Post a reply to this message

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