import prmanでは、パラメータを辞書形式で記述。後はほとんど同じ感じてす。
以下は、ティーポットの表示
■import prman
#test2.py
# set PYTHONPATH=C:\Python25;C:\Python\Scripts;%RMANTREE%\bin
import prman
ri=prman.Ri()
rendertarget="test2.rib"
ri.Begin(ri.RENDER)
ri.Imager("background", {"color color":(.2,.4,.6)})
ri.Display("teapot2.png", "file", "rgb")
ri.Format(640,480,1)
ri.Projection(ri.PERSPECTIVE, {ri.FOV: 45})
ri.Translate(0,0,10)
ri.WorldBegin()
ri.LightSource("pointlight", {ri.HANDLEID: "1", "from": [-10,10,-10],"intensity":[300]})
ri.LightSource("pointlight", {ri.HANDLEID: "2", "from": [10,10,-10],"intensity":[300]})
ri.LightSource("pointlight", {ri.HANDLEID: "3", "from": [-10,-10,-10],"intensity":[300]})
ri.Color((0.9,0,0.1))
ri.Surface("plastic")
ri.Translate(0,-1,0)
ri.Rotate(-90,1,0,0)
ri.Geometry("teapot")
ri.WorldEnd()
ri.End()
■cgkit
3Delightを利用した。
#min2.py
import cgkit.cri
ri = cgkit.cri.loadRI("3Delight")
cgkit.cri.importRINames(ri, globals())
RiBegin(RI_NULL)
RiImager("background", "color background",(.2,.4,.6))
RiDisplay("min2.png", RI_FILE, RI_RGB)
RiProjection(RI_PERSPECTIVE,RI_FOV,45)
RiTranslate(0,0,10)
RiWorldBegin()
#RiLightSource("ambientlight","intensity",0.4)
#RiLightSource("distantlight")
RiLightSource("pointlight", RI_HANDLEID, "1", "from",[-10,10,-10],"intensity",[300])
RiLightSource("pointlight", RI_HANDLEID, "2", "from",[10,10,-10],"intensity",[300])
RiLightSource("pointlight", RI_HANDLEID, "3", "from",[-10,-10,-10],"intensity",[300])
RiSurface("plastic")
RiColor((1,0.2,0.2))
RiTranslate(0,-1,0)
RiRotate(-90,1,0,0)
RiReadArchive("teapot.rib")
RiWorldEnd()
RiEnd()
- -
- -