Skip to content

ExamplesProceduralsSimpleGeometry

Ben Toogood edited this page Jun 13, 2013 · 2 revisions

Simple Procedural Geometry

This example is just about the simplest procedural you can get. It renders a cube!

320px-Cookbook_simpleGeometryGL.jpgopengl

320px-Cookbook_simpleGeometry.jpgrenderman

Code

#=====# Simple Geometry## This example is just about the simplest procedural you can get. It renders# a cube!#=====fromIECoreimport*classsimpleGeometry(ParameterisedProcedural) :
def__init__(self) :
ParameterisedProcedural.__init__( self, "Simple Geometry." )
defdoBound(self, args) :
returnBox3f( V3f(-1), V3f(1) )
defdoRenderState(self, renderer, args) :
passdefdoRender(self, renderer, args) :
box=MeshPrimitive.createBox( Box3f( V3f(-1), V3f(1) ) )
box.render( renderer )
# registerregisterRunTimeTyped( simpleGeometry )

Clone this wiki locally