I am attempting to create a 3D box in THREE.js that represents a box made up of 2x4 Legos, measuring 24 pieces wide by 48 pieces long and an unspecified number of pieces tall. I have created a texture displaying this pattern using random colors:
https://i.sstatic.net/sFuRN.png
I want to display two sides of this cube while ensuring that the textures align so that the edge pieces match in color, similar to what is shown in this Blender-generated image:
https://i.sstatic.net/eUP8T.jpg
I would prefer not to create six separate images for a CubeTexture, especially since four would be unnecessary. Is there a way to flip the texture on one side to create the appearance of alignment? (This is purely for visual effect.)
Furthermore, not all 3D rectangles will be cubes, but I am struggling to determine how to set the texture.repeat.x
and texture.repeat.y
properties so that the width scales correctly while maintaining the same vertical scale, stopping when it reaches the object's height, like in this example:
https://i.sstatic.net/ZTtZs.png
Thank you!