I'meters attempting to develop a three.js dice with various textures on each face.
Essentially a dice. This is in my sandbox environment, therefore should simply product a rotating cube with dice images (1-6) on each aspect. Once done I plan to use this for a browser base video game. This example I have only tested in Chromium, although considering altering it to a canvas renderer for additional browser support.
![Renderworks Apply Textures To One Face Renderworks Apply Textures To One Face](http://archoncadcom.wpengine.com/wp-content/uploads/2018/09/vectorworks-tip-460-1.gif)
Got a look at a several questions here on SO and a significant amount of various other googling, and though I got the response (seemed reasonably basic really) but I merely cannot obtain it to work.
Open the image you want to apply the texture to (in my case the portrait) in Photoshop. We are going to create what is known as a displacement map to apply to the texture. This makes the texture seem like it wraps round the face, instead of just being a flat texture in front of the face.
I was reasonably fresh to three.js, but not really JavaScript.
Web pages I utilized for guide are
and enriquemorenotent.com - three.js creating a cube with different materials on each face
My Code
The mistake I are getting is
from three.js line 19546 (not really the minutes edition) WHichi will be the bufferGuessUVType(material) function - materials will be undefined. Which qualified prospects me to believe something is certainly not right in one/all of my materials definitions.
Making use of three.js l58.
There is really no Code or CSS, simply the JS at this stage
I can quite happily get a cube spinning with the same picture on all six sides but not with various images. The images are simply the pictures of a chop dots, 1 - 6.
![Renderworks Apply Textures To One Face Renderworks Apply Textures To One Face](/uploads/1/2/5/8/125822666/493146617.jpg)
Provided a little bit more time I could perform a fiddle if required
sohnryang57411 silver badge1111 magic badges2424 bronze badges
OJayOJay4,04922 silver badges1818 magic badges3535 bronze badges
1 Response
EDIT:
THREE.MultiMaterial
has ended up deprecated. You can today move the components array directly into the constructor. Like so:End up being careful of copying old good examples from the net.
Usually check out the Migration Wiki for help updating to the present edition.
three.js l.85
WestLangleyWestLangley80.3k88 magic badges185185 silver precious metal badges202202 bronze badges