Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

rotateObject()

Purpose

Rotate a 3D object

Description

Rotate a 3D object through the specified axes and by the specified amount

Syntax

rotateObject( handle, axes, amount )

Arguments

handle The handle of the placed 3D object

axes vector which describes the axes of rotation { x, y, z } e.g. { 1, 0, 0 } rotates in the x axes only

amount Amount to rotate the object in degrees( 0 to 360)

Example

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

loop
    clear()
    c = controls( 0 )
    setLightPos( light, { x, 4, 2 } )
    if c.left then
        x = x - 0.2
    endIf
    if c.right then
        x = x + 0.2
    endIf
    rotateObject( obj, { 1, 1, 1 }, 0.5 )
    drawObjects()
    printAt( 0, 0, "Use left and right arrows to move light source: ",x )
    update()
repeat

Associated Commands

drawObjects(), loadModel(), objectPointAt(), placeObject(), removeObject(), setObjectMaterial(), 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.