Problem with vehicle wheels

Hi!



I'm trying to put a vehicle in my scene (a very simple one at this time), but loading my wheels from a model. I've done the model with blender (now it's a simple cilinder, it will be more detailed in the future) and it loads well



The problem is that the wheels are added to the vehicle, but they are not correctly rotated (they are perpendicular as they should be). There is an image for you to understand better.



I tryied to rotate it in blender but it doesn't work, I also tried to use this code to rotate it before adding it to the vehicle:



Quaternion quaternion = new Quaternion();
quaternion.fromAngleAxis(FastMath.DEG_TO_RAD * 90, new Vector3f(0,1,0));
wheel1.setLocalRotation(quaternion);



But  nothing works, any idea?

Are you using jbullet-jme? The "wheel direction" should be -Y ("down") and the "wheelAxle" should be the axis that the wheel spins around, so probably -X. Also, you are not supposed to rotate the spatial of the wheel, it will be rotated by the physics. If you need to rotate the wheel to orient it correct you will have to attach it to a node, set the local rotation of your wheel there and attach the node to the vehicle. Or simply rotate it correctly in blender already and apply that rotation.

Yes I'm using jbullet-jme, and the values that I'm using for "wheel direction" and "wheelAxle" are the ones you said. Also I know that it rotate by the physics engine, but what is not correct is the first orientation.



And Moreover, it doesn't matter the orientation I give to the wheel in blender it is always rendered the same way.



I think I'll try to add the spatial to a node.



thank you for your answer.

I solved my problem!!



The problem was at exporting the model to jme-xml. It exports it as a node with trimesh inside, and an entry setting the local rotation of the Node to a determined quartenion, but what I really need is to modify the local rotation of the trimesh that is what the vehicle takes for representing the wheel, then I only had to move the local rotation definition tag inside the trimesh tags and it works flawlessly.