POV-Ray : Newsgroups : povray.binaries.images : Alphabet blocks Server Time
7 Aug 2024 09:26:32 EDT (-0400)
  Alphabet blocks (Message 1 to 10 of 10)  
From: PM 2Ring
Subject: Alphabet blocks
Date: 3 May 2006 05:50:01
Message: <web.44587a7c5c65107776ba2c900@news.povray.org>
I've been playing with John VanSickle's old Alphabet Blocks include file
that was posted a few days back in scene-files, in the 'blocks.inc' thread.
As I mentioned in that thread, some letters don't line up properly using the
"timrom.tff" font on my Windows 2000pro system.

I started doing minor adjustments, but then I decided that a major revision
using modern syntax would simplify it and make it easier to use a different
font, if desired.

I'll post a couple of examples of my progress now, and would be interested
in any feed back. I'll eventually post the new AlphaBlocks.inc file back in
the original thread, with a scene file or two.

For now, here's the header:

----------------------------------------------------------------------------
Alphabet Blocks

This file creates wooden blocks with letters of the alphabet on them.
Each defined block has one letter on its front (+z) side and its ROT13
equivalent letter on the -z side. For instance, BlockA and Block N have both
A and N on a side. This is not entirely redundant because BlockA and BlockN
come with different pigments. This file uses the TIMROM.TTF font by default,
but you can use a different one if you want, although the letters might not
align properly with other fonts.
   The blocks are one unit cubes, with their bottom on the y=0 plane,
centered on the y-axis. They are designed for the left-hand coordinate
system, in which y is up.

http://www.erols.com/vansickl/povray.htm

----------------------------------------------------------------------------

Updated by PM 2Ring, commencing 2006.04.30

Uses modern SDL features such as macros, loops, arrays, locals, etc.
Uses text object extent to center each letter automatically, so other
fonts may work better now.
Uses clipping on each text object to prevent overhangs.
Objects now more fully parametrized

This file provides the same functionality as John's original "blocks.inc",
with blocks declared as BlockA through to BlockZ, but it also puts the
blocks into an array called Blocks for easier access.
The separate pigments identifiers have been dropped, but they are available
through an array called Paints.

Parameters
----------

You can easily use a different font or woodgrain. Just declare them like
this:
 #declare BlockFont = "myfont.tff";
 #declare Woody = MyWoodPigment;
before including this file.

----------------------------------------------------------------------------

Here's an illustration of my current best results, using radiosity.


Post a reply to this message


Attachments:
Download 'alphablocksda8s.jpg' (142 KB)

Preview of image 'alphablocksda8s.jpg'
alphablocksda8s.jpg


 

From: PM 2Ring
Subject: Re: Alphabet blocks
Date: 3 May 2006 06:20:01
Message: <web.4458826a6490ad3876ba2c900@news.povray.org>
> I'll post a couple of examples of my progress now, and would be interested
> in any feed back.

Here's one using wobbly text placement.


Post a reply to this message


Attachments:
Download 'alphablockse2.jpg' (85 KB)

Preview of image 'alphablockse2.jpg'
alphablockse2.jpg


 

From: PM 2Ring
Subject: Re: Alphabet blocks
Date: 3 May 2006 06:25:00
Message: <web.4458845d6490ad3876ba2c900@news.povray.org>
Here's the link to the original thread. Sorry, I meant to post this in the
first message.

http://news.povray.org/povray.text.scene-files/thread/%3C444d3938%241%40news.povray.org%3E/

And here are some blocks using comic.ttf.


Post a reply to this message


Attachments:
Download 'alphablocksdb1.jpg' (29 KB)

Preview of image 'alphablocksdb1.jpg'
alphablocksdb1.jpg


 

From: PM 2Ring
Subject: Re: Alphabet blocks
Date: 3 May 2006 11:25:01
Message: <web.4458c8106490ad381bd1c060@news.povray.org>
These simple children's blocks are starting to get a little bit complex. :)

I've begun work on a new version, which also has number blocks. I've been
thinking of doing punctuation marks, too. Kids these days are exposed to
punctuation marks on keyboards before they learn to write, so why not put
them on blocks? Also, once we have the full ASCII set we can do general
text-to-blocks conversion.

As well as the number blocks, the latest version uses full textures, not
just pigments, and provides simple macros to select a block by its front
char as a string or as an ASCII value.

I've commented the include file extensively, but I think I'd like to retain
the simpler version as well, so that newcomer's aren't scared off when
looking at the code.

Attached is an example of the number blocks, just using the default font and
texture.


Post a reply to this message


Attachments:
Download 'alphablocksa3.jpg' (29 KB)

Preview of image 'alphablocksa3.jpg'
alphablocksa3.jpg


 

From: John VanSickle
Subject: Re: Alphabet blocks
Date: 4 May 2006 19:20:40
Message: <445a8c48$1@news.povray.org>
PM 2Ring wrote:
> I've been playing with John VanSickle's old Alphabet Blocks include file
> that was posted a few days back in scene-files, in the 'blocks.inc' thread.
> As I mentioned in that thread, some letters don't line up properly using the
> "timrom.tff" font on my Windows 2000pro system.
> 
> I started doing minor adjustments, but then I decided that a major revision
> using modern syntax would simplify it and make it easier to use a different
> font, if desired.
> 
> I'll post a couple of examples of my progress now, and would be interested
> in any feed back. I'll eventually post the new AlphaBlocks.inc file back in
> the original thread, with a scene file or two.
> 
> For now, here's the header:
> 
> ----------------------------------------------------------------------------
> Alphabet Blocks
> 
> This file creates wooden blocks with letters of the alphabet on them.
> Each defined block has one letter on its front (+z) side and its ROT13
> equivalent letter on the -z side. For instance, BlockA and Block N have both
> A and N on a side. This is not entirely redundant because BlockA and BlockN
> come with different pigments. This file uses the TIMROM.TTF font by default,
> but you can use a different one if you want, although the letters might not
> align properly with other fonts.
>    The blocks are one unit cubes, with their bottom on the y=0 plane,
> centered on the y-axis. They are designed for the left-hand coordinate
> system, in which y is up.
> 
> 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. 
  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

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

Regards,
John


Post a reply to this message

From: PM 2Ring
Subject: Re: Alphabet blocks
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


 

From: John VanSickle
Subject: Re: Alphabet blocks
Date: 5 May 2006 22:07:03
Message: <445c04c7$1@news.povray.org>
PM 2Ring wrote:

> 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?

It turns out that while I updated my macros, I never got around to 
uploading the update to my new site.

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

Ach!  CutCylinder is found in my Thoroughly Useful Macros:

   http://enphilistor.50megs.com/macs.htm

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

Probably because the new macro accepts only one letter, and I was too 
lazy at the moment to write ROT13 code, and since most of the time only 
one side is visible, it doesn't matter much.

>>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.

I've noticed that real-world alphabet blocks have an upper case letter 
on one painted side, the ROT13 on the other side, the lower case 
versions letters burned into two of the four unpainted sides, and a 
picture of something starting with the two letters burned into the two 
remaining sides.  Sometimes the background of the painted sides is 
painted white.

When I updated the macro, I decided to make the color a user option, 
even though in a set of real-world blocks, a given letter usually has 
the same color throughout the set.  This was for artistic reasons, 
because if every 4th block has the same color, then A, E, I, M, N, R, V 
and Z will be colored the same in ROT13 blocks, and that results in too 
much of that color.

Regards,
John


Post a reply to this message

From: PM 2Ring
Subject: Re: Alphabet blocks
Date: 6 May 2006 15:35:00
Message: <web.445cf94a6490ad3876ba2c900@news.povray.org>
John VanSickle <evi### [at] hotmailcom> wrote:
> PM 2Ring wrote:
> >>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?
>
> It turns out that while I updated my macros, I never got around to
> uploading the update to my new site.

But whaere is that new site, John?! I tried Googling with your name & POV,
but I got too many hits. :)

> > That code looks familiar. :) BTW, where do we find CutCylinder()?
>
> Ach!  CutCylinder is found in my Thoroughly Useful Macros:
>
>    http://enphilistor.50megs.com/macs.htm

Ta.

> > Also, is there any reason in particular that you dropped the ROT13 encoding
> > on the back letter? I like ROT13. :)
>
> Probably because the new macro accepts only one letter, and I was too
> lazy at the moment to write ROT13 code, and since most of the time only
> one side is visible, it doesn't matter much.

Ok, I'll pay that. I find it pretty hard to read the back of your original
blocks anyway, unless the light's at a fairlty high angle.

>
> I've noticed that real-world alphabet blocks have an upper case letter
> on one painted side, the ROT13 on the other side, the lower case
> versions letters burned into two of the four unpainted sides, and a
> picture of something starting with the two letters burned into the two
> remaining sides.  Sometimes the background of the painted sides is
> painted white.

That sounds right. I thought about doing the pictures on the sides; it
shouldn't be too hard to find something suitable. But another idea I had
was putting a picture on one side in the form of a mini-photo (complete
with old-fashioned white frame). I'm making some pictures for my sisters,
with a 'photo' of each of their children stuck onto a block bearing their
initial.

> When I updated the macro, I decided to make the color a user option,
> even though in a set of real-world blocks, a given letter usually has
> the same color throughout the set.  This was for artistic reasons,
> because if every 4th block has the same color, then A, E, I, M, N, R, V
> and Z will be colored the same in ROT13 blocks, and that results in too
> much of that color.

Good idea. Colour should be balanced in a toy like this. Also, for my little
niece Ruby, I definitely *have* to use a red or pink block. :) She has a
very pink complexion and flaming red hair.

<Offtopic>
I spent a bit of time memorizing ROT13 (back in the days of Fidonet), so I
can read & write it pretty fast, once I warm up. I invented a word game
called rotagrams to help me practise. Try to construct a word or phrase,
such that when you ROT13 it, you can rearrange the letters to make the
original word or phrase. Or for even more fun, try to make a different word
or phrase.

Gnxr pner, Wbua!


Post a reply to this message

From: PM 2Ring
Subject: Re: Alphabet blocks
Date: 11 May 2006 02:20:00
Message: <web.4462d6ac6490ad3876ba2c900@news.povray.org>
John VanSickle <evi### [at] hotmailcom> wrote:
> PM 2Ring wrote:

> > That code looks familiar. :) BTW, where do we find CutCylinder()?
>
> Ach!  CutCylinder is found in my Thoroughly Useful Macros:
>
>    http://enphilistor.50megs.com/macs.htm

That site won't let me DL the macro zip. I get this message:

"You do not have permission to access http://enphilistor.50megs.com/macs.zip
Data files must be stored on the same site they are linked from."


Post a reply to this message

From: John VanSickle
Subject: Re: Alphabet blocks
Date: 11 May 2006 17:56:20
Message: <4463b304$1@news.povray.org>
PM 2Ring wrote:

> John VanSickle <evi### [at] hotmailcom> wrote:
> 
>>PM 2Ring wrote:
> 
> 
>>>That code looks familiar. :) BTW, where do we find CutCylinder()?
>>
>>Ach!  CutCylinder is found in my Thoroughly Useful Macros:
>>
>>   http://enphilistor.50megs.com/macs.htm
> 
> 
> That site won't let me DL the macro zip. I get this message:
> 
> "You do not have permission to access http://enphilistor.50megs.com/macs.zip
> Data files must be stored on the same site they are linked from."

Try the mirror:

   http://www.geocities.com/evilsnack/macs.htm

The 50megs site has given people a lot of trouble when trying to 
download stuff.

Regards,
John


Post a reply to this message

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