trois
trois copied to clipboard
Using more than one texture for a box
I am not getting this: How can I set and use more than one texture for a box? This is working and the texture is used for every side.
<Box
:ref="setBoxReference"
v-for="i in numberOfBars"
:position="{ x: xStart, y: yStart + i * 4, z: 0 }"
:width="width"
:height="height"
:depth="depth"
>
<LambertMaterial>
<Texture src="src/assets/images/bar/front.jpg" />
</LambertMaterial>
</Box>
How can this be accomplished? Adding six textures is not working.
Just opened a PR with a fix for this. After it is merged (or if you use my fork), you can do what you asked like this:
<Box
:ref="setBoxReference"
v-for="i in numberOfBars"
:position="{ x: xStart, y: yStart + i * 4, z: 0 }"
:width="width"
:height="height"
:depth="depth"
>
<LambertMaterial>
<Texture src="src/assets/images/bar/right.jpg" />
</LambertMaterial>
<LambertMaterial>
<Texture src="src/assets/images/bar/left.jpg" />
</LambertMaterial>
<LambertMaterial>
<Texture src="src/assets/images/bar/above.jpg" />
</LambertMaterial>
<LambertMaterial>
<Texture src="src/assets/images/bar/below.jpg" />
</LambertMaterial>
<LambertMaterial>
<Texture src="src/assets/images/bar/behind.jpg" />
</LambertMaterial>
<LambertMaterial>
<Texture src="src/assets/images/bar/ahead.jpg" />
</LambertMaterial>
</Box>