-
Notifications
You must be signed in to change notification settings - Fork 54
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
Can you stop the map marker rotating with the globe? #58
Comments
You can create a custom marker renderer that uses THREE.Sprite instead of geometry (quads, spheres). That's how I achieved forward facing markers (with a custom png) to have forward facing Icons on the globe. |
Ah, thank you. Do I still have to return a Mesh if I'm using a sprite? |
Just return the sprite instead of the mesh. Here's parts of my code: import * as THREE from "three";
import { Marker } from "react-globe";
import plusButton from "./assets/img/01_a_Plus_Button.png";
const MarkerRenderer = (marker: Marker): THREE.Object3D => {
var spriteMap = new THREE.TextureLoader().load(plusButton);
var spriteMaterial = new THREE.SpriteMaterial({ map: spriteMap });
var sprite = new THREE.Sprite(spriteMaterial);
return sprite;
};
export default MarkerRenderer; |
Hmm, that's what I was trying, but it's not displaying. Thank you for the support by the way.
|
Try drawing it on top so you're sure it's not hidden behind the globe: // DRAW ALWAYS ON TOP
spriteMaterial.depthWrite = false;
spriteMaterial.depthTest = false;
spriteMaterial.renderDepth = 1e20; Perhaps you also need to scale the Sprites a bit. |
That's still not showing 🤔 |
Try |
I'd like for the map markers to be forward facing at all times. Is this possible?
The text was updated successfully, but these errors were encountered: