摘要: 代码写出来了,只是理解得不够深。先计算镜头的显示坐标,再计算各点与镜头的距离,就是在镜头中的坐标。package{ import flash.display.GraphicsTrianglePath; import flash.display.Sprite; import flash.display.TriangleCulling; import flash.events.Event; import flash.geom.Vector3D; /** * @author:Gaara * 2012-3-14 * **/ [SWF(width="800", height=&quo 阅读全文
posted @ 2012-03-16 20:13 luozhifu 阅读(295) 评论(4) 推荐(0) 编辑
摘要: 游戏中的镜头。锁定对象,根据计算坐标,修改父容器坐标,让物品处于最中点。package{ import flash.display.Sprite; import flash.display.Stage; import flash.events.Event; import flash.filters.GlowFilter; import flash.geom.Point; /** * @author:Gaara * 2012-3-16 * **/ public class Camer extends Sprite { private var myStage:Stage; priv... 阅读全文
posted @ 2012-03-16 16:05 luozhifu 阅读(181) 评论(0) 推荐(1) 编辑
摘要: package{ import flash.display.GraphicsTrianglePath; import flash.display.Sprite; import flash.display.TriangleCulling; import flash.events.Event; import flash.geom.Vector3D; /** * @author:Gaara * 2012-3-14 * **/ [SWF(width="800", height="600" ,frameRate="30", background 阅读全文
posted @ 2012-03-15 15:26 luozhifu 阅读(253) 评论(0) 推荐(0) 编辑
摘要: package{ import flash.display.GraphicsTrianglePath; import flash.display.Sprite; import flash.display.TriangleCulling; import flash.events.Event; import flash.geom.Vector3D; /** * @author:Gaara * 2012-3-14 * **/ [SWF(width="800", height="600" ,frameRate="30", background 阅读全文
posted @ 2012-03-15 11:22 luozhifu 阅读(295) 评论(1) 推荐(0) 编辑
摘要: 看pan大神的博客,研究源码。package{ import flash.display.Bitmap; import flash.display.GraphicsTrianglePath; import flash.display.Sprite; /** * @author:Gaara * 2012-3-13 * **/ [SWF(width="800", height="600" ,frameRate="30", backgroundColor="#000000")] public class TestDraw 阅读全文
posted @ 2012-03-13 16:04 luozhifu 阅读(948) 评论(0) 推荐(0) 编辑
摘要: 随机创建多个对象上一篇做了一绕z轴坐标旋转的正方体,这一篇随机创建1000个点,并进行尝试排序以及向屏幕移动。当z坐标小于0时移除对象。package{ import flash.display.Sprite; import flash.events.Event; /** * @author:Gaara * 2012-3-5 * **/ [SWF(width="800", height="600" ,frameRate="12", backgroundColor="#000000")] public class T 阅读全文
posted @ 2012-03-06 17:46 luozhifu 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 3d图形在原有的平面x,y的基础上加入深度z轴,使用几何透视法重新计算物体x,y坐标。坐标系统flash 3d中默认使用右手坐标系统,x坐标从左到右,y坐标从上到下,z从外到里指向屏幕.如图:透视法远小近大的原理,物体越远越靠近消失点,缩放比例更小。透视公式scale = fl/(fl+z),z坐标越大,公式分母越大,缩放比例越小。例子,首先创建一个ball类。package{ import flash.display.ColorCorrection; import flash.display.Sprite; /** * @author:Gaara * 2012-3-5 * *... 阅读全文
posted @ 2012-03-06 16:31 luozhifu 阅读(433) 评论(0) 推荐(0) 编辑
摘要: 1.vertext 顶点,保存于数组中,有3-4个数字为一个点。2.texture 材质,用于渲染到顶点描述的表面。3.shaders 着色器,将片段和顶点程序进行组合成一个着色器。 阅读全文
posted @ 2012-02-21 20:40 luozhifu 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Region.Op有INTERSECT、DIFFERENCE、REPLACE、REVERSE_DIFFERENCE、UNION、XOR七种选择文档没有详细说明,所以查了点资料并简单的测试了下,权当记忆之用先看我的测试View的代码@Overrideprotected void onDraw(Canvas canvas) {Path path1 = new Path();path1.addRect(200, 200, 400, 400, Direction.CW);canvas.clipPath(path1);canvas.drawBitmap(red,0, 0, null);Path path 阅读全文
posted @ 2012-02-09 22:19 luozhifu 阅读(736) 评论(0) 推荐(0) 编辑
摘要: android切割画布的历程不算很难,可是理解起来也比较麻烦,这里写一下我的理解 但是不一定正确: canvas.clipRect(30, 30, 70, 70, Region.Op.XOR);最后一个参数有多个选择分别是://DIFFERENCE是第一次不同于第二次的部分显示出来 //REPLACE是显示第二次的 //REVERSE_DIFFERENCE 是第二次不同于第一次的部分显示 //INTERSECT交集显示 //UNION全部显示 //XOR补集 就是全集的减去交集生育部分显示 import android.content.Context; import android.... 阅读全文
posted @ 2012-02-09 16:54 luozhifu 阅读(1723) 评论(0) 推荐(0) 编辑