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

248
Visualizações
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 à 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