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

102
Views
Apply quaternion is not a function

I need some light on this question I'm trying to set vertices of a geometry using a quaternion and

geometry.attributes.position.array[x].applyQuaternion(quaternion)

is not working as expected I know this implementation as changed in the passed and I suspect that the problem is that

geometry.vertices[x]

is not available anymore

some one on this ?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The method .applyQuaternion() is only available in Vector3(), not in a simple number. You cannot perform 7.applyQuaternion() with a number. In this context, it doesn't make sense to apply a 3D rotation to a 1-dimensional value.

First, make sure you create a Vector3 with the XYZ coordinates of the vertex you're trying to manipulate by using the BufferAttribute.get... method:

// Create quaternion
const quat = new THREE.Quaternion();
quat.setFromAxisAngle( /* ... */ );

// Position attribute
const posAttrib = geometry.getAttribute('position');

// Let's get the XYZ components of the 7th vertex in the geometry
const twistVec = new THREE.Vector3(
    posAttrib.getX(7),
    posAttrib.getY(7),
    posAttrib.getZ(7)
);

// Now that you've created a Vec3, you CAN apply a quaternion
twistVec.applyQuaternion(quat);
about 4 years ago · Juan Pablo Isaza 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!