I am trying to set the background contents of a scene to a skybox effect using about array of 6 images.
I have created the array of images in the correct order, I know I need to then use
+ (instancetype) materialPropertyWithContents:(id)contents
However I'm struggling to work out how and where exactly I use that class method to return the property containing the cube map.
Swift 5.0 / iOS 13
Some changes in newer Swift versions:
SCNScene's "background" property is of the SCNMaterialProperty class. So you can directly set it's contents to an array of 6 images to setup your skybox (see SCNScene.h).
Make sure your 6 images are square and with the same dimensions.
HERES my awakeFromNib for a ScnView subclass
yes its confusing as the value assigned to content is id and theres so few samples.
HERES my awakeFromNib for a ScnView subclass
Use any 6 images of same size. TGA not required.
Google skybox to find examples.
This sample makes a skybox and also applys the same images to a cube which make it seem to mirror the sky.
Camera control is on so just move your mouse to rotate what looks like a mirrored cube