AndrewRayCode / AndrewRayCode/three-subdivision-modifier
THREE.SubdivisionModifier.prototype.modify lose materialIndex
オープン
- 主要言語
- JavaScript
- スター
- 4
- フォーク
- 1
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。