AndrewRayCode / AndrewRayCode/three-subdivision-modifier
THREE.SubdivisionModifier.prototype.modify lose materialIndex
- Langage dominant
- JavaScript
- Étoiles
- 4
- Forks
- 1
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.