You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Función para agregar un emoji en la posición del clic
emojiContainer.addEventListener('click', (event) => {
const mouse = new THREE.Vector2();
const raycaster = new THREE.Raycaster();
// Convierte las coordenadas del clic a coordenadas normalizadas de Three.js
mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
mouse.y = - (event.clientY / window.innerHeight) * 2 + 1;
raycaster.setFromCamera(mouse, camera);
// Encuentra intersecciones con la escena
const intersects = raycaster.intersectObjects(scene.children);
if (intersects.length > 0) {
// Crea un nuevo emoji en la posición de la intersección
const emojiTexture = new THREE.TextureLoader().load('');
const emojiMaterial = new THREE.MeshBasicMaterial({ map: emojiTexture });
const emojiGeometry = new THREE.PlaneGeometry(1, 1);
const emojiMesh = new THREE.Mesh(emojiGeometry, emojiMaterial);
emojiMesh.position.copy(intersects[0].point);
scene.add(emojiMesh);
emojis.push(emojiMesh);
}
Hi @PastorDinora
This repository is not intended for answering your code questions, even if it's related to emojis.
I'm sorry but I can't help you.
Ask your question is other communities, which are more suited for these questions.
camera.position.z = 5;
const emojis = [];
const emojiContainer = document.getElementById('emoji-container');
renderer.setSize(window.innerWidth, window.innerHeight);
// Función para agregar un emoji en la posición del clic
emojiContainer.addEventListener('click', (event) => {
const mouse = new THREE.Vector2();
const raycaster = new THREE.Raycaster();
});
const animate = () => {
requestAnimationFrame(animate);
};
emojiContainer.appendChild(renderer.domElement);
</script> no hay manera se hacer fucnionar el codigo ni aunque añada la url del emogi.animate();
The text was updated successfully, but these errors were encountered: