POV-Ray : Newsgroups : povray.newusers : Text textures? : Re: Text textures? Server Time
29 Jul 2024 18:26:07 EDT (-0400)
  Re: Text textures?  
From: Mike Williams
Date: 19 May 2005 05:14:20
Message: <jSCL7BA5iFjCFw$B@econym.demon.co.uk>
Wasn't it Giuseppe Bilotta who wrote:
>Hello all,
>
>I definitively qualify as a newuser (heard about POV-Ray for the first
>time last summer on a conference on TeX), so I might have missed
>something obvious in the documentation, but for the heart of me I
>can't find a simple, immediate way to "stamp" some text on an object,
>esp. a curved one. For example: how would you write some text on a
>spherical surface?
>
>I've tried what seemed the most obvious thing, that is using an object
>pattern where the object was a text object, but the results are barely
>decent because the color alternation is based on the intersection with
>the object, so the curved surface isn't followed in all aspects.
>
>Is there some commonly used way to do it?
>


For objects that can be uv-mapped, you can create an object pattern and
uv-map that pattern onto the curved surface. 

  camera {location  <0,0,-20> look_at <0,0,0> angle 30}
  light_source {<-30, 100, -30> color rgb 1}

  #declare TEXT = text { ttf "crystal.ttf", "POV-Ray", 2, 0
                         scale 0.1 translate <0.57,0.6,-0.1> }
                                                
  #declare P = pigment { object {TEXT rgb <1,0,0> rgb <1,1,0>}}

  sphere {0,3 uv_mapping pigment {P}} 



For curved surfaces that have suitable map_types or can be uv_mapped,
you can create an image map of the text and use that as your pigment.

  sphere {0,3 pigment {image_map {jpeg "mytext.jpg" map_type 1 
          interpolate 2}}}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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