用UIInterpolatingMotionEffect产生透视效果

简介:

用UIInterpolatingMotionEffect产生透视效果

 

效果

 

源码

https://github.com/YouXianMing/Animations



//
//  MotionEffectViewController.m
//  Animations
//
//  Created by YouXianMing on 16/2/18.
//  Copyright © 2016年 YouXianMing. All rights reserved.
//

#import "MotionEffectViewController.h"
#import "UIView+MotionEffect.h"
#import "UIView+SetRect.h"

@interface MotionEffectViewController ()

@end

@implementation MotionEffectViewController

- (void)setup {
    
    [super setup];
    
    {
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, Width - 15, Width - 15)];
        imageView.image        = [UIImage imageNamed:@"最外层"];
        imageView.center       = self.contentView.middlePoint;
        [self.contentView addSubview:imageView];
        
        [imageView addCenterMotionEffectsWithOffset:20.f];
    }
    
    {
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, Width - 15, Width - 15)];
        imageView.image        = [UIImage imageNamed:@"中间层"];
        imageView.center       = self.contentView.middlePoint;
        [self.contentView addSubview:imageView];
        
        [imageView addCenterMotionEffectsWithOffset:10.f];
    }
    
    {
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, Width - 15, Width - 15)];
        imageView.image        = [UIImage imageNamed:@"最里层"];
        imageView.center       = self.contentView.middlePoint;
        [self.contentView addSubview:imageView];
        
        [imageView addCenterMotionEffectsWithOffset:5.f];
    }
}

@end

细节





目录
相关文章
|
机器学习/深度学习 算法 计算机视觉
图形的透视矫正
图形的透视矫正
201 0
|
存储 数据建模 数据库
初探多维表格
最近调研学习了一些多维表格产品,记录一下自己收获的基础认知。在线表格的基础结构是单元格,横向纵向拓展的单元格的集合,就构成了一张工作表。单元格之间可以任意关联,非常灵活。在线表格的适用面很广,能够在数据收集和分析、财会统计等场景发挥重要的作用。在我试图寻找国外的多维表格产品时,发现很少有用「表格」来描述自己的。比如 Airtable 对自己的介绍是:一个构建协同应用的低代码平台。目前国内处于前沿的
996 0
初探多维表格
|
5月前
THREE实战2_正交投影相机与透视相机
THREE实战2_正交投影相机与透视相机
80 1
|
数据可视化 定位技术
GIS空间分析 三维分析1 空间插值与三维可视化
在本文中,你将学习到ArcGIS三维可视化,如何利用三维可视化发现潜在的数据规律
121 0
|
5月前
ArcGIS中ArcMap求取点要素在栅格图像中的行列号的方法
ArcGIS中ArcMap求取点要素在栅格图像中的行列号的方法
|
5月前
|
数据可视化
R可视乎|三维散点图
R可视乎|三维散点图
95 0
|
SQL Oracle 关系型数据库
矢量数据空间查询
空间查询就是根据地物的空间位置进行查询的一种数据检索方式。比如,我们要查询一条河流经的城市;一个公园内的所有路灯;离当前位置最近的公共卫生间等等都属于常用的空间查询。
151 0
ArcMap获取点要素所在栅格图像中的行数与列数
本文介绍在ArcMap软件中,求取点要素在栅格图像中所处行号、列号的方法~
330 1
ArcMap获取点要素所在栅格图像中的行数与列数
|
移动开发 数据可视化 数据挖掘
1个 GIS 中的热图 创建技巧
1个 GIS 中的热图 创建技巧
209 0
1个 GIS 中的热图 创建技巧
|
数据挖掘 开发者 Python
数据透视表|学习笔记
快速学习数据透视表
153 0
数据透视表|学习笔记