POV-Ray : Newsgroups : povray.general : Center of Text-object Server Time
1 Aug 2024 14:27:04 EDT (-0400)
  Center of Text-object (Message 11 to 13 of 13)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: iceqb
Subject: Re: Center of Text-object
Date: 2 Dec 2005 07:15:00
Message: <web.43903a0f6a36f83a4426fcbb0@news.povray.org>
John VanSickle <evi### [at] hotmailcom> wrote:
> Try this:
>
> #local txtL=text { ttf FontName, "A",1,0 }
>
> object { txtL
>    translate -(min_extent(txtL)+max_extent(txtL))/2
> }

looks good, my code is a little dirtier:

----code
#macro WoodBlock(Letter, BlockColor)
 #declare LetObj = text {
  ttf "AdLibRg_.ttf", Letter, .2, 0
  rotate 90*y
  scale 1.5
  texture {
   pigment { BlockColor }
   finish { phong 1 }
   normal { Norm_W }
  }
 }
 #declare Center = max_extent(LetObj)-min_extent(LetObj);

 difference {
  object {
   IW_Plank_RoundW(18, 2, 2, 2, 4, 2, 0.1, 0.004, P_CM_IW_01, Fin_W, Norm_W,
1)
   translate -z-y
  }
  object {
   LetObj
   translate <-max_extent(LetObj).x , -Center.y , Center.z>/2
  }
 }
#end
----code

I used Christoph's IsoWood macros btw


Post a reply to this message

From: iceqb
Subject: Re: Center of Text-object
Date: 2 Dec 2005 07:15:00
Message: <web.43903aae6a36f83a4426fcbb0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   Correct.

Thanks for the help, you can view the final result here:
http://www.deviantart.com/view/25888579/


Post a reply to this message

From: iceqb
Subject: Re: Center of Text-object
Date: 2 Dec 2005 07:20:00
Message: <web.43903b796a36f83a4426fcbb0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> They're in 1.2, I've not checked 1.2.1 but it's very unlikely that
> functions would get deleted from a minor level change.

yep, I checked the documentation, still in.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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