POV-Ray : Newsgroups : povray.binaries.images : Alphabet blocks : Alphabet blocks Server Time
7 Aug 2024 07:10:46 EDT (-0400)
  Alphabet blocks  
From: PM 2Ring
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


 

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