POV-Ray : Newsgroups : povray.windows : I am new to POV Ray : Re: I am new to POV Ray Server Time
28 Jul 2024 10:22:55 EDT (-0400)
  Re: I am new to POV Ray  
From: Ken
Date: 4 Jul 1999 22:00:33
Message: <37801170.944F3FE0@pacbell.net>
Travis Barton wrote:
> 
> Ken,
>     How do I add text to my graphics?  Also, what all can I do with that
> text?  Thanks again.
>                     Travis

              Ken's quick tutorial for using the Pov text object

  First let's start with the basic syntax of the text object. One of the
things that confuses most people is that htey try to use one of the fonts
that is in their windows font directory. If you try this make sure that
you provide the fullo path to the directory that your windows fonts are
in or Pov will not be able to find them.

e.g.  text { ttf "c:\windows\fonts\myfont.ttf" 1,0 }


 Render the following to see how the basic text object looks.


  camera       { location < 0, 0, -5> look_at 0}
  light_source { <-10,10,-30> rgb 1}

  text         { ttf "timrom.ttf" "POV" .5,0 translate x*-.9 pigment { rgb 2}}
  background   { rgb .35}



  The next example shows how to add raised text to another objects surface.

  camera       { location < 0, 0, -5> look_at 0}
  light_source { <-10,10,-30> rgb 1}
  
  union        {
    box        { -1,1  scale<1.25,1,.25>translate <0,.5,.5> pigment { red 1}}
   text        { ttf "timrom.ttf" "POV" .5,0 translate x*-1 pigment { rgb 2}}
               }
  background   { rgb .35}



  This last example shows how to subtract text from another object using a
CSG operation.


  camera       { location < 0, 0, -5> look_at 0}
  light_source { <-10,10,-30> rgb 1}

  difference   {
  box          { -1,1  scale<1.25,1,.25>translate <0,.5,.5>     pigment { red 1}}
  text         { ttf "timrom.ttf" "POV" .5,0 translate x*-1 pigment { rgb 2}}
               }
  background   { rgb .35}


  The above three examples show how to use the internal Pov text object but
there is another method for adding any kind of picture or text to an object
using the image map operation. This will require you to supply your own image
for the code below to work. Your best bet is to go into a paint program that
has a text feature, spell whatever you want over a background color of your
choice, and then save it as a .gif file called text.gif.

  camera       { location < 0, 0, -5> look_at 0}
  light_source { <-10,10,-30> rgb 1}

       box { -0.5, 0.5
   pigment {
 image_map { gif "text.gif" interpolate 2 }
             translate -0.5
           }
             scale<2.5, 2, 2.5>
           }


  With the text object this next suggestion is a bit redundant but there
are time is has it's attraction. There is a program called Elefont that
offers a few different text manipulation abilities you will not be able
to do in pov. On of these is the ability to bevel text among other things.
It has direct support for Pov file format. You can download a copy at:

http://www.armanisoft.ch/

  Be sure to check out the other utility called spiralizer while you are
there. It is a pretty trick little tool.



  The last and least desirable method is to take your completed image into
a paint program and add it in as a post processing step. Purest Pov artist
stick their nose up at people that do this but to each their own.


-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

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