Graphics Reference
In-Depth Information
3. When the conversion is done, you can download the various cube map sites.
The recipe in this topic uses the naming convention provided by Cube map
sides option, so download them. You'll end up with six images with names
such as right.png , left.png , top.png , bottom.png , front.png , and
back.png .
Once you've got the sides of the cubemap, you're ready to perform the steps in the
recipe.
How to do it...
To use the cubemap we created in the previous section and create reflecting materi-
al,we need to perform a fair number of steps, but it isn't that complex:
1. The first thing you need to do is create an array from the cubemap images
you downloaded:
var urls = [
'../assets/cubemap/flowers/right.png',
'../assets/cubemap/flowers/left.png',
'../assets/cubemap/flowers/top.png',
'../assets/cubemap/flowers/
bottom.png',
'../assets/cubemap/flowers/front.png',
'../assets/cubemap/flowers/back.png'
];
2. With this array, we can create a cubemap texture like this:
Search WWH ::




Custom Search