from math import pi,sin, cos
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from direct.actor.Actor import Actor
from direct.interval.IntervalGlobal import Sequence
from panda3d.core import Point3
from panda3d.core import Filename
winfile= ("c:\\Documents and Settings\Administrator\My Documents\Game\Panda3D-1.7.2\models\art\animals\gorilla-egg\gorilla\gorilla.egg")
pandafile = Filename.fromOsSpecific (winfile)
print pandafile
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
# disable camera controls for mouse
self.disableMouse()
# Load the environment model.
self.environ = self.loader.loadModel("models/art/cat-skies/alice-skies--stars-egg/alice-skies--stars/stars.egg")
# Reparent the model to render.
self.environ.reparentTo(self.render)
# Apply scale and position transforms on the model.
self.environ.setScale(.25, .25, .25)
self.environ.setPos(-8, 42, 0)
#self.taskMgr.add(self.spinCameraTask, "SpinCameraTask")
#GORILLAS!!!!! Loads and Renders them to SceneGraph
m= Actor("models/art/animals/gorilla-egg/gorilla/gorilla.egg")
m.reparentTo(self.render)
#Loads Model
planet= loader.loadModel ("models/art/cat-x2-not-yet-classified/bvw-f2004--planet-egg/bvw-f2004--planet/planet.egg")
#sets position (x,y,z) of object
planet.setPos(8,35,10)
#sets Heading Pitch Rotation (Yaw, Pitch, Roll)
planet.setHpr(0,0,4)
#sets scale of object
#Renders object to scene graph
planet.reparentTo(self.render)
#defines where camera is (not moving)
camera.setPos(0,-45,0)
app= MyApp()
app.run()
What do I have to add to get this gorilla to move with up down left and right keys? Please add the correct changes into the code.