Moguri / panda3d-gltf

glTF utilities for Panda3D
BSD 3-Clause "New" or "Revised" License
81 stars 19 forks source link

.gltf file is wrong when animation #123

Closed minkyokyo closed 1 year ago

minkyokyo commented 1 year ago

I am from here!! -> https://discourse.panda3d.org/t/gltf-file-is-wrong-when-animation/29430 Hi! moguri, I am so thankful your reply!!

I installed panda3d-gltf and i just load ".gltf"

# panda3D module import
from direct.showbase.ShowBase import ShowBase 
from direct.gui.OnscreenImage import OnscreenImage
from direct.gui.OnscreenText import OnscreenText
from direct.actor.Actor import Actor
import panda3d.core as p3c
from panda3d.core import PointLight, AmbientLight, DirectionalLight, LVector3

import cv2 as cv

from direct.actor.Actor import Actor

class MyApp(ShowBase):

    def __init__(self,imgW,imgH):
        ShowBase.__init__(self)

        winprops = p3c.WindowProperties()
        winprops.setSize(imgW, imgH)
        self.win.requestProperties(winprops)

        self.setAxis()
        self.camSetting()

        self.devil = Actor("devil.gltf")
        self.devil.reparent_to( self.render )
        self.devil.loop("dance")

    def setAxis(self):
         # Load the environment model.
        self.myAxis = self.loader.loadModel("models/zup-axis")
        # Reparent the model to render.
        self.myAxis.reparentTo(self.render)

    def camSetting(self):
        self.cam.setPos(0, -50, 0)
        self.cam.lookAt(p3c.LPoint3f(0, 0, 0), p3c.LVector3f(0, 0, 1))

        self.camLens.setNearFar(1, 1000)
        self.camLens.setFov(90)

app = MyApp(480,480)
app.run()

image and This is result!

umm,, Do I need to import a module to use a panda3d-gltf?

https://drive.google.com/file/d/1T0R9DSgKBiw5xsnvfwOKF3JAP875qQEC/view?usp=sharing This is my .gltf file.

minkyokyo commented 1 year ago

Hi, Moguri!! This was not a gltf issue. I set the wrong model in the blender. Thank you very much for your answer!! Personally speaking, I'm implementing augmented reality with panda3D at university!! Your module is very helpful. Thank you!