Tuesday, 20 August 2013

How to use GLKTextureLoader to load a cubemap from a web url

How to use GLKTextureLoader to load a cubemap from a web url

Unsure how to use an image loaded from the web as an asset in a GLKit
skybox (like the old apple/google maps streetview) There are 2 methods for
loading cubemaps with GLKTextureLoader: cubeMapWithContentsOfFile and
cubeMapWithContentsOfUrl
If I grab the image locally it works fine:
NSString *path = [[NSBundle mainBundle] pathForResource:@"pano"
ofType:@"jpg"];
GLKTextureInfo *skyboxCubemap = [GLKTextureLoader
cubeMapWithContentsOfFile:imgPath options:options error:&error];
So is there a way to get a path from an image loaded from the web and use
it here?

No comments:

Post a Comment