Jump to content

Instance Rotations


reddozen
 Share

Recommended Posts

You're favorite scene... lol

 

Latest babylon 1.13-beta 7/9/2013

 

No matter what I rotate (X, Y, or Z) he doesn't move. I'm guessing it's inheriting from the parent... location and scale can be set fine though.

    var Prt_f01_prt_dongsang_inst = 0;    BABYLON.SceneLoader.ImportMesh("", "../Models/Maps/", "prt_dongsang.babylon", scene,        function(mapZone, particleSystems, skeletons)        {            mapZone[0].visiblity=false;            mapZone[0].isVisible=false;            mapZone[0].name = "Prt_f01_prt_dongsang";            ////////////////////////////////////////////////////////            // Instance Copies            ////////////////////////////////////////////////////////            // 90 deg = 1.570796            Prt_f01_prt_dongsang_inst++;            objInstance = mapZone[0].createInstance("Prt_f01_prt_dongsang_inst_"+ Prt_f01_prt_dongsang_inst +"");            objInstance.visible = true;            objInstance.isVisible = true;            objInstance.position = new BABYLON.Vector3(-101.492996, 2.988000, -19.001993);            objInstance.scaling = new BABYLON.Vector3(0.001, 0.001, 0.001);            objInstance.rotation = new BABYLON.Vector3(1.570796, 1.570796, 1.570796);        }    );
Link to comment
Share on other sites

This is because your object is produced from 3dsmax which use mesh.rotationQuaternion instead of mesh.rotation.

 

So you have many options:

- Go to babylon properties of your scene in max and uncheck "export rotations as quaternion"

- Use mesh.rotate functino

- Set mesh.rotationQuaternion to null

 

more about rotations:

https://github.com/BabylonJS/Babylon.js/wiki/How-to-handle-rotations-and-translations

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...