Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

213
Vistas
Colorea cada punto en un color diferente Threejs

Tengo puntos y color (r, g, b). Necesito usar un color para un punto. hice esto

 const vertices = new Float32Array(data.points); const colors = new Float32Array(data.colors) geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) ); geometry.setAttribute( 'color', new THREE.BufferAttribute( colors, 3 ) ); const material = new THREE.PointsMaterial({color: colors}); const pointCloud = new THREE.Points( geometry, material) this.scene.clear(); this.scene.add( pointCloud ); this.renderer.render(this.scene, this.camera);

De esta manera, obtengo puntos blancos. Si uso:

 const material = new THREE.PointsMaterial( { vertexColors: true } );

Recibí este error:

 [.WebGL-0x2e2bb1a84c00]GL ERROR :GL_INVALID_OPERATION : glDrawArrays: attempt to access out of range vertices in attribute 1
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Gracias :) En primer lugar, necesito usar colores del 0 al 1 (no del 0 al 255). Luego necesitaba obtener matrices con la misma longitud. Y necesitaba usar {vertexColors: true}.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda