Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

setCamera()

Purpose

Set the position of the camera in 3D space

Description

Positions the camera in 3D space and where it is pointing to

Syntax

setCamera( location, target )

Arguments

location A position vector in 3 dimensional space { x, y, z } where the camera is located

target A position vector in 3 dimensional space { x, y, z } where the camera is pointing

Example

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

loop
    clear()
    c = controls( 0 )
    setCamera( { x, y, 10 }, { 0, 0, 0 } )
    if c.left then
        x -= 0.2
    endIf
    if c.right then
        x += 0.2
    endIf
    if c.up then
        y += 0.2
    endIf
    if c.down then
        y -= 0.2
    endIf
    drawObjects()
    printAt( 0, 0, "Use arrows to move camera" )
    printAt( 0, 1, "x = ", x, " y = ", y )
    update()
repeat

Associated Commands

drawObjects(), placeObject(), pointLight(), rotateObject(), setObjectMaterial()

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.