Closed Sharlaan closed 4 years ago
This goes a little bit over my knowledge of three, but material arrays are handled using geometry groups, which have to be created when constructing the geometry:
https://github.com/mrdoob/three.js/blob/master/src/geometries/BoxBufferGeometry.js try searching in the code for "group" and you'll see what I'm talking about.
I don't think rounded box, with our implementation, can support this, since we don't know the number of vertices before creating the geometry, since it's created via extrusion.
The soon-to-be-released official version of this geometry ( https://github.com/mrdoob/three.js/blob/45b0103e4dd9904b341d05ed991113f2f9edcc70/examples/jsm/geometries/RoundedBoxBufferGeometry.js ) also doesn't seem to support multi material, so you may be out of luck
Ok thanks, guess i'll stick to boxGeom :/
@gsimone Can I reimplement this component?
Sure!
Hello and amazing job with this lib drei !
I want to display a Dice with colored faces (and another with dotted faces), so multiple materials.
I discovered your nice RoundedBox component and tried to apply an array of materials but does not work :
i'm getting this :
looks like my array of materials is not reaching the boxBufferGeometry inside the RoundeBox ?
What can i do to apply my materials ?