0
\$\begingroup\$

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!

\$\endgroup\$
3
  • \$\begingroup\$ 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... \$\endgroup\$ Commented Jan 26, 2017 at 3:17
  • \$\begingroup\$ 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. \$\endgroup\$ Commented Jan 26, 2017 at 15:22
  • \$\begingroup\$ which version of whitestormjs are you using? Can you contact me in discord chat of whitestormjs? I'll try to help \$\endgroup\$ Commented Jan 29, 2017 at 21:24

1 Answer 1

-1
\$\begingroup\$

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

\$\endgroup\$
1
  • \$\begingroup\$ Could you provide a bit more information? Why should asker use JSONLoader, instead? \$\endgroup\$ Commented Feb 19, 2017 at 3:42

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.