POV-Ray Buttons and Logos

Eric Bainville - Mar 2007

Button shapes

We will add one single white light source, zero the ambient light, and add a round button. The round button is an ellipsoid, obtained by squashing a sphere in the Z direction.

global_settings {
  assumed_gamma 1        
  // No ambient light
  ambient_light White*0.0
}

camera {
  orthographic 
  location <0,0,1000>
  right 2*x up 2*y direction -z
  // Uncomment to render a side view  
  // rotate 90*x
}

light_source { <-50,100,100>, White }

// Round button
#declare b_round = sphere {
  <0,0,-1>,1
  // Squash the sphere in Z
  scale <1,1,0.2>
}

object { b_round texture { T_Silver_3C } }

Running this file, you will get the following images. The second one is a side view obtained by uncommenting the rotate command in the camera:

 

The superellipsoid primitive allows creation of rounded square and square buttons. As in the previous case, the translation moves the top of the button in the Z=0 plane. It will make it easier to position button contents later.

// Rounded square button
#declare b_rsquare = superellipsoid {
  // Adjust first parameter: 0=square, 1=circle
  <0.2,0.15>
  translate -z scale <1,1,0.2>
}

// Hollow round button
#declare b_hround = difference {
  sphere { <0,0,-0.1>,1 }
  sphere { <0,0,1>,1 scale 1.4 }
  scale <1,1,0.2>
}
 

In the next section (Content) we will add some elements inside the buttons.