Hiya. Im new to Panda3D, yet I’m excited to create with it. Before I dive into big stuff, I thought I’d try simpler stuff. I tried putting the enviroment.egg with repositioned camera in the Panda window (it’s like the third thing in the window). My code didnt work however, even though it’s identical to the manual, and through the errors I deduced it was a modeling problem (I think). I am using pyscripter to create the program, then I am putting it in the Panda directory to run it thru the cmd. Here is my code and error message. Thanks for any help.
Oscar
Code
from math import pi, sin, cos
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
class MyApp(ShowBase) :
def __init__(self):
ShowBase.__init__(self)
self.environ = self.loader.loadModel("models/enviroment")
self.environ.reparentTo(self.render)
self.environ.setScale(0.25, 0.25, 0.25)
self.environ.setPos(-8, 42, 0)
self.taskMgr.add(self.spinCameraTask, "SpinCameraTask")
def spinCameraTask(self, task):
angleDegrees = task.time * 6.0
angleRadians = angleDegrees * (pi / 180.0)
self.camera.setPos(20 * sin(angleRadians), -20.0 * cos(angleRadians), 3)
self.camera.setHpr(angleDegrees, 0, 0)
return Task.cont
app = MyApp()
app.run()
CMD Things
cd C:/Panda3D-1.7.2/
ppython module1.py
Known pipe types
wglGraphics Page
(all display modules loaded.)
:loader(error): Couldn’t load file models/enviroment.egg:not found on model pat
h <currently: “/c/Panda3D-1.7.2/etc/…;/c/Panda3D-1.7.2/etc/…/
models”>
Traceback (most recent call last):
File “module1.py”, line 32, in
app = myApp()
File “module1.py”, line 20, in __init
self.environ = self.loader.loadModel(“models/enviroment”)
File “C:\Panda3D-1.7.2\direct\showbase\Loader.py”, line 169, in loadModel
raise IOError, message
IOError: Could not load model file(s): [‘models/enviroment’]
Extra Info:
Running 64-bit Windows 7 if it matters
Tested sample programs and they work
Tested the simple grey screen “Hello World” program and it worked
Edit:
For some reason indentations in the code appear in the preivew but not in the submittation.
Any replies will be appreciated. Thanks