From 7518c701b6e016581bbf9c75fe43c0b055e6abf6 Mon Sep 17 00:00:00 2001 From: Matthias Konitzny <konitzny@ibr.cs.tu-bs.de> Date: Thu, 17 Jun 2021 12:29:33 +0200 Subject: [PATCH] Added default node texture (all nodes are now clickable again :) ). --- datasets/images/default.jpg | Bin 0 -> 11191 bytes graph.js | 33 ++++++++++++++++++++++----------- 2 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 datasets/images/default.jpg diff --git a/datasets/images/default.jpg b/datasets/images/default.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d3a14f85cc94df32c70405fe38cf13626aff69f0 GIT binary patch literal 11191 zcmeG?d3;mF)^l(6t!<jNv~0aiR|;vC?t#)JU7?|+EiE7lX>yx}W+S<23!*F{$f5`$ zyRyovpeT!o$SSDFzA5S}AOeb7#DapFZ{}ucfj;&5e($f3$?wjbIp@roGiT1sojEt| z^X`ibLqW5t4gjqdBmw}qfP)1C281y916WtUqG14Pv2K2NG?w7yft;8U;E*R0J`PMp z!yyo!GtC5;-nQ#tc^b$*+yg*-kgv=&*lJ0lyxvCHob@(4p;9HK5D7IVtHIXf>;+T` zl~S!pQ!CR6r3&V1MKY8E0Ao4UuHSOp-^bzQjCPpj1b~e(yu9p=W5J~DW5E*rV}YZ< zF`o=fh5KdW$TBDu!v|W$Q@YQ)zXw8k6eBfSfVqDF0dx%*CL%uf1uz8&xm+%fE9CKn zVgX+u4h<9v14F|ll2C~xTr8xMxA0UR%rTKbAPNu#1q1|z1Ox<xpe!K7(?tAt1i1GA zF&9XHgn>x`F2)#Q%>5-CB<?<dWkW4l7@eTPC@}zrGg)j7m&X@C2e_Yz0i59@1_6wT zF>of%;;^|ahA<ft#SCUtu#%NKSSOK=nWSQe%vtePUUW=o#opTF6vyNf8cyuo%GQfF z_0H6=m0O;P%YUiLP_S<mmDc6tkW1uGZ%^5O%60ixVf?(+&%X2Wfzx0A{My!oXRfqW z*ELR^zh>KqXTQ0fUQ}ajnzmr=_Cx2c-Vp;Fh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Ibi;N5*Y`|jNOUebGO zcSY@5@_y+1vv>1%PucDMVB807d+d8|>^1Jayl>>b3;T!eKYd{Efujcp9z6VE;fMPV z<sSOraMs~nAE`fj_v4I@w||oM$+jb@N49>N`svoAX-BsmOFy>bc;@k)C;FY(eKPyx z-c$LfK0IA=`jaz*&YU<q<m~x#BhIy)H=MurnfbGupErJf@500{SYOQeGU&_sUv>X# z<-dCUYjaCl%ljAeFCMv6dFjGs{pIhzc7FZal_}qdzL|eD^6L6)s%yKh7hXU9?PK3w z`Of~`y&F@%7k|I>hlC&A`7!6mBdtSQuiSLpbpJH#R>ZBfKd1b>udTf8tJ{{__wLO2 zCE}NLzh?Y;=x)v3tM{6I<NUVp_g=s6{A1uBU$`ysF9hv>oI_^;&mZU5OeT}XWV2Xo z9veOaE}P922>E;gpDzp&(#czRDi7uue8-7|qVS-g@c-tIbBDoU1_u9W*8a!22=@Un z(DP*qY3oZ|?4ff{&_fvULzw&jM7ANvC(d7D?&F<ePjres*(vr^r`Xe-V$XDnJ=-bv ST&LJa`l89h-2W^4e)fMIP+(O6 literal 0 HcmV?d00001 diff --git a/graph.js b/graph.js index 48d21f4..cc28d29 100644 --- a/graph.js +++ b/graph.js @@ -80,22 +80,33 @@ function drawNode(node) { const cssobj = new THREE.CSS3DSprite(nodeDiv); cssobj.scale.set(0.25, 0.25, 0.25); + cssobj.position.set(0, -6, 0); + group.add(cssobj) + + // Draw node circle image + const textureLoader = new THREE.TextureLoader(); + const imageAlpha = textureLoader.load(plugin_path + 'datasets/images/alpha.png'); + let imageTexture = null; + + if ('image' in node) { + imageTexture = textureLoader.load(plugin_path + 'datasets/images/' + node.image); + } else { + imageTexture = textureLoader.load(plugin_path + 'datasets/images/default.jpg'); + } + + const material = new THREE.SpriteMaterial({map: imageTexture, alphaMap: imageAlpha, transparent: true, + alphaTest: 0.2, depthWrite:false, depthTest: false}); + const sprite = new THREE.Sprite(material); + sprite.renderOrder = 999; // This may not be optimal. But it allows us to render the sprite on top of everything else. if ('image' in node) { - cssobj.position.set(0, -7, 0); - - const textureLoader = new THREE.TextureLoader(); - const imageTexture = textureLoader.load(plugin_path + 'datasets/images/' + node.image); - const imageAlpha = textureLoader.load(plugin_path + 'datasets/images/alpha.png'); - const material = new THREE.SpriteMaterial({map: imageTexture, alphaMap: imageAlpha, transparent: true, - alphaTest: 0.2, depthWrite:false, depthTest: false}); - const sprite = new THREE.Sprite(material); - sprite.renderOrder = 999; // This may not be optimal. But it allows us to render the sprite on top of everything else. sprite.scale.set(20, 20); - group.add(sprite) + } else { + sprite.scale.set(5, 5); } - group.add(cssobj) + group.add(sprite) + return group; } -- GitLab