'How to load a 3D model with Collada using NASA Web World Wind?
I’ve been working with NASA’s World Wind library and I am currently trying to display a 3D model of a tree on top of the globe. I am following this example: https://github.com/NASAWorldWind/WebWorldWind/blob/develop/examples/Collada.js, but it isn’t working, aka nothing is displaying.
I’ve downloaded the tree model from this site:https://clara.io/view/240def5d-89b3-42f1-a59c-d4e589c068a0 and added the file inside my Collada folder as shown in the image below.
Files I've used
I’ve copied the directory path and am using it inside the init method. That being said it isn’t working and there isn’t a lot of information online about this library. When I try to use the callback function in load, it says that it can't set properties to null. Does anyone know what’s wrong?
Here is the documentation for the library: https://worldwind.arc.nasa.gov/autodocs/WebWorldWind/
Code below:
var wwd = new WorldWind.WorldWindow("canvasOne");
wwd.addLayer(new WorldWind.BMNGOneImageLayer());
wwd.addLayer(new WorldWind.BMNGLandsatLayer());
var modelLayer = new WorldWind.RenderableLayer("Tree");
wwd.addLayer(modelLayer);
var position = new WorldWind.Position(45, -100, 1000e3);
var colladaLoader = new WorldWind.ColladaLoader(position);
colladaLoader.init({dirPath: './Test Folder/Collada/'});
colladaLoader.load('tree.dae', function(model) {
model.scale = 5000;
modelLayer.addRenderable(model);
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
