• iPhone开发之全景展示(panoramagl)


    1 //相应地方添加成员变量
    2 plView = [[PLView alloc] initWithFrame:self.view.frame];
    3 plView.delegate=self;
    4 [self.view addSubview:plView];
    5 [self.view sendSubviewToBack:plView];//送到最里端
     1 -(void)selectPanorama:(NSInteger)index
     2 {
     3     NSObject<PLIPanorama> *panorama = nil;
     4     //Spherical2 panorama example (supports up 2048x1024 texture)
     5     if(index == 0)
     6     {
     7         panorama = [PLSpherical2Panorama panorama];
     8         [(PLSpherical2Panorama *)panorama setImage:[PLImage imageWithPath:[[NSBundle mainBundle] pathForResource:@"pano_sphere2" ofType:@"jpg"]]];
     9     }
    10     //Spherical panorama example (supports up 1024x512 texture)
    11     else if(index == 1)
    12     {
    13         panorama = [PLSphericalPanorama panorama];
    14         [(PLSphericalPanorama *)panorama setTexture:[PLTexture textureWithImage:[PLImage imageWithPath:[[NSBundle mainBundle] pathForResource:@"pano_sphere" ofType:@"jpg"]]]];
    15     }
    16     //Cubic panorama example (supports up 1024x1024 texture per face)
    17     else if(index == 2)
    18     {
    19         PLCubicPanorama *cubicPanorama = [PLCubicPanorama panorama];
    20         [cubicPanorama setTexture:[PLTexture textureWithImage:[PLImage imageWithPath:[[NSBundle mainBundle] pathForResource:@"pano_f" ofType:@"jpg"]]] face:PLCubeFaceOrientationFront];
    21         [cubicPanorama setTexture:[PLTexture textureWithImage:[PLImage imageWithPath:[[NSBundle mainBundle] pathForResource:@"pano_b" ofType:@"jpg"]]] face:PLCubeFaceOrientationBack];
    22         [cubicPanorama setTexture:[PLTexture textureWithImage:[PLImage imageWithPath:[[NSBundle mainBundle] pathForResource:@"pano_l" ofType:@"jpg"]]] face:PLCubeFaceOrientationLeft];
    23         [cubicPanorama setTexture:[PLTexture textureWithImage:[PLImage imageWithPath:[[NSBundle mainBundle] pathForResource:@"pano_r" ofType:@"jpg"]]] face:PLCubeFaceOrientationRight];
    24         [cubicPanorama setTexture:[PLTexture textureWithImage:[PLImage imageWithPath:[[NSBundle mainBundle] pathForResource:@"pano_u" ofType:@"jpg"]]] face:PLCubeFaceOrientationUp];
    25         [cubicPanorama setTexture:[PLTexture textureWithImage:[PLImage imageWithPath:[[NSBundle mainBundle] pathForResource:@"pano_d" ofType:@"jpg"]]] face:PLCubeFaceOrientationDown];
    26         panorama = cubicPanorama;
    27     }
    28     //Cylindrical panorama example (supports up 1024x1024 texture)
    29     else if(index == 3)
    30     {
    31         panorama = [PLCylindricalPanorama panorama];
    32         //((PLCylindricalPanorama *)panorama).isHeightCalculated = NO;
    33         [(PLCylindricalPanorama *)panorama setTexture:[PLTexture textureWithImage:[PLImage imageWithPath:[[NSBundle mainBundle] pathForResource:@"pano_sphere" ofType:@"jpg"]]]];
    34     }
    35 }

    两个下载地址:http://code.google.com/p/panoramagl/

    https://github.com/menssen/panoramagl#51-with-interface-builder

    另有介绍使用的:http://www.codeproject.com/Articles/60635/Panorama-360-iPod-Touch-iPhone

  • 相关阅读:
    自定义Maven Archetype模板
    [Discuz!NT] Crash问题记录
    echarts渐变色实现方法
    关于windows7 IIS 7.5和Vista IIS 7.0 局域网无法访问的解决方法
    返回接口信息
    [转]简易下拉框式日期选择器(带闰平年判断)
    漂亮的验证码
    EXT.NET 使用 Ueditor编辑器,并在后台获取的方法
    WIN7 IIS不能显示特殊图片 “+”,""号的图片需要转义才可以显示
    人才网查找职位的复杂SQL用法
  • 原文地址:https://www.cnblogs.com/ubersexual/p/3366149.html
Copyright © 2020-2023  润新知