Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

63
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!