Hierachical Modeling in JMonkey...how to?

Hello, I am new to the JMonkey game engine. I’m using it for a class project (and a class I’m taking in the fall will be immersed in it.), and right now I’m looking over the basic tutorials and adding my own twists to the code (like adding my own assets, adjusting inputs, etcs.) It’s when I went into inputs that I had an issue that I can’t find a satisfactory answer for…

I’m familiar with the lwjgl, and most importantly hierarchical modeling, where you make wide use of glMatrixPush() and glMatrixPop() in between transforms. Problem is, I can’t find a alternative within the Jmonkey code. For example, I had a spaceship model that I was working on with roll, yaw and forward motion. It’s rolls and yaws fine with local rotations, but it moves according to it’s original axis after I perform some rotations.

Is there a way to do hierarchical modeling within the code, or must I go deeper into the opengl code and make my own means of doing hierarchical modeling.



ps…how is this engine in doing 2d games, or is there a good 2d game engine for serious programmers.

Nodes, jme is a Scenegraph based engine, also for 2d Slick is said to be quite good.

A node basically has a rotation position in the global coordiante systems. everything attached to the node is then in the local coordinates of the node.

(so if the spaceship is a node, a turret at (0,1,0) translation would always be 1 meter too the up relative to the spaceships rotation/position.

I had a feeling that had something to do with it, I’ll explore it more. But if you don’t mind, I have a couple more questions.

How best set up nodes/geometry to always have the front end point to an local axis?

How to avoid gimbal lock?


You are throwing around words without having actual problems I guess… How about you go through he tutorials and start implementing your game, then when you have concise problems you come back to the forum and ask?

How to avoid gimbal lock?

Actally I with norman, if you would do the tutorial you would see that JME uses Quaternions for rotation calculation, since they are 4d projected to a 3d space there is nothing like gimbal lock possible.

1 Like