POV-Ray : Newsgroups : povray.newusers : Simple 2D text on a cylinder's surface : Re: Simple 2D text on a cylinder's surface Server Time
29 Jul 2024 02:22:46 EDT (-0400)
  Re: Simple 2D text on a cylinder's surface  
From: Leef me
Date: 23 Oct 2007 19:15:01
Message: <web.471e7f8cee0c3636892adb1d0@news.povray.org>
"Tim Attwood" <tim### [at] comcastnet> wrote:
> > Not having used the scroll object, I cannot say for certain if this will
> > work with it. You may want to try interior_texture. Since objects in POV
> > have two sides (inside, outside), there is a provision for texturing both
> > sides separately.
> >
> > Try something like this:
> >
> > object{ my_object
> >  texture{
> >   pigment{ my_text_pigment }
> >  }
> >  interior_texture{
> >   pigment{ no_text_pigment }
> >  }
> > }
>
> This should work fine, the scroll is a surface without a
> clearly defined inside... the back is the interior_texture.

Thanks Sam and Tim, and also to Gregjohn for his original question

I found out about interior_texture a little while ago by reading and
experiments

I found that I had to use keyword uv_mapping or the text was pixelated as
before

For anyone else, here is an example of a disc with text and background on
one side and background only on the other side


#declare my_text= text{   ttf"arialbd.ttf"      "This is a test"    1,0

  translate -z/2
// suggested by fellow pover Samuel Benge  Date: 21 Oct 2007 20:39:07
// Re: Simple 2D text on a cylinder's surface
  scale .2
  //rotate <0,0,90>
  translate<-.7,0,0>
   // when the Z rotation is 90, then these parameters are y,x,z
   // when the Z rotation is 0, then these parameters are x,y,z
}

disc {
  <0, 0, 0>  // center position
  y,         // normal vector
  1.0,       // outer radius

    uv_mapping
      texture {                     // one side has background and text
      pigment{
        pigment_pattern{
          object{my_text 0,1}
          }
        pigment_map{
            [0 color Black]
            [1 color White]
        }
      }
    }
    interior_texture {             // the other side has another background
      pigment {
            color Blue
        }
      }
    rotate x*-45
    rotate x*90*clock             // look at both sides of the disc
}

Leef_me


Post a reply to this message

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