Listing 2.2
#list22.py
#/* Copyrighted Pixar 1989 */
#/* From the RenderMan Companion p. 20 */
#/* Listing 2.2 Control over viewer and color */
import cgkit.cri
from cgkit.cgtypes import *
# Load the RenderMan API.
# Replace the library name with whatever renderer you want to use.
ri = cgkit.cri.loadRI("3delight")
cgkit.cri.importRINames(ri, globals())
square=[.5,.5,.5,.5,-.5,.5,-.5,-.5,.5,-.5,.5,.5]
color=(.2,.4,.6)
RiBegin(RI_NULL)
RiLightSource("distantlight",RI_NULL)
RiProjection(RI_PERSPECTIVE)
RiTranslate(0.0,0.0,1.0)
RiRotate(40,-1,1,0)
RiDisplay("list22.tif", RI_FRAMEBUFFER, RI_RGB)
RiWorldBegin()
RiColor(color)
RiSurface("constant",RI_NULL)
RiPolygon(P=square)
RiWorldEnd()
RiEnd()
- -
- -