Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

64
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda