You have to add pigment {} within the shape definition. For example, the following asks for a red sphere with center at the origin and radius 5:pigment { color rgb< r, g, b > } // RGB code pigment { color color-name } // color name
The following asks for a navy blue open cone:sphere { 0*x, // center at < 0, 0, 0 > 5 // radius is 5 pigment { // color Red here color Red } }
cone { -y, 2, y, 1 open pigment { color NavyBlue } }
The following is a sphere with center < 1, 2, 3 > and radius 10. It is translated, rotated, translated and rotated, followed by coloring it in red.
The following is the same sphere; but, red color is added first and then translated, rotated, translated and rotated.sphere { < 1, 2, 3 >, 10 translate < -1, 3, 0 > rotate 30*z translate < 5, 3, 1 > rotate -10*y pigment { color NeonBlue } }
If pigment {} contains textures, the above could produce two spheres with different texture pattern.sphere { < 1, 2, 3 >, 10 pigment { color NeonBlue } translate < -1, 3, 0 > rotate 30*z translate < 5, 3, 1 > rotate -10*y }