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

116
Visualizações
group selection react three fiber

I am trying "merge"/"group" select multiple meshes.

At the moment I have something like this.

//wrapper


        <group
            onPointerOver={(e) => getOverEvent(e)}
            onPointerOut={(e) => getOutEvent(e)}
            onPointerMissed={(e) => clickOutside(e)}
            onClick={(e) => clickEvent(e)}
            dispose={null}
            ref={group}
            >
            {children}
        </group>

and children as follows


            <mesh
                castShadow
                receiveShadow
                geometry={nodes.shoe.geometry}
                material={materials.laces}
                name="1"

            />
            
            <mesh
                castShadow
                receiveShadow
                geometry={nodes.shoe_1.geometry}
                material={materials.mesh}
                name="2"
            >
            </mesh>
            
            <mesh
                castShadow
                receiveShadow
                geometry={nodes.shoe_2.geometry}
                material={materials.caps}
                name="3"
            />

This result of course is desired, as it hovers the hovered mesh.

however i would also like to be able to group hover certain meshes I have seen something somewhat related to what i want to do. https://github.com/pmndrs/drei#select

Basically i want to group mesh 1 and 3 for example, so if either for those meshes are selected/hovered they are detected that they are of the same group and hover/highlight both of them.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Using the group ref you can identify all the children using


let my_group = group.current.getObjectByName("my_group")

console.log(my_group.children)


<group name="my_group">

            <mesh
                castShadow
                receiveShadow
                geometry={nodes.shoe.geometry}
                material={materials.laces}
                name="1"

            />
            
            <mesh
                castShadow
                receiveShadow
                geometry={nodes.shoe_1.geometry}
                material={materials.mesh}
                name="2"
            >
            </mesh>

</group>


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