1

I have a THREE.js scene that I will be adding various meshes to that is rendered using an orthographic camera, like so:

THREE.js scene

I want to be able to find the width and height of the area that the object appears within on screen so I can draw an element in the DOM on top of the scene, like this:

THREE.js scene with DOM element overlayed

Is this possible?

Many thanks!

mibbler
  • 405
  • 4
  • 12
  • This answer could be helpful: https://stackoverflow.com/a/27410603/13424097 It includes a jsfiddle where `span` elements change their position based on three.js objects. – Sev May 26 '20 at 14:07
  • Thanks @Sev. I'm actually using that code already to find the position of the object, but it only gives you the centre point, whereas I'm looking for the position, width and height altogether in order to place an element directly over the object. Maybe that functionality could be adapted to do this, but I wouldn't know how. – mibbler May 26 '20 at 15:52

0 Answers0