This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
Adding 3D objects using React #2392
manasi-garg22
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hy all,
I am trying to add 3D objects on canvas using useEffect. But Failed to do so I am adding my code can you tell me what's the issue.
const map = mapRef.current = new MapView({
theme,
canvas: canvasRef.current,
target: initialCoordinates,
zoomLevel: initialZoomLevel,
});
const geometry = new THREE.BoxGeometry(1000, 1000, 1000);
const material = new THREE.MeshStandardMaterial({ color: 0x00ff00fe });
const cube = new THREE.Mesh(geometry, material);
cube.renderOrder = 1000;
const geoPosition = map.getGeoCoordinatesAt(52.53102, 13.3848);
cube.anchor = geoPosition;
map.mapAnchors.add(cube);
map.update();
Beta Was this translation helpful? Give feedback.
All reactions