I am loading the object from my json file.

var loader = new THREE.ObjectLoader();
loader.load("blue-car.json",
function ( car ) {
  car.position.set(2, 0, 0);
  car.addTo(world);
 }
);

Chrome Console Error

How can I add the object to my world? In regular three.js it works when I load the json file, but how do I do it in whitestorm?

Update: I tried using the importScene whitestorm method. No errors but it still doesn't show up. Here is an image of logging out a regular plane in whitestorm and the car that is loaded from the json file.enter image description here

Thank You!

  • Are you certain the problem is loading the JSON object? The error you posted statesthat .addTo isn't a function of car - but it didn't throw an error for car.position.set which suggests that it did load & that it was able to access its position function or attribute... – Pikalek Jan 26 '17 at 3:17
  • So it did load the object because I can log it and set a position property on it. However it does not load into the scene when I try using the addTo method. I tried the importScene method and I don't get any errors but it still does not load into the scene. – Aryeh Harris Jan 26 '17 at 15:22
  • which version of whitestormjs are you using? Can you contact me in discord chat of whitestormjs? I'll try to help – Alexander Buzin Jan 29 '17 at 21:24

Don't use the THREE.ObjectLoader, use JSONLoader, instead.

  • Could you provide a bit more information? Why should asker use JSONLoader, instead? – Gnemlock Feb 19 '17 at 3:42

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.