POV-Ray : Newsgroups : povray.binaries.images : Problem with text object Server Time
30 Jul 2024 12:24:15 EDT (-0400)
  Problem with text object (Message 1 to 3 of 3)  
From: Jörg 'Yadgar' Bleimann
Subject: Problem with text object
Date: 9 Dec 2011 20:02:08
Message: <4ee2af90@news.povray.org>
Hi(gh)!

Perhaps once more a stupid beginner's mistake (after 16 years of 
POVing... it's just humiliating!): I'm just not able to place a text 
object (within an object pigment pattern) on a box tilted by 30 degrees 
around the x axis!

Here is the code:

   #declare Display_Card_Rounding=
   cylinder
   {
     0, <0.1, 0, 0>, 0.0015
   }
   #declare Display_Card_Panel=
   box
   {
     0, <0.1, 0.03, 0.003>
   }

   #declare Display_Card=
   union
   {
     union
     {
       object { Display_Card_Rounding }
       object { Display_Card_Panel translate <0, 0, -0.0015>}
       translate <0, 0.0015, 0>
       rotate <30, 0, 0>
     }
     union
     {
       object { Display_Card_Rounding }
       object { Display_Card_Panel translate <0, 0, -0.0015>}
       translate <0, 0.0015, 0>
       rotate <-30, 0, 0>
       translate <0, 0, 2*(0.0315*cos(radians(60))+0.0015*sin(radians(60)))>
     }
     difference // Display card top
     {
       cylinder { 0, <0.1, 0, 0>, 0.003 }
       plane { y, 0 rotate <30, 0, 0> }
       plane { y, 0 rotate <-30, 0, 0> }
       translate <0, 0.0315*sin(radians(60))-0.0015*cos(radians(60)), 
0.0315*cos(radians(60))+0.0015*sin(radians(60))>
     }
   }

#declare N_Brushed=
normal
{
   granite
   bump_size 0.5
   turbulence 10
   scale <1, 0.001, 0.001>
}

#declare F_Metallic_Low_Ref =
finish
{
   diffuse 1
   brilliance 0.7
   specular 1
   roughness 0.001
   reflection 0.05
   metallic
}


#declare T_Brushed_Aluminium=
texture
{
   pigment { color rgb 0.6 }
   finish { F_Metallic_Low_Ref }
   normal { N_Brushed }
}


object
   {
     Display_Card
     texture { T_Brushed_Aluminium }
     texture
     {
       pigment
       {
	object
	{
	  text
	  {
	    ttf "/media/disk1part9/fonts/lucon.ttf"
	    "T_Stone1", 0.001, 0
	    scale 0.01
	    translate <0, 0.01, 0>
	    rotate <30, 0, 0>
	
           }
	  color rgbf 1
	  color rgb 0
	}
       }
     }
   }

// end of code

All I ever get is an empty aluminium panel (see attachment)... what goes 
wrong?

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download '2011-12-10 includes showroom 1, take 75 - display card.jpg' (19 KB)

Preview of image '2011-12-10 includes showroom 1, take 75 - display card.jpg'
2011-12-10 includes showroom 1, take 75 - display card.jpg


 

From: clipka
Subject: Re: Problem with text object
Date: 10 Dec 2011 02:03:22
Message: <4ee3043a$1@news.povray.org>


> Perhaps once more a stupid beginner's mistake (after 16 years of
> POVing... it's just humiliating!): I'm just not able to place a text
> object (within an object pigment pattern) on a box tilted by 30 degrees
> around the x axis!
...
> All I ever get is an empty aluminium panel (see attachment)... what goes
> wrong?

The text object you use for the pigment pattern is extremely thin (0.001 
scaled by 0.01 = 0.00001), and not close enough to the surface you want 
to texture.

You apparently want to attach it to the z=0 surface of the 
Display_Card_Panel that, in total, undergoes the following transformations:

     translate <0, 0, -0.0015>
     translate <0, 0.0015, 0>
     rotate <30, 0, 0>

You have to apply all of these to you text object (it seems you forgot 
the first one) after the scaling, /plus/ a translation before the 
scaling so that the z=0 plane lies entirely inside the text object (to 
avoid coincident surface problems), i.e.:

   text
   {
     ttf "/media/disk1part9/fonts/lucon.ttf"
     "T_Stone1", 0.001, 0
     translate <0, 0, -0.0005>
     scale 0.01
     translate <0, 0, -0.0015>
     translate <0, 0.01, 0>
     rotate <30, 0, 0>
   }


Post a reply to this message

From: Alain
Subject: Re: Problem with text object
Date: 10 Dec 2011 17:56:37
Message: <4ee3e3a5@news.povray.org>

> Hi(gh)!
>
> Perhaps once more a stupid beginner's mistake (after 16 years of
> POVing... it's just humiliating!): I'm just not able to place a text
> object (within an object pigment pattern) on a box tilted by 30 degrees
> around the x axis!
>

Why don't you create your box parallel to one plane, say the X-Y plane, 


Much simpler = lot less place for mistakes.



Alain


Post a reply to this message

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