Display spatial local rotation axes

Hello. I was wondering, is there any built in functionality to draw a spatial bounding box or local rotaton axes in the scene?

Thank you.

Thats a good idea. I'll be using some form of that I'm sure.

If you take a look at some of the tests, I think all of them are setup to render model boundings by pressing the 'b' key. Rotation I havn't seen. You'll probably have to figure that one out yourself.

Early on in my testing I had some issues with the order I was applying transforms, so I set 3 lines up using the line classes provided, I did this for each game object as I added it, although you could do it per part if you needed to check the local axis on animated models components.



HTH



Endolf



Just dug it out of subversion, try this



        Line line = new Line("Axis", new Vector3f[] {new Vector3f(0,0,0), new Vector3f(8,0,0),new Vector3f(0,0,0), new Vector3f(0,8,0),new Vector3f(0,0,0), new Vector3f(0,0,8)}, null, new ColorRGBA[] {ColorRGBA.green, ColorRGBA.green, ColorRGBA.red, ColorRGBA.red, ColorRGBA.blue, ColorRGBA.blue}, null);

        line.setMode(Line.SEGMENTS);

        line.setLineWidth(1);

        line.setAntialiased(true);

        line.setLightCombineMode(LightState.OFF);

 

        line.updateRenderState();

        line.updateGeometricState(0, true);

        line.updateWorldBound();

                

        displayNode.attachChild(line);

There's an Arrow shape we added to jme that is also useful in drawing axis.

Exactly what I needed. Thank you very Much :smiley:

Glad to be of use :slight_smile:



Endolf