Enter The Matrix

https://github.com/mpospese/EnterTheMatrix

The sample application to accompany my conference talk "Enter The Matrix" on matrix transformations.

Slides can be downloaded from here.

It's an iPad app using Storyboards and ARC (strictly for ease of development), so it requires iOS 5.0. The animation techniques used within should all work in iOS 4 (I don't recall using any iOS 5 specific API's), but the code would need to be converted for non-ARC use. The app is tab-based with 7 tabs. Each tab represents one of the demos during the talk.

这是个示例的demo,用来展示我的访谈节目中的"Enter The Matrix"关于矩阵变换的内容.

这是个iPad的demo,使用了Storyboard,ARC,所以需要iOS5.0以上版本.动画中所用到的技术在iOS4中全部都能展示(我没有调用任何iOS5独有的API).这份代码需要转换成non-ARC,进入应用后由7个tab,每个tab代表一个种类的动画.

Quartz 2D Drawing

Contains a UIView subclass that overrides drawRect: to draw a grid of horizontal and vertical lines. A single UIBezierPath object is used to stroke each type of line with CGContextTranslateCTM (also Scale and Rotate) called to transform the CTM for each time the path is stroked. Sliders control the amount of translation, scaling, and rotation between each stroke.

包含了一个UIView的子类重写了drawRect:方法.画一条直线以及竖线.一个贝塞尔曲线对象用来划分CGContextTranslateCTM不同种类的线,slider控制着变换的数量,缩放,旋转等.

CGAffineTransform

Contains a UIImageView that can be transformed as desired. Pan, pinch, and rotate gestures can be used to translate, scale, and rotate the view. Or a popover can be used to explicitly set values and change the order of operations (by dragging the table view cells to reorder them).

包含了一个UIImageView的各种手势,用来移动拖拽旋转等.

CATransform3D

Very similar to the previous tab (they share the same super class), but using CATransform3D instead of CGAffineTransform. The translation, scaling, and rotating can now be done in the Z-dimension as well (and you can specify any vector to rotate about using the popover). A semi-transparent background was added so that you can see when the view is below it in the Z-dimension.

与前一个内容相似(他们继承自同一个类),但是是用的CATransform3D来替换CGAffineTransform.现在可以进行Z轴维度的变换了.

Basic Animation

Demonstrates a simple animation to make a bar move clockwise around the 4 edges of the screen. Switches allow you to animate either frame or transform, and to disable any component of the transform animation.

描述了一个基本动画,使一个bar按照顺时针沿着屏幕的四个角移动.switch控制器允许你既可以让frame进行动画也可以让frame变形以及停止所有的动画.

Keyframe Animation

Demonstrates a keyframe animation. An arc rotates through -90, 0, and 90 degrees. Switches allow you to execute either a basic animation (specifying only the end transform, which doesn't behave in the desired fashion) or a keyframe animation (specifying the transform at intermediate points throughout the animation, thus achieving the desired effect).

描述了关键帧动画,旋转180度.switch控制器允许你执行基本动画类型以及关键帧动画.

Fold Animation

Demonstrates a folding animation similar to that used in the Clear to-do list app. Contains an image divided into 3 portions as if it were 3 table view cells (they are not). Pinching anywhere on the screen collapses the middle cell using a fold effect. Pinching out expands it again.

描述了一个折叠的动画效果.其中一张图片被分割成了3个部分,看起来像3个cell(其实不是),点击屏幕的任何地方都会触发折叠效果,再点击又会折叠回来.

Flip Animation

Demonstrates a page-flipping animation similar to that used in the FlipBoard app. Contains an image that can be flipped either vertically or horizontally and from all 4 sides. It responds to taps or panning near the edge (left/right takes precedent over top/bottom) and swipes anywhere. In a production control, you'd want to choose either vertical or horizontal so that there's no confusion of desired direction when touching near the corners (or else check initial vector of pan if tap start location is ambiguous).

描述了一个折纸效果的动画.包含了一张图片在水平或者垂直方向的4个边.在图片边上点击能触发效果.

[翻译] EnterTheMatrix的更多相关文章

  1. 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...

  2. 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...

  3. [翻译]开发文档:android Bitmap的高效使用

    内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...

  4. 【探索】机器指令翻译成 JavaScript

    前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...

  5. 《Django By Example》第三章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:第三章滚烫出炉,大家请不要吐槽文中 ...

  6. 《Django By Example》第二章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:翻译完第一章后,发现翻译第二章的速 ...

  7. 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...

  8. 【翻译】Awesome R资源大全中文版来了,全球最火的R工具包一网打尽,超过300+工具,还在等什么?

    0.前言 虽然很早就知道R被微软收购,也很早知道R在统计分析处理方面很强大,开始一直没有行动过...直到 直到12月初在微软技术大会,看到我软的工程师演示R的使用,我就震惊了,然后最近在网上到处了解和 ...

  9. ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点

    在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...

随机推荐

  1. IdentityServer4揭秘---Consent(同意页面)

    授权同意页面与登录一样首先要分析页面的需要什么模型元素后建立相关的模型类 界面的话就 记住选择  .按钮.RuturnUrl.以及选择的资源Scope /// <summary> /// ...

  2. 13 在 O(1) 时间内删除链表节点

    删除链表的一个结点,用下一个结点覆盖掉要删除的结点,再释放掉要删结点的下一个结点的内存 Java: public ListNode deleteNode(ListNode head, ListNode ...

  3. 程序设计实习MOOC / 程序设计与算法(二)第二周测验(2018春季)

    递归算法: 1:全排列 总时间限制:  1000ms 内存限制:  65536kB 描述 给定一个由不同的小写字母组成的字符串,输出这个字符串的所有全排列. 我们假设对于小写字母有'a' < ' ...

  4. NHibernate 错误

    Unable to locate persister for the entity named 'Model.Customer'.The persister define the persistenc ...

  5. java的组合和继承

    其实我第一次学习java 的时候根本没有听说过组合这个名词,老师也更没有讲解过,我一直以为是我自己落掉了什么知识点,其实不是的,组合这个名词暂且把它定义为一个思维性的东西吧,相信读者都接触过了,但是并 ...

  6. CSUOJ 1009 抛硬币

    Description James得到了一堆有趣的硬币,于是决定用这些硬币跟朋友们玩个小游戏.在一个N行M列的表格上,每一个第i行第j列的格子上都放有一枚James的硬币,抛该硬币正面朝上的概率为Pi ...

  7. JAVA语言中的运算符和表达式

    JAVA——运算符 按运算符要求的运算符个数可分为一元.二元.三元运算符: 一元运算符有一个操作数:如正数或者负数前面的“+”.“—”,和自增“++”.自减“- -”. 二元运算符有两个操作数:如除法 ...

  8. Ubuntu18.04 之jdk安装与环境配置

    1.oracle官网下载压缩包. 下载地址为: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133 ...

  9. 美团外卖iOS App冷启动治理

    一.背景 冷启动时长是App性能的重要指标,作为用户体验的第一道“门”,直接决定着用户对App的第一印象.美团外卖iOS客户端从2013年11月开始,历经几十个版本的迭代开发,产品形态不断完善,业务功 ...

  10. 使用gSOAP工具生成onvif框架代码

    <工具产生背景>          由于SOAP是一种基于xml的文件,手动编写SOAP文件太机械耗时,在这种背景下产生了gSAOP 这个工具,用于生成各种类型的代码,目前支持C/C++, ...