[SOLVED] SkeletonDebugger appears backward on Jaime

I am creating a demo app which applies a SkeletonDebugger to the Jaime model in jme3-testdata. (This is not homework for a class or job interview.) The debugger wires appear to be backward (rotated 180 degrees on the Y axis) relative to the mesh.

Here is a test app which demonstrates the issue. I see this in both jME 3.0 and 3.1. I don’t see this with Elephant or Sinbad or any model other than Jaime. It doesn’t seem to matter whether I attach the debugger to the model node or the root node.

package mygame;
import com.jme3.animation.Skeleton;
import com.jme3.animation.SkeletonControl;
import com.jme3.app.SimpleApplication;
import com.jme3.light.DirectionalLight;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.debug.SkeletonDebugger;

public class Main extends SimpleApplication {
    public static void main(String[] args) {
        Main app = new Main();
        app.start();
    }
    
    @Override
    public void simpleInitApp() {
        Node jaime = (Node) assetManager.loadModel("Models/Jaime/Jaime.j3o");
        rootNode.attachChild(jaime);
        
        Material material = new Material(
                assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        material.getAdditionalRenderState().setDepthTest(false);
        material.getAdditionalRenderState().setWireframe(true);
        material.setColor("Color", ColorRGBA.Blue);
        
        SkeletonControl sc = jaime.getControl(SkeletonControl.class);
        Skeleton skeleton = sc.getSkeleton();        
        Spatial debugger = new SkeletonDebugger("debugger", skeleton);
        debugger.setMaterial(material);
        rootNode.attachChild(debugger);
        //jaime.attachChild(debugger);
        
        DirectionalLight light = new DirectionalLight();
        light.setColor(new ColorRGBA(2f, 2f, 2f, 1f));
        light.setDirection(Vector3f.UNIT_X);
        rootNode.addLight(light);
        
        cam.setLocation(new Vector3f(-2.3f, 0f, 0.8f));
        cam.lookAt(new Vector3f(0f, 0.6f, 0f), Vector3f.UNIT_Y);
    }
}
2 Likes

Mhh Jaime is rotated by 180 degrees on the z à is. Guess the skeleton debugger is not using world transforms. You can try to attach the debugger to Jaime’s Node.

Already tried that.

For the record, the fix was to copy the transform from Jaime’s geometry and apply it to the debugger.