Skip to content

Pi3D Getting Started

tipam edited this page Jun 19, 2012 · 7 revisions

Now that you've installed Pi3D, you're ready to write your first Pi3D 3D scene in Geany ...

import pi3d

display = pi3d.display()

display.create3D(100,100,600,400)

display.setBackColour(0.0, 0.0, 0.0, 1.0) #Set background colour to black

earth = pi3d.createSphere("earth", 0.0, 0.0, -10.0, 3.0, 24)

earthmap = pi3d.loadTexture("worldMap.jpg")

while True:

display.clear()

earth.draw(earthmap)

earth.rotateIncY( 0.1 )

display.swapBuffers()

(Make sure the last four lines are indented!)

Now save the file in the same directory and Pi3D and then run it (using the cogs icon in Geany)

Tada! - you're very first Pi3D program!

Clone this wiki locally