Skip to content
Snippets Groups Projects
Commit 00fc3cc4 authored by Matthias Konitzny's avatar Matthias Konitzny :fire:
Browse files

Images can now be loaded from external resources.

parent a6b1b84c
No related branches found
No related tags found
No related merge requests found
......@@ -452,15 +452,20 @@ class Graph {
// Draw node circle image
const textureLoader = new THREE.TextureLoader();
textureLoader.setCrossOrigin("anonymous");
const imageAlpha = textureLoader.load(
Config.PLUGIN_PATH + "datasets/images/alpha.png"
);
let imageTexture = null;
if ("image" in node) {
imageTexture = textureLoader.load(
Config.PLUGIN_PATH + "datasets/images/" + node.image
);
if (node.image.startsWith("http")) {
imageTexture = textureLoader.load(node.image);
} else {
imageTexture = textureLoader.load(
Config.PLUGIN_PATH + "datasets/images/" + node.image
);
}
} else {
imageTexture = textureLoader.load(
Config.PLUGIN_PATH + "datasets/images/default.jpg"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment