![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Jessica Bushnaq wrote:
>
> Especially: Is there a method to get the exact width of a given
> character?
I have only the official version, and here's the code I use to get the
width of text:
// START OF SOMETHING OF POSSIBLE USE
#local W=1; // you'll be tweaking this value
text { ttf "cyrvetic.ttf", // or whatever font you're using
"My text.", // change to whatever you're using
0,
0
pigment { rgb <1,0,0> } // to make things obvious
finish { ambient 1 diffuse 0 }
translate -z*.001
}
plane { -z,0
pigment { gradient x color_map { [0 rgb 0][1 rgb 1] } scale W }
finish { ambient 1 diffuse 0 }
}
camera {
orthographic
location <W,.375,-1>
look_at <W,.375,0>
}
// END OF SOMETHING OF POSSIBLE USE
You should see an image that is white on the left side and black on
the right, with red text. Adjust W until the right edge of the text
lies exactly on the border between the black and white areas. When
this happens, W is either the exact width of the text, or is a simple
fraction (1/2, 1/3, 1/4) of that width; starting with a higher value
and working your way down will give better results.
Hope this helps,
John
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
John VanSickle wrote:
>You should see an image that is white on the left side and black on
>the right, with red text. Adjust W until the right edge of the text
>lies exactly on the border between the black and white areas. When
>this happens, W is either the exact width of the text, or is a simple
>fraction (1/2, 1/3, 1/4) of that width; starting with a higher value
>and working your way down will give better results.
This makes me think, if your intention is to put the letters on the same
positions as they are in the "full text", you could as well use a
pigment_map or texture_map with a gradient to give each letter a different
texture.
text {
ttf
"crystal.ttf",
"POV",
0.1,
0
pigment {
gradient x
scale 2
pigment_map{
[0.2, wood]
[0.2, granite]
[0.5, granite]
[0.5, wood]
}
}
translate <-0.75,0,0>
}
Ingo
--
Photography: http://members.home.nl/ingoogni/
Pov-Ray : http://members.home.nl/seed7/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Chris Huff wrote:
> A more flexible(and far simpler) solution would be to use a separate
> text object for every character and use the min_extent() and
> max_extent() functions to get the bounding box for each individual
> character, and use these values to position the characters correctly.
I'm trying to get a text string centered, and I remembered this thread.
Chris, can I use min_extent() and max_extent() on a string, or is it
only applicable to single characters? Where can I find documentation on
these functions; it doesn't seem to be with the other text primitive
documentation in the official docs.
For that matter, if the function is not part of POV natively, where can
I find the function?
Thanks in advance.
--
Dawn McKnight | "Who cares what the hipbone's connected to? I'm in Neurology!"
McK### [at] mac com | -- Justine Devlin, M.D.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Tue, 21 Nov 2000 21:16:03 -0700, Dawn McKnight wrote:
>I'm trying to get a text string centered, and I remembered this thread.
>Chris, can I use min_extent() and max_extent() on a string, or is it
>only applicable to single characters?
It will work with almost any finite primitive, which includes a multicharacter
text object. It fails on some CSGs, though; most notably on intersections and
differences.
>For that matter, if the function is not part of POV natively, where can
>I find the function?
It's part of MegaPOV and other patches like it.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Wasn't it Dawn McKnight who wrote:
>
>
>Chris Huff wrote:
>
>> A more flexible(and far simpler) solution would be to use a separate
>> text object for every character and use the min_extent() and
>> max_extent() functions to get the bounding box for each individual
>> character, and use these values to position the characters correctly.
>
>I'm trying to get a text string centered, and I remembered this thread.
>Chris, can I use min_extent() and max_extent() on a string, or is it
>only applicable to single characters? Where can I find documentation on
>these functions; it doesn't seem to be with the other text primitive
>documentation in the official docs.
>
>For that matter, if the function is not part of POV natively, where can
>I find the function?
Text centring is directly available in MegaPOV. Just add the
"align_center" modifier to the text object.
You only need to use MegaPOV's "min_extent()" and "max_extent()" if
you're doing more complicated positioning tasks.
The *_extent functions are described in section 9.1 (Bounds Patch) of
the MegaPOV 0.6 docs, and align_* are in section 6.6 (Text Object
Enhancements).
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Mike Williams wrote:
>
> Wasn't it Dawn McKnight who wrote:
Why yes, it was... thank you for noticing! P)
> Text centring is directly available in MegaPOV. Just add the
> "align_center" modifier to the text object.
Sadly, that requires me to download MegaPOV, install it, figure out
where it's different from standard POV, so that I don't get
unpredictable results in my scene files, read the docs on text, etc., etc.
Of course, I probably will do this, eventually, but it's really rather
more involved than I wanted to get for what is basically a throw-away
test on a concept.
Thank you for letting me know this, and for your citation on where the
documentation is... I'll be very grateful when I get around to doing all
that stuff. 8)
--
Dawn McKnight | "Who cares what the hipbone's connected to? I'm in Neurology!"
McK### [at] mac com | -- Justine Devlin, M.D.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Dawn McKnight wrote:
> Sadly, that requires me to download MegaPOV, install it, figure out
> where it's different from standard POV, so that I don't get
> unpredictable results in my scene files, read the docs on text, etc., etc.
>
> Of course, I probably will do this, eventually, but it's really rather
> more involved than I wanted to get for what is basically a throw-away
> test on a concept.
For all intents and purposes you should be able to use Megapov
with little or no extra knowlege other than learning it's extra
feature sets. It is basically the same as the official version
with enhancements.
--
Ken Tyler
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Thu, 23 Nov 2000 16:33:02 +0000, Mike Williams wrote:
>Text centring is directly available in MegaPOV. Just add the
>"align_center" modifier to the text object.
Note that this won't be directly supported in POV 3.5.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Ron Parker wrote:
> Note that this won't be directly supported in POV 3.5.
Will there be any text handling improvements in 3.5?
--
Dawn McKnight | "Who cares what the hipbone's connected to? I'm in Neurology!"
McK### [at] mac com | -- Justine Devlin, M.D.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Fri, 24 Nov 2000 08:11:19 -0700, Dawn McKnight wrote:
>
>
>Ron Parker wrote:
>> Note that this won't be directly supported in POV 3.5.
>
>Will there be any text handling improvements in 3.5?
The min_extent and max_extent functions will make it in, and we'll likely
provide macros to give the same functionality as the MegaPOV text alignment
keywords provide.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |