|
 |
In article <3a3bb953$1@news.povray.org>, "Dave Blandston"
<gra### [at] earthlink net> wrote:
> I've been trying to use the matrix keyword to make beveled text, without
> much luck. Although I did get some nice italic text. Has anyone ever made
> beveled text before?
You can not make beveled text with the matrix keyword alone, the closest
you can get is shearing (slanting) it. However, you might try an
intersection of several text objects, each sheared in a different
direction. I'll try to work up a useful macro for this.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|
 |
In article <chrishuff-9E96F6.16095916122000@news.povray.org>, Chris
Huff <chr### [at] mac com> wrote:
> I'll try to work up a useful macro for this.
It's not perfect (it has problems with some sharp corners), but it works.
BevelText(String, Cuts, BevelAng, BevelDepth, Depth, Offset)
String: the text string
Cuts: the number of "cuts" to use to get the bevel effect.
BevelAng: the angle of the bevel.
BevelDepth: the thickness of the bevelled portion.
Depth: the total thickness of the text object
Offset: the offset vector for the text object. Might screw stuff up...
#macro Shear(A, B, C)
matrix < A.x, A.y, A.z,
B.x, B.y, B.z,
C.x, C.y, C.z,
0, 0, 0>
#end
#macro BevelText(String, Cuts, BevelAng, BevelDepth, Depth, Offset)
union {
text {ttf "crystal.ttf", String Depth-BevelDepth, Offset}
intersection {
#local J=0;
#while(J<Cuts)
#local A = 2*pi*J/(Cuts);
#local CA = cos(radians(BevelAng));
#local SA = sin(radians(BevelAng));
text {ttf "crystal.ttf", String BevelDepth, Offset
translate -z*(BevelDepth+J*0.0001)
Shear(x, y, < cos(A)*SA, sin(A)*SA, CA>/CA)
}
#local J=J+1;
#end
}
translate z*BevelDepth
}
#end
object {BevelText("POV", 6, 45, 0.02, 0.3, 0)
texture {
pigment {color White}
finish {
specular 1 roughness 0.02
metallic reflect_metallic
diffuse 0.7 ambient 0 reflection 0.25
}
}
}
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |