Set canvas size and position as underlying image

Hi there!

I have an image and want to place a three js canvas over it with the exact same size and position as the image. The image changes its size and position when the window is resized (basic responsiveness).

How do I make the three js canvas always fit exactly over the 2D image?


You can take the offset of image in java script

You can take top, left and width of the image

And now you can have a full responsive canvas !

Ah, that was very helpful! Thanks a lot!