Skip to content

multiple materials in one mesh #28

@ousc

Description

@ousc

Hello, I have encountered a problem when using ngx-three. I am not sure whether it is my writing problem or ngx-three does not support this function.
How to have multiple materials in a mesh, which can be used to make things like dice or Rubik's Cube.

A similar question from fiber:
pmndrs/react-three-fiber#744

Writing in native three-js:

    let geometry = new THREE.BoxGeometry( 30,30, 30 );
    let cubeMaterials=[
        new THREE.MeshBasicMaterial({color:'red',side:THREE.DoubleSide}),
        new THREE.MeshBasicMaterial({color:'green',side:THREE.DoubleSide}),
        new THREE.MeshBasicMaterial({color:'blue',side:THREE.DoubleSide}),
        new THREE.MeshBasicMaterial({color:0Xffffff,side:THREE.DoubleSide}),
        new THREE.MeshBasicMaterial({color:0Xffffff,side:THREE.DoubleSide}),
        new THREE.MeshBasicMaterial({color:0Xffffff,side:THREE.DoubleSide})
    ]
 
    let cube = new THREE.Mesh( geometry, cubeMaterials );

It seems that neither the args input nor the fiber-like writing method works

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions