Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

setObjectMaterial()

Purpose

Set the material of a 3D object

Description

Changes the way light behaves on the surface of the object.

Syntax

setObjectMaterial( handle, colour, metallic, roughness )
setObjectMaterial( handle, colour, metallic, roughness, emissiveStrength )

Arguments

handle The handle of the placed 3D object

colour colour name or RGB values { red, green, blue, opacity } between 0 and 1

metallic A flag to indictate whether the object is metallic(1) or non metallic(0)

roughness A value for the roughness of the objects between 0 and 1 (0 is completely smooth and 1 is very rough)

emissiveStrength Float strength of the object's light emission. Emitted light does not affect other objects and does not cast shadows

Example

obj = placeObject( sphere, { 0, 0, 0 }, { 2, 2, 2 } )
setObjectMaterial( obj, red, 1, 1 )
setCamera( { 5, 5, 10 }, { 0, 0, 0 } )
light = pointLight( { 0, 4, 2 }, white, 50 )

loop
    clear()
    c = controls( 0 )
    if c.a then
        setObjectMaterial( obj, red, 0, 1 )
    endIf
    if c.b then
        setObjectMaterial( obj, red, 1, 0 )
    endIf    
    if c.x then
        setObjectMaterial( obj, red, 0, 0 )
    endIf
    if c.y then
        setObjectMaterial( obj, red, 1, 1 )
    endIf
    drawObjects()
    printAt( 0, 0, "Use A, B, X and Y buttons to change object material" )
    update()
repeat

Associated Commands

drawObjects(), loadModel(), objectPointAt(), placeObject(), removeObject(), rotateObject(), setObjectPos(), setObjectScale()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.