AndrewRayCode / AndrewRayCode/three-subdivision-modifier

THREE.SubdivisionModifier.prototype.modify lose materialIndex

オープン
#2 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。