jME3 Newbie Object Creation Question

Hello Everyone,



I have been using Java for a long time but am very new to jME (<24 hours). I don't have much of a background in graphics but do quite a bit of math in my work and its not so much of a problem.



Just for the hell of it, I am trying to make a Block object which is essentially a cube (not a box and a Geometry object and a material - this is not what I want I dont think). My block needs to have 6 independent faces that I can manipulate however I want but I still want to move the Block as a single object. Looking at the tutes I thought I would make 6 faces, rotate them to where I want them, stick them in a node (my block extends node) and then create this in my scene and yay for me.



I am nearly there but I have one issue which I don't understand.



When I put the bottom face on the Block I am adding two Quaternion instances to put it in place. It works like a dream. I can create an instance of the Block, then add it to the Scene and move around it and it all looks in place. The textures go in the correct directions.



It all goes pear shaped when I try and add more then one rotation modifier together and apply them to the Block (Node) instance which groups them. The shape explodes? I am not sure what order I do things to fix this :frowning:



See attached image (named 2and3Rotations, but its really 1 and 2 rotations).



Any help or comments about how I am implementing the block would be great (I have attached the Block code, the application that uses it and the world.zip asset package). If anyone knows some more complicated resources talking about the jME3 framework (I have all the Hello* examples on the wiki) that would also be great.



Regards,



John




Adding two quaternions doesn't exactly do what you think it does, I guess this should be mentioned somewhere in the documentation.

To combine rotation quaternions, use the "mult" method.

Momoko_Fan said:

Adding two quaternions doesn't exactly do what you think it does, I guess this should be mentioned somewhere in the documentation.
To combine rotation quaternions, use the "mult" method.


Thanks mate! Been away for the weekend and only seen this just now :)

Works like a dream.

John