Object rotating on its own

Hi guys,

I have an object that looks like a book shelf that I move around in my scene. I noticed that once it’s being moved from point a to point b, for no reason the object rotates back and forth (like a z fighting effect) 180 degrees. In other words, if the shelf has two faces front and back, while moving you notice that faces switch back and forth which is very strange as I use the same method to move with other very similar objects with no issues. I am 100% sure it has nothing to do with the camera or the movements but the blender object itself.

any idea on where the issue could be?

PS: I was also having issues with some of the sides disappearing and took @normen’s advice on a previous post to extrude the sides (making them thicker) and that worked like a charm.

thanks in advance

at least post something for us to look at:
screenshots, video, code, blender model, textures, anything

As a guess, I’d say it is not UV mapped correctly

What wezrules said or it is actually flipping, maybe rotation toggles between 180 and -180 or something.

Here’s a picture of the model in Blender: Picture

like you said, it actually flips 180 to -180 degrees for some reason.

@wezrule - never played with the UV Mappings before, is that through Blender? I’ll research more

@jmaasing - you’re right, it’s flipping. why is that? any clue?

thanks guys

can you post a video, or screenshots of it in jME please. I’ve never had a problem of rotation screwing up just by moving something. Out of interest, when you do spatial.getWorldRotation () what do you get, and is it always the same?

The closest thing I’ve had to that, is a model not properly UV mapped, so that it appears to flicker and change abruptly.

Iwill put a video up here tonight…

The closest thing I’ve had to that, is a model not properly UV mapped, so that it appears to flicker and change abruptly.

and how do I fix that? I tried after some research to do CTRL + A then click on Apply and check scale, rotation, Location (in blender) … any other way to do it?

Also post your code for how you load and move the object.

@wezrule, the world Rotation for object (0.0, 0.0, 0.0, 1.0) before starting to move and then becomes (0.0, 0.0, -0.70710677, 0.70710677) when moving and keeps changing…

@pspseed , the code I use to load is:

[java]public static Spatial create3dModel(String id, String type, float x, float y, float z,
double theta, AssetManager assetMgr) {

    Spatial sp = null;

    if (assetMgr == null) {
        System.out.println("WARNING: Asset Manager is null");

    if ( type.substring(type.length()-4, type.length()).equals(".j3o") == false ){

        type += ".j3o";
        sp = assetMgr.loadModel("/Models/Resized/" + type);


    if (sp == null) {
                "Spatial not found for object Id:" + id
                + " Type not found:" + type + " program will exit");

    Quaternion quat = new Quaternion();
    quat.fromAngleAxis((float)Conversions.degreesToRad(theta), Vector3f.UNIT_Z);
    sp.setLocalTranslation(x, y, z);  	


    return sp;

and to move I use Cinematics

Also the object is scaled too big to be seen in JMP :S

well I guess something in Cinematics (or the way you are using it) is making it rotate. Have you tried just “moving” it normally to make sure?

@homsi said: and to move I use Cinematics

Since this is likely the source of your problem then you will have to show this code also.

yeah you guys are right… it seems there’s something wrong with that code. Wrote a small unit test that demonstrated that… nothing to do with my objects or blender… sorry for the confusion guys