4.3.1 Using the API

It is safe to import the module using

from cgkit.ri import *

All the functions that get imported start with the prefix Ri, all constants start with RI_ or RIE_, so you probably won't get into a naming conflict.

After importing the module this way you can use the functions just as you're used to from the C API (well, almost).

from cgkit.ri import *

RiBegin(RI_NULL)
RiWorldBegin()
RiSurface("plastic")
RiSphere(1,-1,1,360)
RiWorldEnd()
RiEnd()

The parameter to RiBegin() determines where the output is directed to. You can pass one of the following:

Note: When using the cri module you first have to load a library and invoke the functions on the returned handle (see the section on the cri module for more information about that). The interpretation of the argument to RiBegin() is then dependent on the renderer you are using.