POV-Ray : Newsgroups : povray.newusers : text manipulation+coordinates Server Time
5 Nov 2024 05:20:58 EST (-0500)
  text manipulation+coordinates (Message 1 to 4 of 4)  
From: me
Subject: text manipulation+coordinates
Date: 25 Jul 2002 23:05:45
Message: <20020725230822.7b717ddc.me@me.org>
If I have the file text.pov:

  #include "colors.inc"
  background {Blue}
  camera {
    location <0, 2, -10>
    look_at 0
    angle 35
  }
  light_source { <500,500,-1000> White }
  text {
    ttf "timrom.ttf" "probsd.ws" 0, 0
    pigment { Blue }
    translate -2*x
    translate 0.5*y
   }

This places the word probsd.ws in the center of the page. I cannot figure out
the coordinates to make probsd.ws so that it is vertical going from top right, to
bottom right.

Ex.

http://povray.org

where you see povray.org in transparent lettering


thx, michael


Post a reply to this message

From: Tom Melly
Subject: Re: text manipulation+coordinates
Date: 26 Jul 2002 07:34:16
Message: <3d4133b8$1@news.povray.org>
"me" <me### [at] meorg> wrote in message news:200### [at] meorg...
>
> This places the word probsd.ws in the center of the page. I cannot figure out
> the coordinates to make probsd.ws so that it is vertical going from top right,
to bottom right.
>

  text {
    ttf "timrom.ttf" "probsd.ws" 0, 0
    pigment { Blue }
    translate -2*x
    translate 0.5*y
    rotate z*-90 // puts it on it's side
    translate x*whatever // positive value to move it to the right
   }


Post a reply to this message

From: TinCanMan
Subject: Re: text manipulation+coordinates
Date: 26 Jul 2002 07:56:12
Message: <3d4138dc$1@news.povray.org>
Also, if you are using 3.5 you can centre the text better and automatically
using the min_extents/max_extents keyword.

Here's a macro I wrote a while ago to fit text to a certain area (scales the
text as well):

-----8<-----
//p1-p2 define box containing text
//FNam = font name
//Txt = text string
//Spac = letter spacing
#macro TxtFit(p1,p2,FNam,Txt,Spac)
  #local T1=text{ttf FNam, Txt, 1,Spac*x}
  #local TMn = min_extent (T1);
  #local TMx = max_extent (T1);
  #local TScal=(p2-p1)/(TMx-TMn);
  object{T1 translate -TMn scale TScal translate p1}
#end
-----8<-----

used like:

object{TxtFit(<-1,-1,0>,<2,1,1>,"arial","If the text fits...",0)
//extra transformations, materials, etc.
}

this fits the given text between the two points along the x-y plane.  You
can then rotate the text or translate as needed to suit.

-tgq


Post a reply to this message

From: me
Subject: Re: text manipulation+coordinates
Date: 26 Jul 2002 12:07:29
Message: <20020726121007.4b98b87c.me@me.org>
Thx for the info TinCanMan and Tom.  I just installed povray yesterday, so I'm
not sure how to use the macro.... but I'll read up on it.  I'm using 3.2
because 3.5 hasnt been ported to FreeBSD UNIX yet and thats the OS I am on.

Again, much Thx,
michael

On Fri, 26 Jul 2002 07:55:53 -0400
"TinCanMan" <Tin### [at] hotmailcom> wrote:

> Also, if you are using 3.5 you can centre the text better and automatically
> using the min_extents/max_extents keyword.
> 
> Here's a macro I wrote a while ago to fit text to a certain area (scales the
> text as well):
> 
> -----8<-----
> //p1-p2 define box containing text
> //FNam = font name
> //Txt = text string
> //Spac = letter spacing
> #macro TxtFit(p1,p2,FNam,Txt,Spac)
>   #local T1=text{ttf FNam, Txt, 1,Spac*x}
>   #local TMn = min_extent (T1);
>   #local TMx = max_extent (T1);
>   #local TScal=(p2-p1)/(TMx-TMn);
>   object{T1 translate -TMn scale TScal translate p1}
> #end
> -----8<-----
> 
> used like:
> 
> object{TxtFit(<-1,-1,0>,<2,1,1>,"arial","If the text fits...",0)
> //extra transformations, materials, etc.
> }
> 
> this fits the given text between the two points along the x-y plane.  You
> can then rotate the text or translate as needed to suit.
> 
> -tgq
> 
>


Post a reply to this message

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