POV-Ray : Newsgroups : povray.newusers : FONT3D face and side pigment : Re: FONT3D face and side pigment Server Time
6 Sep 2024 14:17:10 EDT (-0400)
  Re: FONT3D face and side pigment  
From: Johannes Hubert
Date: 28 Mar 1998 04:43:47
Message: <351CC653.2D31E894@penttech.com>
Richard Keuneke wrote:

> I've used FONT3D to create a 3-d font and am having trouble with
> making the face and side pigments in different colors.

First, change your understanding of textures in POV-Ray: Textures are
not "wallpaper" that is glued to some surface. You can not define a
texture for a surface. Instead, textures are more comparable to a
"material" and the objects are "carved out" of this material:
If you have for example a red plastic-like texture, don't think of it as
big red plastic sheets from that you cut out your surfaces which you
then use to cover your object's surfaces, but instead think of it as a
huge block of red plastic material, occupying all 3D space, only that
everything is chipped and carved "away" until only the object(s) you use
the texture on is/are left.

With this in mind you see, that you can not define different textures
for different faces of a 3D font.

Hey, but there is help!
Make a gradient map texture with two colors. One color occupies only a
very thin layer at the beginning of the gradient, the other color
occupies the rest. The direction of the gradient is the same direction
as the extrusion direction ("depth") of your font. Then apply the
texture to the font-object in such a way, that the thin layer of color1
colors the front face.
Here some code (not tested!) that gives you a thin layer of black
material on the x/y plane with the rest of the space in positive and
negative Z direction occupied by white material. Only remember:
Gradients are repeated after one unit, so actually you will have a black
layer at z position 0, 1, 2, ... and -1, -2, ... So if your font is
"thicker" than 1 unit, you may have to scale the texture and probably
also translate it a little to whatever position fits best. And maybe you
have to use a x or y gradient instead...

texture {
  pigment {
    gradient z
    color_map
    {
        [ 0.0     rgbft <0.0, 0.0, 0.0, 0.0, 0.0> ]
        [ 0.01  rgbft <0.0, 0.0, 0.0, 0.0, 0.0> ]
        [ 0.01  rgbft <1.0, 1.0, 1.0, 0.0, 0.0> ]
        [ 1.0     rgbft <1.0, 1.0, 1.0, 0.0, 0.0> ]
    }
  }
}


Hope that helps, Johannes.


Post a reply to this message

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