AndrewRayCode / AndrewRayCode/three-subdivision-modifier

THREE.SubdivisionModifier.prototype.modify lose materialIndex

Abierto
#2 0 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
4
Forks
1
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

When I am using :

var modifier = new THREE.SubdivisionModifier( 2 );
modifier.modify( geometry, materials );

to modify a cube with different material for each face, I found an issue that new faces always have materialIndex = 0;

I changed a little code to apply the newFaces materialIndex with oldFaces materialIndex, then solved this issue:

on step 3. after newFaces have been created, I add following codes:

for ( i = 0, il = newFaces.length; i < il; i ++ ) {
newFaces[i].materialIndex = oldFaces[ parseInt(i/4)].materialIndex;
}

hope this can help.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.