# Position objects in front of camera

**URL:** <https://discourse.threejs.org/t/position-objects-in-front-of-camera/39806>\
**Category:** Questions\
**Created:** [June 29, 2022, 8:35pm UTC](https://discourse.threejs.org/t/position-objects-in-front-of-camera/39806 "2022-06-29T20:35:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![artrayd](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/artrayd/32/27582_2.png) [@artrayd](https://discourse.threejs.org/u/artrayd)\
**Post date:** [June 29, 2022, 8:35pm UTC](https://discourse.threejs.org/t/position-objects-in-front-of-camera/39806/1 "2022-06-29T20:35:59Z")

</div>

Hello ThreeJS people 🖖

I want to create an animation where balls fill the camera view, but I have struggled with positioning these objects. Is there some intelligent way to do this?

Here is the I created:  
https://codepen.io/Artrayd/embed/preview/GRxKmyb?default-tabs=js%2Cresult&height=300&host=https%3A%2F%2Fcodepen.io&slug-hash=GRxKmyb

I want to achieve this result (screen filled with balls):

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/2/2/22d44447d02690872a15ba1b60cf5b9b69b24a9d.png)

---

<div class="post-metadata">

**Author:** ![drcmda](https://avatars.discourse-cdn.com/v4/letter/d/91b2a8/32.png) [@drcmda](https://discourse.threejs.org/u/drcmda)\
**Post date:** [June 29, 2022, 9:26pm UTC](https://discourse.threejs.org/t/position-objects-in-front-of-camera/39806/2 "2022-06-29T21:26:21Z")

</div>

your best bet could be physics since positioning them otherwise will most likely look a bit static.

 ![Screenshot 2022-06-29 at 23.23.39](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/0/e/0e5ba69abf2c8dfba690819f989a1066d243a65d.png)

> **[Basic ballpit - CodeSandbox](https://codesandbox.io/s/basic-ballpit-0fqow2?file=%2Fsrc%2FApp.js)**
>
> Physics simulation using cannon.

this demo uses [cannon-es](https://github.com/pmndrs/cannon-es), also deals with responsiveness (resizing the window). it’s react, you’d need to go through cannons docs to figure out how to do it in vanilla, but it’s not that hard.
