1. Home
  2. Docs
  3. Getting Started
  4. Moving a 3D Model

Moving a 3D Model

A 3D model can be moved in any of the 3 movement axes (X,Y,Z) for example the bellow code will move a Sphere to the right, left, up, down, back and forward:


1
2
3
4
5
6
7
8
9
10
11
12
13
s is a Sphere

// move right and left
s.move(x+1) in 1 seconds
s.move(x-1) in 1 seconds

// move up and down
s.move(y+1) in 1 seconds
s.move(y-1) in 1 seconds

// move back and forward
s.move(z-10) in 5 seconds
s.move(z+10) in 3 seconds

Use the X axis to move right or left
Use the Y axis to move up or down
Use the Z axis for moving back and forward
Notice that the “+” and “-“ signs control the movement direction on the given axis

Was this article helpful to you? Yes No

How can we help?