vasturiano / 3d-force-graph-vr

3D force-directed graph component in VR
https://vasturiano.github.io/3d-force-graph-vr/example/large-graph/
MIT License
214 stars 51 forks source link

Background Image option instead of background color #42

Closed ashrftvm closed 1 year ago

ashrftvm commented 1 year ago

I have been trying to add a background image, instead of the default background color.

I have gone through some solutions but none of them worked, I have also looked into the React force graph in which you can access the current.scene and then work your way from there.

However in this particular library it doesn't seem to work. Is it something I am doing wrong or is it just not possible in this library yet?

ashrftvm commented 1 year ago

I found a workaround for this using AFRAME, for anyone who needs this functionality in the future here is the code that I have used.

var skyEl = document.querySelector('a-sky') if(!skyEl){ skyEl = document.createElement('a-sky') scene.appendChild(skyEl) } skyEl.setAttribute('id', 'image-360') skyEl.setAttribute('radius', '2500') skyEl.setAttribute('animation', 'property: rotation;from: 0 0 0; to: 0 360 0; dur: 500000; easing: linear; loop:true '); skyEl.setAttribute('src', '#city')