POV-Ray : Newsgroups : povray.general : Strange result: text is cut Server Time
5 Aug 2024 18:20:23 EDT (-0400)
  Strange result: text is cut (Message 1 to 5 of 5)  
From: Philippe Lhoste
Subject: Strange result: text is cut
Date: 2 Aug 2002 11:28:11
Message: <3d4aa50b@news.povray.org>
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

From: Philippe Lhoste
Subject: Re: Strange result: text is cut
Date: 2 Aug 2002 11:31:16
Message: <3d4aa5c4$1@news.povray.org>
Send to fast :-(

> -------8<------------------------------------
> #macro CenterText(txt)
>   #local minTxt = min_extent(txt);
>   #local maxTxt = max_extent(txt);
>   translate -(minTxt + (maxTxt - minTxt) / 2)
> #end
>
> #macro CenterText(txt)

Make it:
#macro GetCenterOfText(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>

Make it:
    translate <-GetCenterOfText(logoText).x, -0.5, -logoThickness>

>   }
>   pigment { color logoColor }
> }
> ------------------------------------8<-------

Sorry.


Post a reply to this message

From: TinCanMan
Subject: Re: Strange result: text is cut
Date: 2 Aug 2002 11:35:19
Message: <3d4aa6b7$1@news.povray.org>
What you have here is a coincident surface problem

Change:
    translate <-CenterText(logoText).x, -0.5, -logoThickness>
to
    translate <-CenterText(logoText).x, -0.5, -logoThickness*2>



-tgq


Post a reply to this message

From: Philippe Lhoste
Subject: Re: Strange result: text is cut
Date: 2 Aug 2002 12:40:45
Message: <3d4ab60d@news.povray.org>
"TinCanMan" <Tin### [at] hotmailcom> wrote:
> What you have here is a coincident surface problem
>
> Change:
>     translate <-CenterText(logoText).x, -0.5, -logoThickness>
> to
>     translate <-CenterText(logoText).x, -0.5, -logoThickness*2>

Thank you very much. I though I took care of these, and that they always
resulted in "dust" artifcacts...
Obviously, I still have to make some progress in visualizing mentally
rotations and translations...
Mmm, actually, I should have done a rotate -90*x to get the effect I wanted
(the face of the cylinder on the y-x plane). Thank you for giving me the
hint about coincident surface!

Regards.

-- #=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=# --
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/


Post a reply to this message

From: ABX
Subject: Re: Strange result: text is cut
Date: 2 Aug 2002 13:18:44
Message: <rhflkust74bj1kr1393uq9qbhvo36aa7c6@4ax.com>
On Fri, 2 Aug 2002 17:27:24 +0200, "Philippe Lhoste" <Phi### [at] GMXnet> wrote:
> Of course, I can use the second solution with an additional translation, but
> I submit this code for an explaination of the phenomenon.
> Comments?

Yes. If possible use macros from standard include files. There is too much
identifiers to remember? Check http://www.abx.art.pl/pov/bonus :-)

ABX


Post a reply to this message

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