POV-Ray : Newsgroups : povray.general : text on a cylinder : Re: text on a cylinder Server Time
5 Aug 2024 20:22:51 EDT (-0400)
  Re: text on a cylinder  
From: James Taylor
Date: 5 Aug 2002 07:43:13
Message: <3d4e64d1@news.povray.org>
thanks for the replies but I figured it out...heres my solution:

#macro Text_Cylinder(Text,Radius,Text_Size)
    #local fudge = 0.6;
    #local Length = strlen(Text);
    #local Width = Text_Space(font,Text, 1, 0);
    #local Angle = degrees(Text_Size/Radius*fudge)*Length;
    #local i=1;
    union {
    #while (i<=Length)
        #local temp_letter = substr(Text,i,1)
        text{
            ttf font,temp_letter,1*mm, 0
            scale Text_Size
            translate -Radius*z
            rotate -degrees(Text_Size/Radius*fudge)*y*i
            pigment{Black}
            finish{Glossy}
        }
        #local i=i+1;
    #end
    rotate -90*y
    rotate Angle/2*y  //centres text
    }
#end


but why do I need to introduce the "fudge" factor?

thanks
jim


Post a reply to this message

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