Hi Everyone,
I've been trying to get the 'Hello World' tutorial to run and all I get is a gray window. All the Panda samples run fine, and the terminal window is not returning any errors when I try to run my app. I've tried editing the Config.prc file to default to OpenGL, DirectX, and the TinyPanda renderer with no luck. I've re-read the code several times. Any help would be greatly appreciated. Here's the 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/environment")
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()
Thanks!!!
Update:
It was a stupid mistake! I only had ONE underscore on each side of init. init vs. init.