# How do I move an object in 3d space?

**URL:** <https://discourse.processing.org/t/how-do-i-move-an-object-in-3d-space/938>\
**Category:** Beginners\
**Created:** [June 14, 2018, 1:02am UTC](https://discourse.processing.org/t/how-do-i-move-an-object-in-3d-space/938 "2018-06-14T01:02:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xxxlaf](https://avatars.discourse-cdn.com/v4/letter/x/ecc23a/32.png) [@xxxlaf](https://discourse.processing.org/u/xxxlaf)\
**Post date:** [June 14, 2018, 1:02am UTC](https://discourse.processing.org/t/how-do-i-move-an-object-in-3d-space/938/1 "2018-06-14T01:02:58Z")

</div>

My code is…

```auto
function setup() 
{
  
	createCanvas(500, 500, WEBGL);

}

function draw() 
{
  
  	background(200);

  	orbitControl();

  	// Objects
  	box(75, 100, 50);
  	sphere(50)

}

```

How would I change the x and y position of the box and/or the sphere?

---

<div class="post-metadata">

**Author:** ![codingking03](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@codingking03](https://discourse.processing.org/u/codingking03)\
**Post date:** [June 14, 2018, 3:00am UTC](https://discourse.processing.org/t/how-do-i-move-an-object-in-3d-space/938/2 "2018-06-14T03:00:46Z")

</div>

a 3D object will be built automatically in your current location. to move the location use translate(x,y,z);

```auto
push();// begin motion
translate(x,y,z);
noFill();
sphere(50);
pop();//end motion

```

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [June 4, 2020, 9:36pm UTC](https://discourse.processing.org/t/how-do-i-move-an-object-in-3d-space/938/3 "2020-06-04T21:36:11Z")

</div>

A post was split to a new topic: [Processing vs Rhino coordinates](https://discourse.processing.org/t/processing-vs-rhino-coordinates/21572)
