|
|
I am placing a simple text in my scene using the sample from the help like
this.
text {
ttf "timrom.ttf" "TEST TEXT" 1, 0
rotate x*90 scale 5
translate <-13, 0.5, 0>
pigment { Black }
}
My problem is that my reference is the lower left corner which makes it very
difficult to accurately position the text within the scene. I have a fair
bit of it to place :) Is there a way to get the centre or length and height
of the rendered string so as to calculate the centrepoint?
Thanks
Post a reply to this message
|
|
|
|
"David Instone" <d.i### [at] gmailcom> wrote:
> I am placing a simple text in my scene using the sample from the help like
> this.
>
> text {
> ttf "timrom.ttf" "TEST TEXT" 1, 0
> rotate x*90 scale 5
> translate <-13, 0.5, 0>
> pigment { Black }
> }
>
> My problem is that my reference is the lower left corner which makes it very
> difficult to accurately position the text within the scene. I have a fair
> bit of it to place :) Is there a way to get the centre or length and height
> of the rendered string so as to calculate the centrepoint?
>
> Thanks
A good enough result usually:
#declare TxtObj = text {ttf "timrom.ttf" "TEST TEXT" 1, 0}
#declare Min=min_extent(TxtObj);
#declare Max=max_extent(TxtObj);
#declare Ctr=(Min+Max)/2; //centre
#declare Ht=(Max.y-Min.y); //height
#declare Ln=(Max.x-Min.x); //length
....etc.
-tgq
Post a reply to this message
|
|