How to use the @babylonjs/core/Maths/math.Color3.Black function in @babylonjs/core

To help you get started, we’ve selected a few @babylonjs/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brianzinn / react-babylonjs / stories / babylonjs / 4-advanced / MashupButton.js View on Github external
function onControlAdded (button3d) {
  if (button3d.hostInstance && button3d.hostInstance.mesh && button3d.hostInstance.mesh.material) {
    // the material is only available after attaching to BabylonJS host (3D GUI)
    const material = button3d.hostInstance.mesh.material

    material.diffuseColor = Color3.Black()

    button3d.hostInstance.pointerEnterAnimation = () => {
      material.emissiveColor = Color3.FromInts(15, 15, 15)
    }

    button3d.hostInstance.pointerOutAnimation = () => {
      material.emissiveColor = Color3.Black()
    }
  } else {
    console.error('onControlAdded(): no host instance -> mesh -> material', button3d)
  }
}
github andyhall / noa / src / components / shadow.js View on Github external
export default function (noa, dist) {

    var shadowDist = dist

    // create a mesh to re-use for shadows
    var scene = noa.rendering.getScene()
    var disc = Mesh.CreateDisc('shadow', 0.75, 30, scene)
    disc.rotation.x = Math.PI / 2
    disc.material = noa.rendering.makeStandardMaterial('shadowMat')
    disc.material.diffuseColor = Color3.Black()
    disc.material.ambientColor = Color3.Black()
    disc.material.alpha = 0.5
    disc.setEnabled(false)

    // source mesh needn't be in the scene graph
    scene.removeMesh(disc)


    return {

        name: 'shadow',

        order: 80,

        state: {
            size: 0.5,
github andyhall / noa / src / components / shadow.js View on Github external
export default function (noa, dist) {

    var shadowDist = dist

    // create a mesh to re-use for shadows
    var scene = noa.rendering.getScene()
    var disc = Mesh.CreateDisc('shadow', 0.75, 30, scene)
    disc.rotation.x = Math.PI / 2
    disc.material = noa.rendering.makeStandardMaterial('shadowMat')
    disc.material.diffuseColor = Color3.Black()
    disc.material.ambientColor = Color3.Black()
    disc.material.alpha = 0.5
    disc.setEnabled(false)

    // source mesh needn't be in the scene graph
    scene.removeMesh(disc)


    return {

        name: 'shadow',

        order: 80,

        state: {
            size: 0.5,
            _mesh: null,
github brianzinn / react-babylonjs / stories / babylonjs / 2-withVR / withVr.stories.js View on Github external
let baseUrl = 'https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/'
    return (
      
        
          

          
            
          

          
            
            
          
          
          
github brianzinn / react-babylonjs / stories / babylonjs / ScaledModelWithProgress.js View on Github external
this.props.onModelLoaded(model, this.props.sceneContext)
            }
          }}
          position={this.props.center}
          rootUrl={this.props.rootUrl}
          sceneFilename={this.props.sceneFilename}
          pluginExtension={this.props.fileExtension}
          rotation={this.props.modelRotation}
        />
        {(this.state.loadProgress < 1) &&
        
          
            
          
          
        
        }
      
    )
  }
}
github brianzinn / react-babylonjs / stories / babylonjs / 4-advanced / MashupButton.js View on Github external
button3d.hostInstance.pointerOutAnimation = () => {
      material.emissiveColor = Color3.Black()
    }
  } else {
github brianzinn / react-babylonjs / stories / babylonjs / 4-advanced / remix.stories.js View on Github external
this.getItems(`https://api.remix3d.com/v3/boards/${result.item.id}`, 'boards', this.state.headers)
                            } else if (result.type === 'creation') {
                              this.loadCreation(result.item)
                            }
                          }}
                        />
                      )
                    } else {
                      return null
                    }
                  })
                }