Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background Image option instead of background color #42

Closed
ashrftvm opened this issue Aug 30, 2022 · 1 comment
Closed

Background Image option instead of background color #42

ashrftvm opened this issue Aug 30, 2022 · 1 comment

Comments

@ashrftvm
Copy link

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
Copy link
Author

ashrftvm commented Sep 8, 2022

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')

@ashrftvm ashrftvm closed this as completed Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant