|
|
I am tempted to call this a bug, but since the scene is simplistic, it is
perhaps that I am not aware of some default setting with side effect... Or I
just make illegal code :-)
I am trying to do a logo. The following code is an isolation of the problem:
-------8<------------------------------------
#version 3.5;
global_settings
{
ambient_light 1.5
assumed_gamma 0.6
}
background { color 1 }
camera
{
location <0, 0, -3>
look_at <0, 0, 0>
right x*image_width/image_height
}
#declare logoThickness = 0.01;
#declare logoColor = rgb <0, 0, 0.5>;
#declare logoText =
text { ttf "Arial.ttf" "OYO" logoThickness*3, 0 };
#macro CenterText(txt)
#local minTxt = min_extent(txt);
#local maxTxt = max_extent(txt);
translate -(minTxt + (maxTxt - minTxt) / 2)
#end
#macro CenterText(txt)
#local minTxt = min_extent(txt);
#local maxTxt = max_extent(txt);
(minTxt + (maxTxt - minTxt) / 2)
#end
difference
{
// Planet
cylinder
{
0, -logoThickness*y, 1
rotate 90*x
}
object
{
logoText
// CenterText(logoText)
translate <-CenterText(logoText).x, -0.5, -logoThickness>
}
pigment { color logoColor }
}
------------------------------------8<-------
In the given code state, the upper half of the first O is disappears, as if
the letter is cut in half by a bottom-left to top-right diagonal.
If you uncomment the CenterText line and comment the next one, the text is
OK.
Of course, I can use the second solution with an additional translation, but
I submit this code for an explaination of the phenomenon.
Comments?
-- #=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=# --
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
Post a reply to this message
|
|