So this problem is driving me crazy! I tried almost everything from changing rotations in Blender to doing local/global rotations with/without flattening. Nothing seems to help. Basically I figured out that my model’s joint seems to have its axes swapped (although the texture is applied correctly). The problem is that I’m parenting my camera to that joint and when I attempt to rotate my joint around the Heading (setH), my camera is rotating correctly, but my model’s joint is actually rotating around the Roll! Of course I could just change the Roll of my model (setR) which in reality is its heading but then, of course, my camera would rotate around the Roll as well which I don’t want.
So why has my joint these two things interchanged and more importantly how can I fix that, preferably in Panda3d and not in Blender?
player = Actor(loader.loadModel("resources/obj/player.bam")) player.custom_skin_texture = loader.load_texture("skins/man.png") player.custom_texture_stage = TextureStage("stage0") player.custom_texture_stage.set_texcoord_name("0") player.set_texture(player.custom_texture_stage, player.custom_skin_texture, 1) player.reparentTo(scene) self.neck = player.controlJoint(None, "modelRoot", "Neck1") camera._cam.reparentTo(self.neck) # This is the base.camera camera._cam.setPos(0, -4, 0) # So that I can see my player's head movement
self.neck.setH(self.roty) # Camera behavior correct, player behavior like setR self.neck.setP(self.rotx)
And in case it helps for finding the issue, here’s the egg file I converted from my BAM file which in turn I created from my blend file: https://filebin.ca/5O6VTxFgL9RK
I’d be very grateful about your suggestions.