最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Why are Textures not Displaying Correctly in my Panda3d Scene? - Stack Overflow

programmeradmin1浏览0评论

Recently, I wanted to get started on making a game within panda3d. However, I am having trouble loading textures correctly for modules that I downloaded. Currently, when I attempt to load an environment file that I obtained online, it just appears as white and does not have any textures.

The test.egg file (environment) is located in:

C:\Users\Markas\AppData\Local\Programs\Python\Python311\Lib\site-packages\panda3d\models

The textures for are located in:

C:\Users\Markas\AppData\Local\Programs\Python\Python311\Lib\site-packages\panda3d\models\tex

What am I doing wrong? Before there was an error, where I forgot to transfer the textures to the models folder, but once I did that, it didn't say anything, just showing it as blank.

Below is my current initialization code:

def __init__(self):
    global base
    base=self
    ShowBase.__init__(self)
    
    
    self.env=self.loader.loadModel("models/test")
    self.box = self.loader.loadModel("models/box")
    self.box.reparentTo(self.render)
    self.env.reparentTo(self.render)

    
    
    # Camera
    self.camLens.setFov(75)
    self.taskMgr.add(self.update_camera, "camera_task")
    self.taskMgr.add(self.update_movement, "move_task")
    self.camera.setPos(0,2,2)

    # Detect key presses
    self.keys = []
    self.buttonThrowers[0].node().setButtonDownEvent('any')
    self.buttonThrowers[0].node().setButtonUpEvent('any-up')
    self.accept('escape',self.userExit)

    self.accept('any', self.press)
    self.accept('any-up', self.release)
    self.crouched=1

    self.disableMouse()
    props = WindowProperties()
    props.setCursorHidden(True)
    props.setSize(1920, 1080)
    props.setFullscreen(True)
    self.win.requestProperties(props)
发布评论

评论列表(0)

  1. 暂无评论