POV-Ray : Newsgroups : povray.newusers : Balls on a grid : Re: Balls on a grid Server Time
30 Jul 2024 10:25:35 EDT (-0400)
  Re: Balls on a grid  
From: Phil Cook
Date: 4 Jun 2004 12:45:32
Message: <opr82wq7jqefp2ch@news.povray.org>
And lo on Fri,  4 Jun 2004 10:33:58 EDT, Ralf <mos### [at] gmxde> did  
spake, saying:

> Hello Everybody!
>
> I trying to arrange labelled balls on a grid (see subsequent code). The
> problem is that the balls look like pool balls. To become more reliable I
> would like use uni-colored balls labelled with black text.
>
> Modifying the “text{..}” by inserting “pigment {color Black}” cerates an
> error.
>
> In the web I just found examples with text in a glass ball or text  
> growing
> out from a ball. Unfortunately all my attempts to modify failed.
>
> Now I’m looking for an example of a solid sphere labelled with text.
>
> Thanks in advance!
>
> Ralf
<snip code>

Just a quicky but substituting this  macro:
//start code
#macro MakeBall(Text, SpotSize, SpotClearance, ColorTex, WhiteTex)
     #local Mn = min_extent(Text);
     #local Mx = max_extent(Text);



#declare TextTexture=texture{
         pigment{object{Text colour Clear colour Black}
             translate -Mn - 0.5*(Mx-Mn)
             scale  x + y + z*1/(Mx.z - Mn.z)
             scale (x+y)*(SpotSize-SpotClearance)/vlength(<Mx.x, Mx.y, 0> -  
<Mn.x, Mn.y, 0>) + z
             translate -z*1
        }}

sphere  {< 0, 0, 0>, 1
texture{pigment {cylindrical color_map{[0 Black][0.2 Black][0.2 White][1  
White]}rotate x*90}}
texture{TextTexture}
}


#end
//end code

Just one side of text though, I'll let you play with the other side  and  
Substitute the colours :)

HTH

--
Phil Cook

-- 
All thoughts and comments are my own unless otherwise stated and I am  
happy to be proven wrong.


Post a reply to this message

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