-
Notifications
You must be signed in to change notification settings - Fork 318
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
How to make only the earth rotate without the background rotating? #192
Comments
@Diuyilu if you want your background to be always static without moving, I'd suggest to just have a static image in a |
Thank you, I will try this implementation method! |
@vasturiano Do you have any specific code implementation? I tried the method you provided but it didn't work. |
@vasturiano Thank you, I just achieved this effect!My implementation method is as follows:
<div class="parent">
<div id="globeViz" class="global"></div>
<div id="background" class="background">
<img class="backimg" src="./image/background.jpg">
</div>
</div>
<script>
const world = Globe()
.backgroundColor('#FF000000')
world.controls().autoRotate = true;
world.controls().autoRotateSpeed = 1;
</script>
<style>
.parent {
position: relative;
}
.global {
position: absolute;
z-index: 2;
}
.background {
position: absolute;
z-index: 1;
}
.backimg {
width: 100vw;
height: 100vh;
}
</style> |
I also have the same need, but I don't want to achieve it by setting the div background. |
Are there any other implementation schemes? |
Situation
I use these code make my earth rotate:
But I don't want my background rotate.
How should I implement it?
The text was updated successfully, but these errors were encountered: