cocos2dx-3.2 3DAction 一些3D特效
网格属性就像是一个个交叉形成的一系列的矩形。任何Node对象(Layer,Scene,Sprite等等)都具有这种特殊的属性,你可以通
过移动他们的顶点来变换这些网格。
有两种类型的网格:平铺的网格和非平铺的网格。他们两者的区别是平铺的网格由单个的网格组成,而非平铺的网格是由顶点组成。
继承于Grid3DAction的为非平铺网格,继承于TiledGrid3DAction的为平铺网格,自然产生的效果不同, 下面来看看都有哪些?
1、Shaky3D(晃动特效)、ShakyTiles3D(瓷砖晃动特效)
ShakyTiles3D参数及用法与Shaky3D一模一样的。
- /**
- * 创建一个3D晃动的特效
- * duration : 持续时间(时间过后不会回到原来的样子)
- * gridSize : 整个屏幕被分成几行几列
- * range : 晃动的范围
- * shakeZ : z轴是否晃动
- * 看源码晃动范围range为网格的上的位置:
- for (i = 0; i < (_gridSize.width+1); ++i)
- {
- for (j = 0; j < (_gridSize.height+1); ++j)
- {
- Vertex3F v = getOriginalVertex(Vec2(i ,j));
- v.x += (rand() % (_randrange*2)) - _randrange;
- v.y += (rand() % (_randrange*2)) - _randrange;
- if (_shakeZ)
- {
- v.z += (rand() % (_randrange*2)) - _randrange;
- }
- setVertex(Point(i, j), v);
- }
- }
- */
- /** creates the action with a range, shake Z vertices, a grid and duration */
- static Shaky3D* create(float duration, const Size& gridSize, int range, bool shakeZ);
2、Waves3D(波浪特效)、WavesTiles3D(瓷砖波浪特效)、Waves(带方向的波浪特效,水平与垂直)
WavesTiles3D参数及用法与Waves3D一模一样的。
- /**
- * 创建一个3D波浪的特效
- * duration : 持续时间(时间过后不会回到原来的样子)
- * gridSize : 整个屏幕被分成几行几列
- * waves :波动的速率
- * amplitude :振幅
- */
- /** creates an action with duration, grid size, waves and amplitude */
- static Waves3D* create(float duration, const Size& gridSize, unsigned int waves, float amplitude);
Waves的参数说明
- /**
- * duration : 持续时间(时间过后不会回到原来的样子)
- * gridSize : 整个屏幕被分成几行几列
- * waves :波动的速率
- * amplitude :振幅
- * horizontal :是否是水平方向
- * vertical :是否是垂直方向
- */
- /** initializes the action with amplitude, horizontal sin, vertical sin, a grid and duration */
- static Waves* create(float duration, const Size& gridSize, unsigned int waves, float amplitude, bool horizontal, bool vertical);
3、FlipX3D(X轴翻转动画)、FlipY3D(Y轴翻转动画)
FlipX3D与FlipY3D一样,给一个时间单位,在此时间内绕X轴或Y轴旋转。
- /**
- * 创建一个x轴翻转精灵的动画
- */
- /** creates the action with duration */
- static FlipY3D* create(float duration);
4、Lens3D(凸镜特效)
- /**
- * 创建一个凸镜特效
- * duration : 持续时间(时间过后不会回到原来的样子)
- * gridSize : 网格大小
- * position : 凸镜中心点
- * radius : 半径
- */
- /** creates the action with center position, radius, a grid size and duration */
- static Lens3D* create(float duration, const Size& gridSize, const Point& position, float radius);
5、Ripple3D(水波特效)
- /**
- * 创建一个水波特效
- * duration : 持续时间(时间过后不会回到原来的样子)
- * gridSize : 网格大小
- * position : 凸镜中心点
- * radius : 半径
- * waves :波动的速率
- * amplitude :振幅
- */
- /** creates the action with radius, number of waves, amplitude, a grid size and duration */
- static Ripple3D* create(float duration, const Size& gridSize, const Point& position, float radius, unsigned int waves, float amplitude);
6、Liquid(液体特效)
和Waves3D的参数一样
- /**
- * 创建一个3D液体的特效
- * duration : 持续时间(时间过后不会回到原来的样子)
- * gridSize : 整个屏幕被分成几行几列
- * waves :波动的速率
- * amplitude :振幅
- */
- /** creates the action with amplitude, a grid and duration */
- static Liquid* create(float duration, const Size& gridSize, unsigned int waves, float amplitude);
7、Twirl(扭曲旋转特效)
- /**
- * 创建一个扭曲的特效
- * duration : 持续时间(时间过后不会回到原来的样子)
- * gridSize : 整个屏幕被分成几行几列
- * position : 扭曲中心位置
- * twirls :扭曲的数量
- * amplitude :振幅
- */
- /** creates the action with center position, number of twirls, amplitude, a grid size and duration */
- static Twirl* create(float duration, const Size& gridSize, Point position, unsigned int twirls, float amplitude);
8、ShatteredTiles3D(破碎的3D瓷砖特效)
- /**
- * 创建一个破碎的3D瓷砖的特效
- * duration : 持续时间(时间过后不会回到原来的样子)
- * gridSize : 整个屏幕被分成几行几列
- * nRange : 晃动的范围
- * bShatterZ : z轴是否晃动
- */
- /** creates the action with a range, whether of not to shatter Z vertices, a grid size and duration */
- static ShatteredTiles3D* create(float duration, const Size& gridSize, int nRange, bool bShatterZ);
9、ShuffleTiles(瓷砖洗牌特效)
- /**
- * 创建一个瓷砖洗牌的特效
- * duration : 持续时间(时间过后不会回到原来的样子)
- * gridSize : 整个屏幕被分成几行几列
- * seed : 随即速度基数(即会用此值作为底数来随机产生值)
- */
- /** creates the action with a random seed, the grid size and the duration */
- static ShuffleTiles* create(float duration, const Size& gridSize, unsigned int seed);
9、FadeOutTRTiles、FadeOutBLTiles、FadeOutUpTiles、FadeOutDownTiles
FadeOutTRTiles :淡出效果, 从左下角到右上角
FadeOutBLTiles :淡出效果, 从右上角到左下角
FadeOutUpTiles :折叠效果, 从下到上
FadeOutDownTiles :折叠效果 从上到下
他们函数参数意义一样
- /**
- * 淡出效果, 从左下角到右上角
- * duration : 时间
- * gridSize :网格大小
- */
- /** creates the action with the grid size and the duration */
- static FadeOutTRTiles* create(float duration, const Size& gridSize);
10、TurnOffTiles(方块消失特效 )
提供了两个函数接口,多用的面一种,参数参照前面的
- /** creates the action with the grid size and the duration */
- static TurnOffTiles* create(float duration, const Size& gridSize);
- /** creates the action with a random seed, the grid size and the duration */
- static TurnOffTiles* create(float duration, const Size& gridSize, unsigned int seed);
11、SplitRows、SplitCols
SplitRows :分多行消失特效
SplitCols :分多列消失特效
- /**
- * rows : 行数
- */
- SplitRows::create(float duration, unsigned int rows)
- /**
- * cols : 列数
- */
- SplitCols::create(float duration, unsigned int cols)
12、PageTurn3D
- PageTurn3D :3D翻页特效,从右下角往左上角翻
- /**
- * gridSize : 网格大小
- */
- PageTurn3D::create(float duration, const cocos2d::Size &gridSize)
cocos2dx-3.2 3DAction 一些3D特效相关推荐
- cocos2dx-3.2(36) 3DAction 一些3D特效
----我的生活,我的点点滴滴!! 网格属性就像是一个个交叉形成的一系列的矩形.任何Node对象(Layer,Scene,Sprite等等)都具有这种特殊的属性,你可以通 过移动他们的顶点来变换这些网 ...
- cocos2dx 特效 3D特效
cocos2dx 常见的22种特效 3D特效 分类: c++ android cocos2dx sprite2013-08-04 21:37 4827人阅读 评论(0) 收藏 举报 Cocos2d-x ...
- Cocos2d-x学习笔记(十二)3D特效
特效类即是GridAction类,其实就是基于网格的3D动作类.需开启OpenGL的深度缓冲,否则容易3D失真. 下边是一个snippet,创建网格对象,并将其添加到当前layer:同时,将进行3D特 ...
- 二.ubuntu14.04 3D特效设置
一.如果按照第一篇都设置好了(显卡驱动等都已经正常),然后 1.安装CCSM设置管理器 用鼠标点击屏幕左侧Unity程序启动栏中的"Ubuntu软件中心"(有"A&quo ...
- 3D特效师可以下班了丨Science
金磊 萧箫 发自 凹非寺 量子位 报道 | 公众号 QbitAI 是否还记得前阵子爆火的SM娱乐公司电子屏海浪? 人工制作那样的特效,可能需要花费--嗯,毕竟被称为「每滴水都是粉丝贡献的钱」. 但现在 ...
- linux虚拟机怎么显示桌面,虚拟机中如何开启Linux的3d特效桌面?
虚拟机中如何开启Linux的3d特效桌面? Linux的3d特效很让人心动啊,可是怎样开启呢? 更新时间:2019-06-06 01:35 相关问答 1.设定软件源,更新软件 点击左边栏Dash主页( ...
- ubuntu 12.04 3D特效
1.设定软件源,更新软件 点击左边栏Dash主页(ubuntu图标),输入更新管理器,会出现更新管理器,打开后点设置,弹出软件源对话框,为确保能够正常更新,选主服务器 点击检查,更新完后,点重启 2. ...
- 10个超漂亮的CSS 3D特效
在油管上看到了10个超漂亮的CSS 3D特效,遂分享给大家,有写是css+JavaScript实现的. 3D Slicebox 在3D立方体上寻找图像幻灯片?查看演示 图像转换 与THREE.js 结 ...
- canvas实现2019最酷炫3D特效
效果展示: 你可以玩一天 源码展示: <!DOCTYPE > <html> <head><title> canvas 实现3d特效 </title ...
最新文章
- python中运算的英文_[lemon]Python中的运算符,LemonPython
- 前端学习(2140):webpack的安装
- ORACLE的程序包1-程序包的基
- 摄影测量学——空间后方交会
- Data URL实现用户头像上传
- bom实现方块移动_javascript利用键盘控制小方块的移动
- certificate expired
- CSS SVG开关按钮切换网页白天和夜晚
- mysql生成连续数字或日期
- 海豚湾(还是忍不住说日本人真的太垃圾了)
- 必备工具!程序员高效率工作工具推荐
- 数据结构上机实验6.15
- 基于Python实现的黑白棋强化学习模型
- Floyd算法求最短路径(附代码实例)
- git fetch批处理,遍历一个文件夹下的所有子目录,执行git fetch --all
- Flashback Oracle文档阅读
- 全国天气预报api接口
- python实现windows ie代理切换
- Java 偏斜锁 轻量级锁 自环锁 重量级锁
- 后台页面-制作铃铛带数字消息提示样式
热门文章
- windows下对拍
- caffe框架和theano框架的所需cudnn的版本冲突问题
- 0_3-激活函数的反向传播-ReLU、LeakyReLU、PReLU、ELU、SELU
- Linux下安装MySql总结
- C++ int long long double 等数据范围!
- ora01722java_java.sql.SQLSyntaxErrorException: ORA-01722: 无效数字
- 穿越东西冲,享受最美海岸线
- docker的基础学习(二)之daocker的安装配置和基本使用
- 人工智能原理之机器学习
- 基于AutoJs实现的薅羊毛专业版第五次大更新