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

247
Views
Three.js vertex index

I have exported a glTF file from Blender (3.0) to Three.js (r136). In the file I include a custom prop which is an array of vertices indexes.

I simply want to modify the geometry of an object in the fly in Blender. For now, I do this:

 C.active_object['movable'] = [v.index for v in C.active_object.data.vertices if v.select]

In the result I get:

"extras" : {
                "movable" : [
                    0,
                    1,
                    ...]}

After export to *.gltf and importing the file, I have my data in <Mesh>.userData["movable"]:

[0, 1, 2, 3, 4, 5, 6, 7, 136, 139, 141, 142, 170, 171, 172, 175, 176, 177, 178, 179, 180, 183, 184, 185]

My problem:

for (el of <Array>) {
    var x = el*3 + 0;
    var y = el*3 + 1;
    var z = el*3 + 2;
    <Mesh>.geometry.attributes.position.array[z] += 0.1;
};

<Mesh>.geometry.attributes.position.needsUpdate = true;

After applying this code, the wrong vertices is moved.

What am I doing wrong?

about 4 years ago · Juan Pablo Isaza
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!