def init(): scene = bge.logic.getCurrentScene() scene.post_draw = [animate] pbge.configure() # basic 3D objects pbge.createPlane( -2,0,0 ) pbge.createCube( 0,2,0 ) pbge.createSphere( 0,-2,0 ) pbge.createCylinder( 2,0,0 ) #let's place a spot pbge.createSpot( 0,0,7 )
def init(): scene = bge.logic.getCurrentScene() scene.post_draw = [animate] pbge.configure() # changing background color pbge.background(0, 0, 0) # storing the reference of the created objects # into 'pbge' to animate them later pbge.myplane = pbge.createPlane(0, 0, -3) pbge.mycube = pbge.createCube(0, 2, 0) pbge.mysphere = pbge.createSphere(0, -2, 0) pbge.mycylinder = pbge.createCylinder(2, 0, 0) pbge.myspot = pbge.createSpot(0, 0, 7) pbge.scale(pbge.myplane, 10) pbge.scale(pbge.mycylinder, 0.3, 0.3, 4) pbge.scaleZ(pbge.mycube, 2) # changing objects color pbge.changeColor(pbge.myplane, 255, 0, 0) pbge.changeColor(pbge.mycube, 0, 255, 255) pbge.changeColor(pbge.mysphere, 255, 0, 255) pbge.changeColor(pbge.mycylinder, 255, 255, 255)
def init(): scene = bge.logic.getCurrentScene() scene.post_draw = [animate] pbge.configure() # changing background color pbge.background( 0,0,0 ) # storing the reference of the created objects # into 'pbge' to animate them later pbge.myplane = pbge.createPlane( 0,0,-3 ) pbge.mycube = pbge.createCube( 0,2,0 ) pbge.mysphere = pbge.createSphere( 0,-2,0 ) pbge.mycylinder = pbge.createCylinder( 2,0,0 ) pbge.myspot = pbge.createSpot( 0,0,7 ) pbge.scale( pbge.myplane, 10 ) pbge.scale( pbge.mycylinder, 0.3, 0.3, 4 ) pbge.scaleZ( pbge.mycube, 2 ) # changing objects color pbge.changeColor( pbge.myplane, 255,0,0 ) pbge.changeColor( pbge.mycube, 0,255,255 ) pbge.changeColor( pbge.mysphere, 255,0,255 ) pbge.changeColor( pbge.mycylinder, 255,255,255 )
def init(): scene = bge.logic.getCurrentScene() scene.post_draw = [animate] pbge.configure() # getting the reference of the created objects # for further modifications myplane = pbge.createPlane( -2,0,0 ) mycube = pbge.createCube( 0,2,0 ) mysphere = pbge.createSphere( 0,-2,0 ) mycylinder = pbge.createCylinder( 2,0,0 ) #let's place a spot myspot = pbge.createSpot( 0,0,7 ) # all objects are created, # let's change the position: pbge.moveTo( myplane, 0,0,-3 ) # let's change the size: pbge.scale( myplane, 10 ) pbge.scaleZ( mycube, 3 ) # let's change the orientation: pbge.rotateX( mycylinder, 15 )