POV-Ray : Newsgroups : povray.newusers : Tidy way to make a billiard ball w/o image maps? : Re: Tidy way to make a billiard ball w/o image maps? Server Time
5 Nov 2024 07:17:15 EST (-0500)
  Re: Tidy way to make a billiard ball w/o image maps?  
From: Mike Williams
Date: 19 Jun 2000 18:39:20
Message: <NYrILDAmBqT5EwFZ@econym.demon.co.uk>
Wasn't it CreeD who wrote:
>Is there a graceful way to make a billiard ball without an image map?
>I've done the image map thing, and it works great, but I was hoping to make
>a
>.pov file that could stand on its own and doesn't need fifteen accompanying
>image files.
>Something to do maybe with using text and differencing it with a sphere?
>

If you really are talking about billiards, there are only three balls.
One is plain off-white, one is plain red and the third one has a spot
like this:-

sphere {0,1 pigment { gradient z
        colour_map {[0.000 rgb <1,1,.9>]
                    [0.997 rgb <1,1,.9>]
                    [0.997 rgb 0]
                    [1.000 rgb 0]}
       }
       finish {phong 0.8}
}

If, however, you're talking about pool balls, you probably want to
investigate the "object pattern" facility in MegaPOV, something like
this:-



// The number "5" on the front side of the ball
#declare One_Five =
object{
  text { ttf "ariblk.ttf", "5", 1, 0
    align_center
    scale <1,1,-2>
    translate -0.35*y
  }
}


// Two "5"s one for the front and one for the back
// (We can't just push it all the way through or it would
// be back to front on the far side)
#declare Five =
union {object {One_Five rotate y*180}
       object {One_Five}
}       


// The gradient texture for the area outside the "5"s                  
#declare Yellow_White = 
texture {
  pigment {
    gradient z
    colour_map {[0.0 rgb <1,1,0>]
                [0.8 rgb <1,1,0>]
                [0.8 rgb <1,1,0.9>]
                [1.0 rgb <1,1,0.9>]}
  }  
  finish {phong 0.8}
}

// The plain black texture for inside the "5"s   
#declare Digit =
texture {
  pigment {rgb 0}
  finish {phong 0.8}
}

// The ball with the object texture pattern
sphere {0,1
  texture {
    object {Five
       texture {Yellow_White},
       texture {Digit}
    }    
  }
}




-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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