POV-Ray : Newsgroups : povray.binaries.images : Alphabet blocks : Re: Alphabet blocks Server Time
7 Aug 2024 07:17:51 EDT (-0400)
  Re: Alphabet blocks  
From: PM 2Ring
Date: 5 May 2006 03:15:00
Message: <web.445af6636490ad381bd1c060@news.povray.org>
Hello John, thanks for replying. It's fun playing with your blocks. :)

John VanSickle <evi### [at] hotmailcom> wrote:
> PM 2Ring wrote:
> > I've been playing with John VanSickle's old Alphabet Blocks include file
> >
> > http://www.erols.com/vansickl/povray.htm
>
> Ye goodness, that's an old post!  I haven't used that web site in over
> five years.  I've updated my macros to make use of the new SDL features.

Good to hear! At least the old Web address let me know you were the author.
What's your new Web address?

>   The new macro looks like this:
>
> #macro AlphaBlock(strL,colB)
> #local rR=.15;
> #local xW=1.5;
> #local yH=3;
> #local yB=0;
> #local letT=text { ttf "timrom.ttf",strL,.1,0 }
>
> #ifndef(BlockRand) #declare BlockRand=seed(0); #end
> #local transW=transform {
>    rotate <rand(BlockRand),rand(BlockRand),rand(BlockRand)>*10-5
>    translate <rand(BlockRand),rand(BlockRand),rand(BlockRand)>*10-5
> }
>
> union {
>    CutCylinder(<xW-rR,yH-rR,-1.5>,<xW-rR,yH-rR,1.5>,rR,0, x+y)
>    CutCylinder(<xW-rR,yB+rR,-1.5>,<xW-rR,yB+rR,1.5>,rR,0, x-y)
>    CutCylinder(<rR-xW,yH-rR,-1.5>,<rR-xW,yH-rR,1.5>,rR,0,-x+y)
>    CutCylinder(<rR-xW,yB+rR,-1.5>,<rR-xW,yB+rR,1.5>,rR,0,-x-y)
>    box { <rR-xW,yB,-1.5>,<xW-rR,yB+rR,1.5> }
>    box { <rR-xW,yH-rR,-1.5>,<xW-rR,yH,1.5> }
>    box { <-xW,yB+rR,-1.5>,<rR-xW,yH-rR,1.5> }
>    box { <xW-rR,yB+rR,-1.5>,< xW,yH-rR,1.5> }
>
>    box { <rR-xW,rR,-1.4>,<xW-rR,yH-rR, 1.4> }
>    object { letT translate (min_extent(letT)-max_extent(letT))*<.5,.5,0>
> scale 3 translate -z*1.5+y*1.5 }
>    object { letT translate (min_extent(letT)-max_extent(letT))*<.5,.5,0>
> scale <-3,3,-3> translate z*1.5+y*1.5 }
>    pigment {
>      gradient z translate -.5 scale 3
>      pigment_map {
>        [.02 colB]
>        [.02 wood
>          scale <.1,.1,1> transform transW
>          turbulence .05
>          color_map { [.5, rgb <1,.7,.4> ] [1, rgb <.7,.4,.1> ] }
>        ]
>        [.98 wood
>          scale <.1,.1,1> transform transW
>          turbulence .05
>          color_map { [.5, rgb <1,.7,.4> ] [1, rgb <.7,.4,.1> ] }
>        ]
>        [.98 colB ]
>      }
>    }
> }
> #end

That code looks familiar. :) BTW, where do we find CutCylinder()?

Also, is there any reason in particular that you dropped the ROT13 encoding
on the back letter? I like ROT13. :)

> It still uses the timrom.ttf font, but I am sure that the interested
> student could modify the macro to change it.

I'm sure they could. :) I've only been using horizontal centering, which
seems to work ok with all the fonts I've tried, at least with most
upper-case letters and numbers. Many lower-case letters & some punctuation
marks do need vertical centering to fit onto the block face properly, but I
didn't do this because then the letters don't line up properly in slabs of
text.

Here's an example of such a slab; a partial 'self-portrait'. I didn't notice
the mistake until after I rendered it. :)


Post a reply to this message


Attachments:
Download 'alphablocksf3s.jpg' (81 KB)

Preview of image 'alphablocksf3s.jpg'
alphablocksf3s.jpg


 

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