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 { ...@@ -452,15 +452,20 @@ class Graph {
// Draw node circle image // Draw node circle image
const textureLoader = new THREE.TextureLoader(); const textureLoader = new THREE.TextureLoader();
textureLoader.setCrossOrigin("anonymous");
const imageAlpha = textureLoader.load( const imageAlpha = textureLoader.load(
Config.PLUGIN_PATH + "datasets/images/alpha.png" Config.PLUGIN_PATH + "datasets/images/alpha.png"
); );
let imageTexture = null; let imageTexture = null;
if ("image" in node) { if ("image" in node) {
imageTexture = textureLoader.load( if (node.image.startsWith("http")) {
Config.PLUGIN_PATH + "datasets/images/" + node.image imageTexture = textureLoader.load(node.image);
); } else {
imageTexture = textureLoader.load(
Config.PLUGIN_PATH + "datasets/images/" + node.image
);
}
} else { } else {
imageTexture = textureLoader.load( imageTexture = textureLoader.load(
Config.PLUGIN_PATH + "datasets/images/default.jpg" 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