簡體   English   中英

Ursina 實體默認立方體 blend2bam 不渲染

[英]Ursina Entity Default Cube blend2bam not rendering

我打開攪拌機拿了默認的立方體。 將其作為 cube1.blend 保存在目錄中。 使用 CLI 工具 blend2bam 並將其放入同一目錄下的 cube1.bam 中。 Ursina Entity 似乎可以識別它,但不會渲染,或者至少我找不到它,並且與我只是渲染打包的 model 立方體不在同一個位置。

 from ursina import *

 app = Ursina()

 entity = Entity(model='cube1')
 # So I can look for cube
 EditorCamera()

 app.run()

*注意默認模型或與 ursina 或 panda3d 打包的實體模型按預期工作

 from direct.showbase.ShowBase import ShowBase


 class MyApp(ShowBase):

     def __init__(self):
         ShowBase.__init__(self)

         self.camera.setPos(-9.112, -211.077, 46.951)
         self.camera.setHpr(0, -7.5, 2.4)
         # Load the environment model.
    
         self.scene = self.loader.loadModel("cube1.bam")
   
         # Reparent the model to render.
         self.scene.reparentTo(self.render)


 app = MyApp()
 app.run()

按預期工作並加載和呈現我的自定義 cube1。
Ursina Python 控制台吐出它正在加載 bam 並且沒有錯誤....

render mode: default
no settings.py file
loading bam
no settings.py file
development mode: True
application successfully started

我正在嘗試讓 Ursina 工作,所以雖然 panda3d 更加合作,但我認為這與 Ursina 的實體有關。 提前感謝您的任何建議或幫助。

Ursina 引擎將.blend 或.psd 文件轉換為.obj 文件進行渲染,也可以直接渲染.obj 文件。 我不相信 Ursina 有渲染.bam 文件的能力,而且我的知識是 Panda3D 只能渲染.egg 文件類型。 我不知道 Panda 3D 可以使用.bam 文件。 所以我想堅持使用 Ursina 的 .blend 文件? 這就是我一直在那個引擎中使用的,我沒有遇到過問題。

請注意,ursina 可以很好地處理 OBJ 文件。 如果您可以將其轉換為OBJ。 此外,您還需要添加很多您缺少的論點。 這是一個例子:

ground = Entity(model='plane', texture = 'your_texture_name', collider = 'mesh', position = (0, 0, 0), scale = (100, 1, 100))

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM