I have created a class and rendering it directly in the class. But I can’t see the block being rendered.
from direct.showbase.ShowBase import ShowBase
from panda3d.core import *
class dirt:
def __init__(self, position):
ModelPath="dirt_block.egg"
self.model = loader.loadModel(ModelPath)
self.model.setScale(1.0)
self.model.setPos(position)
self.model.reparentTo(render)
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
sprite = dirt((0, 0, 0))
app = MyApp()
app.run()
Is there any problem in this code?