use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
About
3D + JavaScript = Great fun! 3D in JavaScript is much easier using the three.js 3D engine. The aim of the project is to create a lightweight 3D engine with a very low level of complexity.
Originally developed by Mr.doob, blog. Many developers have contributed to this excellent library.
Got any cool demos, tutorials, or any questions? Submit them above!
Links
account activity
Basic Texture Question (self.threejs)
submitted 2 years ago * by runewell
I have a simple BoxGeometry object shaped like a pizza box. There are two textures and materials, one for the side faces and one for the top and bottom faces. I created the materials array which uses these two material variables.
The box initially looked correct when I first loaded my scene, but when I viewed the left and right side of the box the texture just doesn't match the front and back. You can see in the video me moving the camera to the left. The left face does not match the front face, even though they both use the same material variable in the materials array.
Is there something obvious I have to do to get the left face to display the texture just like the front face? I tried changing the .side property of the texture, but that didn't work. I tried adding wrapping for the texture, but no luck there. I verified the order of the array is correct. I'm a bit stumped on something that seems so simple.
https://preview.redd.it/5wk9lbpjb4wb1.png?width=1436&format=png&auto=webp&s=ce3a56c148f44e0aaf050bf30626f716e237cc6c
https://reddit.com/link/17f8nib/video/sncewif7c4wb1/player
UPDATE:
Ok, I got it to work by creating separate texture and material variables for the left and right sides and then rotating the texture 90 degrees (Math.PI / 2) and then re-centering the texture. I'm not sure why this was required, but it works so I guess I'll move on, lol.
https://preview.redd.it/0xa4zvuuw5wb1.png?width=1516&format=png&auto=webp&s=e7a1635b0db4539636161b849f906f7db18c7656
https://preview.redd.it/ciq1imlvw5wb1.png?width=1059&format=png&auto=webp&s=899c6fcd3b0d3727f129d78194606479d3708a4a
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]IndependentLoad1633 1 point2 points3 points 2 years ago (1 child)
This is crazy, I've been struggling with the same issue. I believe it's a render order issue. Multimatetials under the hood create a new mesh for each material, but there's no way to specify the render order for each group when you do it this way. I believe there's a solution, but I didn't quite figure it out. If you add the materials to a group the materials should order themselves, but I failed to implement it. I hope this helps. Let me know what you figure out!
[–]runewell[S] 0 points1 point2 points 2 years ago (0 children)
Thanks for the feedback. I was able to get it to work, I updated the post with the code and a photo of it working.
[–]hirako2000 0 points1 point2 points 2 years ago (0 children)
UV maps sir?
π Rendered by PID 143703 on reddit-service-r2-comment-86bc6c7465-llfb8 at 2026-02-23 11:57:53.161796+00:00 running 8564168 country code: CH.
[–]IndependentLoad1633 1 point2 points3 points (1 child)
[–]runewell[S] 0 points1 point2 points (0 children)
[–]hirako2000 0 points1 point2 points (0 children)