# Huge performance problems on position change

**URL:** <https://discourse.threejs.org/t/huge-performance-problems-on-position-change/16354>\
**Category:** Questions\
**Tags:** matrixposition, orbit\
**Created:** [June 18, 2020, 3:05pm UTC](https://discourse.threejs.org/t/huge-performance-problems-on-position-change/16354 "2020-06-18T15:05:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vincentbosch7](https://avatars.discourse-cdn.com/v4/letter/v/f4b2a3/32.png) [@vincentbosch7](https://discourse.threejs.org/u/vincentbosch7)\
**Post date:** [June 18, 2020, 3:05pm UTC](https://discourse.threejs.org/t/huge-performance-problems-on-position-change/16354/1 "2020-06-18T15:05:35Z")

</div>

I’m working on a project that has normal divs positioned to 3D objects (spheres). Whenever the camera changes I use an event that changes the position of the div according to the position of the 3D sphere.

When moving the camera I experience huge performance problems, especially on Chrome. (It’s not as bad on other browsers).

The project can be found here: [https://inhalkmaar.xtrahost.nl/](https://inhalkmaar.xtrahost.nl/)

Is there is a fix for this or a better way to make ‘2d labels’?

---

<div class="post-metadata">

**Author:** ![prisoner849](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/prisoner849/32/535_2.png) [@prisoner849](https://discourse.threejs.org/u/prisoner849)\
**Post date:** [June 18, 2020, 3:31pm UTC](https://discourse.threejs.org/t/huge-performance-problems-on-position-change/16354/2 "2020-06-18T15:31:20Z")

</div>

Hi!  
Try to replace this:

```auto
        objData.divElem.style.left = proj.x + 'px';
        objData.divElem.style.top = proj.y + 'px';  

```

with this:

```auto
        objData.divElem.style.transform = `translate(${proj.x}px, ${proj.y}px)`;

```

And there is an example for 2d labels: [https://threejs.org/examples/?q=2d#css2d\_label](https://threejs.org/examples/?q=2d#css2d_label)

---

<div class="post-metadata">

**Author:** ![vincentbosch7](https://avatars.discourse-cdn.com/v4/letter/v/f4b2a3/32.png) [@vincentbosch7](https://discourse.threejs.org/u/vincentbosch7)\
**Post date:** [June 19, 2020, 7:43am UTC](https://discourse.threejs.org/t/huge-performance-problems-on-position-change/16354/3 "2020-06-19T07:43:17Z")

</div>

Thanks for your response. The code didn’t do it for me, but the example did! Thanks.
