loadCubeMap
Asynchronously loads six images and creates a cube map. Returns a promise that will resolve to a CubeMap once loaded, or reject if any image fails to load.
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
context |
Context | The context to use to create the cube map. | ||
urls |
Object | The source of each image, or a promise for each URL. See the example below. | ||
allowCrossOrigin |
Boolean |
<optional> |
true | Whether to request the image using Cross-Origin Resource Sharing (CORS). CORS is only actually used if the image URL is actually cross-origin. Data URIs are never requested using CORS. |
Throws:
-
DeveloperError : context is required.
-
DeveloperError : urls is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.
Returns:
Example
loadCubeMap(context, { positiveX : 'skybox_px.png', negativeX : 'skybox_nx.png', positiveY : 'skybox_py.png', negativeY : 'skybox_ny.png', positiveZ : 'skybox_pz.png', negativeZ : 'skybox_nz.png' }).then(function(cubeMap) { // use the cubemap }, function() { // an error occurred });