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

Emogis para Agricultura y Reposteria y Cocina #33

Closed
PastorDinora opened this issue Aug 13, 2023 · 1 comment
Closed

Emogis para Agricultura y Reposteria y Cocina #33

PastorDinora opened this issue Aug 13, 2023 · 1 comment

Comments

@PastorDinora
Copy link

<title>Emojis Interactivos en 3D</title> <style> body { margin: 0; overflow: hidden; }
    #emoji-container {
        position: absolute;
        width: 100%;
        height: 100%;
    }

    #biometric-canvas {
        position: absolute;
        top: 0;
        left: 0;
    }
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script> <script> const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); const canvas = document.getElementById('biometric-canvas'); const renderer = new THREE.WebGLRenderer({ canvas });

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();

// 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);
}

});

const animate = () => {
requestAnimationFrame(animate);

emojis.forEach(emojiMesh => {
    emojiMesh.rotation.x += 0.01;
    emojiMesh.rotation.y += 0.01;
});

renderer.render(scene, camera);

};

emojiContainer.appendChild(renderer.domElement);
animate();

</script> no hay manera se hacer fucnionar el codigo ni aunque añada la url del emogi.
@slashsbin
Copy link
Owner

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.

@slashsbin slashsbin closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2023
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

2 participants