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

66
Vistas
THREE.js CylinderGeometry.attributes not defined

I am having trouble accessing the .attributes.position for any sort of geometry in THREE.js. Basically, the console error is 'Uncaught TypeError: Cannot read properties of undefined (reading 'position')'.

const cylinderGeometry = new THREE.CylinderGeometry( 5, 5, 5, 5, 15, 5, 30 );
const position = cylinderGeometry.attributes.position;
const vertex = new THREE.Vector3();

For reference, the snippet is taken from https://threejs.org/docs/#api/en/objects/SkinnedMesh.

Any idea why this might happen? Could it be related to the THREE.js version I am using?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

If you're using Three.js version r125 or later, you should be able to get the position attribute of any geometry with the .getAttribute() method.:

const cylinderGeometry = new THREE.CylinderGeometry( 5, 5, 5, 5, 15, 5, 30 );
const posAttribute = cylinderGeometry.getAttribute("position");
const posArray = posAttribute.array;

If you're using version r124 or earlier, then the Geometry generated used to be structured differently. This approach is now deprecated, so it's recommended you update to a newer version.

about 4 years ago · Santiago Trujillo 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