KudanAR - iOS  1.6.0
ARTextureCube Class Reference

#import <ARTextureCube.h>

Inherits ARTexture.

Instance Methods

(instancetype) - initWithUIImages:
 
(instancetype) - initWithBundledFiles:
 
- Instance Methods inherited from ARTexture
(instancetype) - initWithUIImage:
 
(instancetype) - initWithEmpty
 
(instancetype) - initWithExistingTextureID:
 
(void) - generateTexture
 
(void) - uploadTexture
 
(void) - loadTextureFromUIImage:reverseLines:
 
(void) - uploadBGRATexture:width:height:
 
(void) - uploadBGRATextureSub:width:height:
 
(BOOL) - preRender
 
(void) - postRender
 

Additional Inherited Members

- Protected Types inherited from ARTexture
enum  ARTextureFilter { ARTextureFilterNearest, ARTextureFilterLinear }
 
- Protected Attributes inherited from ARTexture
NSData * _rawImage
 
- Properties inherited from ARTexture
GLuint textureID
 
unsigned long width
 
unsigned long height
 
BOOL isPowerOfTwo
 
ARTextureFilter minificationFilter
 
ARTextureFilter magnificationFilter
 

Detailed Description

An ARTextureCube is a "Cubemap" texture, a collection of six square textures that represent the reflections on an environment. The six squares form the faces of an imaginary cube that surrounds an object. Each face represents the view along the directions of the world axes (up, down, left, right, forward and back). Cubemaps are often used to capture reflections or “surroundings” of objects. For example, skyboxes often use cubemaps, as do environment reflections, which allow an object to appear as though it is a reflective surface.

Images used must be a "Power of Two" texture. This means that the width and height of each image must be a power of 2 (128, 256, 512, 1024, etc).

Method Documentation

◆ initWithBundledFiles:

- (instancetype) initWithBundledFiles: (NSArray *)  bundledFiles

Initialise with an array of strings, each of which is a file path relative to the main bundle, pointing to image files. The array must be in the correct order for the mapping to work properly. The order of images cannot be altered once initialised. The correct order of images is as follows: Element 0 - Right. Element 1 - Left. Element 2 - Top. Element 3 - Bottom. Element 4 - Front. Element 5 - Back.

Example of use:

NSArray *array = @[@"rightImage.jpg", @"leftImage.jpg", @"topImage.jpg", @"bottomImage.jpg", @"frontImage.jpg", @"backImage.jpg"];
ARTextureCube *textureCube = [[ARTextureCube alloc] initWithBundledFiles:array];
Parameters
imagesAn array of image file names relative to the main bundle.

◆ initWithUIImages:

- (instancetype) initWithUIImages: (NSArray *)  images

Initialise a cube with an array of UIImage images. The array must be in the correct order for the mapping to work properly. The order of images cannot be altered once initialised. The correct order of images is as follows: Element 0 - Right. Element 1 - Left. Element 2 - Top. Element 3 - Bottom. Element 4 - Front. Element 5 - Back.

Example of use:

UIImage *backImage = [UIImage imageNamed:@"rightImage.jpg"];
UIImage *frontImage = [UIImage imageNamed:@"leftImage.jpg"];
UIImage *leftImage = [UIImage imageNamed:@"topImage.jpg"];
UIImage *rightImage = [UIImage imageNamed:@"bottomImage.jpg"];
UIImage *topImage = [UIImage imageNamed:@"frontImage.jpg"];
UIImage *bottomImage = [UIImage imageNamed:@"backImage.jpg"];
NSArray *array = @[rightImage, leftImage, topImage, bottomImage, frontImage, backImage];
ARTextureCube *textureCube = [[ARTextureCube alloc] initWithUIImages:array];
Parameters
imagesAn array of UIImage objects to load into the cube map.

The documentation for this class was generated from the following files:
ARTextureCube
Definition: ARTextureCube.h:13