POV-Ray : Newsgroups : povray.binaries.images : object_pattern fun : Re: object_pattern fun Server Time
20 Apr 2024 03:48:36 EDT (-0400)
  Re: object_pattern fun  
From: Bald Eagle
Date: 16 Oct 2019 13:50:01
Message: <web.5da75784a64722ab4eec112d0@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:

> ... layered
> textures cannot make use of any patterned one (as object patterns
> obviously are). The only way I see would be to use separate CSG object
> layers with an extremely thin interface.


I made some signs for a W that's still IP, maybe you can play with the code and
see about expanding on it for your own purposes.


#macro LetterSign (_Letter, _Color)
 #local SignWidth = 38;
 #local SignHeight = 24;
 #local TextScale = 22;
 #local RoundSquare = intersection {
  box {<-SignWidth/2, -SignHeight/2, -0.01>, <SignWidth/2 , SignHeight/2,
-0.125>}
  object {Round_Box(<-SignWidth/2, -SignHeight/2, -1>, <SignWidth/2,
SignHeight/2, 1>, 2   , 0) scale <1, 1, 1>}
 }

 #local Border = difference {
  object {RoundSquare scale <0.9, 0.9, 1.1>}
  object {RoundSquare scale <0.8, 0.8, 2>}
 }

 #local Object1 = text {ttf "GILB____.TTF", _Letter, 1, <0, 0> scale TextScale
translate <-8, -7, -0.5>}
 #local Object2 = object {Border}

 #local Texture1 =
 texture {
  pigment {
   object {Object1
   color rgb <1, 1, 1>*0.5 // outside
   color rgb _Color //color rgb <1, 0, 0>*0.5 // inside
   } // object
  } // pigment
 }
 #local Texture2 =
 texture {
  pigment {
   object {Object2
   color rgbf <1, 1, 1, 1>   // outside
   color rgb _Color //color rgb  <0, 1, 0>*0.05 // inside
   } // object
  } // pigment
 }
 object {RoundSquare texture {Texture1} texture {Texture2} translate y*12}

#end // end macro LetterSign


Post a reply to this message

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