POV-Ray : Newsgroups : povray.text.scene-files : Curved Text for Handler : Curved Text for Handler Server Time
28 Jul 2024 18:16:10 EDT (-0400)
  Curved Text for Handler  
From: Eric Freeman
Date: 6 Oct 1999 03:47:01
Message: <37fafe75@news.povray.org>
// Persistence of Vision Ray Tracer Scene Description File
// File: curvtext.pov
// Vers: 3.1 SuperPatch
// Desc: curved text
// Date: 10/06/99
// Auth: Eric L. Freeman

// Uses the "max_extent" feature of the SuperPatch to position the text
// but can be positioned by hand in regular POV

#include "colors.inc"

light_source {
  <-20,80,-120>
  color White
}
light_source {
  <20,80,-120>
  color White
}
light_source {
  <0,0,120>
  color White
}

// FRONT VIEW
camera {
  location <0,1.7,-3.4>
  look_at <0,0,-1.7>
}
/*
// TOP VIEW
camera {
  location <0,20,-1.7001>
  look_at <0,0,-1.7>
  angle 8
}
*/

// THE TEXT-CURVING CODE *****************
#declare TextDepth = 2.2;
#declare StartAngle = 20;
#declare RotaterAngle = -20;
// THE FIRST LETTER
#declare Pee = text {
  ttf "c:\windows\fonts\arialbd.ttf" "P"
  TextDepth, 0
}
#declare PeeExtent = max_extent (Pee);
#declare PeeObj = object {
  Pee
  translate -PeeExtent/2
  translate <0,0,-TextDepth/2>
  rotate <0,StartAngle,0>
}

// THE SECOND LETTER
#declare Ohh = text {
  ttf "c:\windows\fonts\arialbd.ttf" "O"
  TextDepth, 0
}
#declare OhhExtent = max_extent (Ohh);
#declare OhhObj = object {
  Ohh
  translate -OhhExtent/2
  translate <0,0,-TextDepth/2>
  rotate <0,StartAngle+RotaterAngle,0>
}

// THE THIRD LETTER
#declare Vee = text {
  ttf "c:\windows\fonts\arialbd.ttf" "V"
  TextDepth, 0
}
#declare VeeExtent = max_extent (Vee);
#declare VeeObj = object {
  Vee
  translate -VeeExtent/2
  translate <0,0,-TextDepth/2>
  rotate <0,StartAngle+RotaterAngle*2,0>
}

// COMBINE ALL LETTERS INTO A SINGLE OBJECT
#declare AllText = union {
  object {PeeObj}
  object {OhhObj}
  object {VeeObj}
}

// THEN MAKE A HOLLOW CYLINDER
#declare TheCylinder = difference {
  cylinder {
    <0,-1,0>,
    <0,3,0>
    TextDepth*0.9
  }
  cylinder {
    <0,-2,0>,
    <0,4,0>
    TextDepth*0.8
  }
}

// FINALLY, MAKE AN INTERSECTION OF THE TWO OBJECTS
intersection {
  object {TheCylinder}
  object {AllText}
  pigment {Red}
}


Post a reply to this message

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