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

246
Vistas
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
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