-
-
Notifications
You must be signed in to change notification settings - Fork 36k
New BoxBufferGeometry #8195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New BoxBufferGeometry #8195
Conversation
BoxGeometry's BufferGeometry port
Nice work! Unfortunately, mesh = new THREE.Mesh( new THREE.BoxGeometry(), new THREE.MultiMaterial( materials ) ); |
@WestLangley Any ideas, how we can add |
This is a lot of history on that issue. I do not recall what the current status is. |
Thanks for the link 👍 . I'll try to get an overview... |
I can manage to add a group for each side of the box, so you can use a for ( var i = 0, l = groups.length; i < l; i ++ ) {
var group = groups[ i ];
var groupMaterial = materials[ group.materialIndex ];
if ( groupMaterial.visible === true ) { // ERROR: Cannot read property 'visible' of undefined
pushRenderItem( object, geometry, groupMaterial, _vector3.z, group );
}
} Because a box has six sides, |
I think this can be easily fixed by passing /ping @mrdoob
If I recall correctly, that used to work: the materials would repeat. Perhaps not with the current design, though. |
I've provided a simple jsfiddle with the new code. Removing one of the
👍 That works great! (change in the jsfiddle the |
This looks good to me. Thanks! |
Did they? I think it was always the expectation that the MultiMaterial will have the same amount of materials. But if the user misses one we should be able to handle that. |
Many thanks! |
This PR introduces
BoxBufferGeometry
, the BufferGeometry port ofBoxGeometry
. I've changed three examples so they directly useBoxBufferGeometry
.