Giter Club home page Giter Club logo

360vr's Introduction

360 VR

This is a small VR library that can quickly help you build VR app. (As the project contains the ijkplayer, so the project a little big, please be patient to download!)(About 150Mb)

Warning

不支持模拟器,请在真机下测试。(模拟器下会报错)

Example Preview

imageimage

如何使用vrsdk

   SZTLibrary.h 类  

    // create sdk 两种实例方法都可以
    self.sztLibrary = [[SZTLibrary alloc] initWithController:self];
    
    or
    
    self.sztLibrary = [[SZTLibrary alloc] initWithView:self.view];

1、AVPlayer播放器 - 模式切换/滤波器切换

2、ijkPlayer播放器

imageimage  

// 渲染模型
typedef NS_ENUM(NSInteger, SZTRenderModel) {
    SZTVR_2D,                                   // 2d
    SZTVR_SPHERE,                               // 全景
    SZTVR_STEREO_HEMISPHERE,                    // 3D180(左右格式)
    SZTVR_STEREO_SPHERE,                        // 立体全景(上下格式)
    SZTVR_PLANE,                                // 平面
    SZTVR_DOME180,                              // 圆顶180
    SZTVR_STEREO_PLANE_LEFT_RIGHT,              // 立体平面 - 上下
    SZTVR_STEREO_PLANE_UP_DOWN,                 // 立体平面 - 左右
    SZTVR_FISHSPHERE_HIGH,                      // 960 * 2560
    SZTVR_FISHSPHERE_RETINA_HIGH,               // 1520 * 2688
    SZTVR_FISHSPHERE_MEDIUM,                    // 960 * 1920
    SZTVR_FISHSPHERE_RETINA_MEDIUM,             // 1080 * 1920
    SZTVR_3D_MODEL,                             // 3D模型
    SZTVR_CURVEDSURFACE,                        // 曲面屏幕 - 不规则曲面(5面)
    SZTVR_SECTOR,                               // 扇形曲面 - 平滑曲面
};

typedef NS_ENUM(NSInteger, SZTFilterMode) {
    SZTVR_NORMAL,           // 普通
    SZTVR_LUMINANCE,        // 像素色值亮度平均,图像黑白 (黑白效果)
    SZTVR_PIXELATE,         // 马赛克
    SZTVR_EXPOSURE,         // 曝光 (美白)
    SZTVR_DISCRETIZE,       // 离散
    SZTVR_BLUR,             // 模糊
    SZTVR_BILATERAL,        // 双边模糊
    SZTVR_HUE,              // 饱和度 
    SZTVR_POLKADOT,         // 像素圆点花样
    SZTVR_GAMMA,            // 伽马线
    SZTVR_GLASSSPHERE,      // 水晶球效果
    SZTVR_CROSSHATCH,       // 法线交叉线
};

3、单双屏切换

typedef NS_ENUM(NSInteger, SZTModeDisplay) {
    SZTModeDisplayNormal,   // 普通模式
    SZTModeDisplayGlass,    // 分屏模式
};


/**
 * 设置单双屏幕模式  - 默认分屏
 */
- (void)dispalyMode:(SZTModeDisplay)mode;

// 使用方法
[self.SZTLibrary dispalyMode:SZTModeDisplayNormal];

4、陀螺仪/触摸屏/陀&触

typedef NS_ENUM(NSInteger, SZTModeInteractive) {
    SZTModeInteractiveTouch,            // 触摸
    SZTModeInteractiveMotion,           // 陀螺仪
    SZTModeInteractiveMotionWithTouch,  // 陀螺仪和触摸
};

/**
 * 设置交互模式  - 默认陀螺仪
 */
- (void)interactiveMode:(SZTModeInteractive)mode;

// 使用方法
[self.SZTLibrary interactiveMode:SZTModeInteractiveMotion];

5、移动/缩放/旋转/贝塞尔

image  

6、图片加载 - 网络/本地图

image  

7、Gif / APng动图加载

8、Obj模型加载 / MD2模型加载

image  

9、3D立体音效 - openAl

    SZTAudio * audio = [[SZTAudio alloc] init];
    
    NSString* path = [[NSBundle mainBundle] pathForResource:@"sound1" ofType:@"wav"];
    Sound *sounds = [[Sound alloc] initWithFilePath:path];
    [audio addSubAudio:sounds];
    [sounds setPosition:0.0 Y:0.0 Z:-50.0];

10、畸变矫正

image  

typedef NS_ENUM(NSInteger, SZTDistortion) {
    SZTDistortionNormal,   // 无畸变
    SZTBarrelDistortion,   // 桶形畸变模式
};

/**
 * 畸变模式 - 默认无畸变
 */
- (void)distortionMode:(SZTDistortion)mode;

// 使用方法
[self.SZTLibrary distortionMode:SZTDistortionNormal];

11、Label控件/大量弹幕

image  

12、进度条控件

13、焦点拾取/点击拾取

    // 要使用热点拾取功能,一定需要设置该接口
    [self.sztLibrary setFocusPicking:YES];
     
    // 热点拾取方法   object为要被拾取的对象
    SZTTouch *touch = [[SZTTouch alloc] initWithTouchObject:object];
    
    // 拾取的三个状态
    [touch willTouchCallBack:^(GLKVector3 vec) {
        NSLog(@"will select");
    }];
    
    [touch didTouchCallback:^(GLKVector3 vec) {
        NSLog(@"select");
    }];
    
    [touch endTouchCallback:^(GLKVector3 vec) {
        NSLog(@"will leave");
    }];

14、输入框控件

image  

15、更多高级控件

AR

image

加入我们

我们会不定期的更新sdk,加入更多新功能,大家有新的需要或好的想法,欢迎大家加入群一起讨论。

360vr's People

Contributors

szt243660543 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.