Art Vandelay Posted November 14, 2017 Share Posted November 14, 2017 Hi, I am loading an obj file and trying to scale it as shown below. The mesh is loaded but the scaling does not work. What am I doing wrong? var maraca = loader.addMeshTask("maraca", "", "assets/", "Maraca.obj"); maraca.scaling = new BABYLON.Vector3(0.1, 0.1, 0.1); Thanks! Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 14, 2017 Share Posted November 14, 2017 What you get from the loader is a mesh task - it is an object with an onSuccess callback, that is executed when the mesh was loaded. The first variable in this callback is an array of meshes that you received from the Maraca.obj file. Those meshes (probably a single mesh in the array) should be scaled. Check the asset manager documentation here - http://doc.babylonjs.com/how_to/how_to_use_assetsmanager#meshassettask Quote Link to comment Share on other sites More sharing options...
Raggar Posted November 14, 2017 Share Posted November 14, 2017 The maraca reference isn't the imported mesh, but a task of the AssetsManager. So the .scaling property is there, but since it's no mesh, it's not used to do anything. Take a look at the example from the docs: https://www.babylonjs-playground.com/#ZJYNY#0 Aaaand Raanan beat me to it. RaananW 1 Quote Link to comment Share on other sites More sharing options...
Temechon Posted November 14, 2017 Share Posted November 14, 2017 Raanan is always the fastest, from myexperience at least RaananW 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 14, 2017 Share Posted November 14, 2017 A few options here: 1. I had the answer already, I just waited a second before you posted yours and then posted mine. 2. I have full control over the database, and I changed the signature of my post 3. I really AM a retired time traveler! 4. I wrote a very complex AI extension for chrome that tells me the minute there is a question i can actually answer. And if it can, it simply answers on its own. based on IBM Watson, Amazon Alexa, Siri, Cortana, and that horrible thing google has. Choose 1! Arte, Temechon and GameMonetize 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.