I am building a 3D gallery image with planes mapped with image textures. I am having trouble sizing the planes in accordance to the images’ size, as well as dynamically changing the planes’ size, as the images’ slightly differ.
I came up with a simple solution like this. Seeing most of the images are around 1000*1000 pixel size and the plane sizes are around 1 unit, I decided to get the width and height of the image, divide them by 1000 to normalize the values and use them as plane size.
So if you add these lines just before your return statement in Cube.js it should look fine: