PV3d特技--飞动的文字
来源:互联网 发布:win7端口telnet不通 编辑:程序博客网 时间:2024/05/01 22:09
demo: http://13106.99rr.net/swf/asbiancheng.swf
codes :
package
{
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import org.papervision3d.objects.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.view.*;
import org.papervision3d.cameras.*;
import org.papervision3d.materials.special.Letter3DMaterial;
import org.papervision3d.typography.fonts.HelveticaBold;
import org.papervision3d.typography.Text3D;
import caurina.transitions.properties.CurveModifiers;
import caurina.transitions.Tweener;
[SWF(width = "465", height = "465", frameRate = "60", backgroundColor = "0")]
public class Main extends BasicView
{
public function Main():void
{
CurveModifiers.init()
stage.quality = StageQuality.MEDIUM;
motion();
btn.buttonMode=true;
btn.addEventListener(MouseEvent.CLICK, motion,false,1,true);
startRendering();
}
private function motion(e:Event = null):void
{
// create letter
var text:TextField = new TextField();
if(Math.random()<0.5){
text.htmlText = "<font face='Verdana' size='16'>AS编程笔记</font>";
}
else{
text.htmlText = "<font face='Verdana' size='14'>931803632</font>";
}
text.autoSize = "left";
var cap:BitmapData = new BitmapData(text.textWidth, text.textHeight, true, 0xFFFFFFFF);
cap.draw(text);
//addChild(new Bitmap(cap))
var wrap:DisplayObject3D = scene.addChild(new DisplayObject3D());
// particle motion
var cnt:int = 0;
for (var i:int = 0; i < text.textWidth; i++ )
{
for (var j:int = 0; j < text.textHeight; j++ )
{
if (cap.getPixel(i, j) == 0xFFFFFF) continue;
// A-Z
var char:String = String.fromCharCode(65 + 25 * Math.random() | 0);
// letter
var lettermat:Letter3DMaterial = new Letter3DMaterial();
lettermat.fillColor = 0xFFFFFF * Math.random();
var word:Text3D = new Text3D(char , new HelveticaBold() , lettermat);
word.x = 1000 * Math.random() - 500 - 500;
word.y = 1000 * Math.random() - 500;
word.z = -5000;
word.scale = 1;
word.rotationZ = 720 * Math.random();
wrap.addChild(word);
//增加Tween
Tweener.addTween(word,
{
x : (i - text.textWidth / 2) * 30,
y : (text.textHeight / 2 - j) * 30,
z : 0,
scale : 0.5,
rotationZ: 0,
_bezier : [{x : 1000, y : 0}],
time : 3,
transition : "easeInOutExpo",
delay : cnt++ * 0.0175
});
}
}
// wrap motion
wrap.z = 4000;
Tweener.addTween(wrap,
{
z : -1000,
time : 10,
transition : "easeInExpo",
onComplete : function():void
{
scene.removeChild(wrap);
}
});
// camera motion
camera.x = -200
Tweener.addTween(camera,
{
x : 200,
time : 10,
transition : "easeInExpo"
});
}
}
}
- PV3d特技--飞动的文字
- PV3d特技--文字的爆破与合成
- 底部状态栏上飞动的文字
- Javascript 飞动的广告
- pv3d 的VideoStreamMaterial练习
- pv3d 的 Camera3D练习
- pv3d 的 Quaternion练习
- 2 PV3D的坐标
- 想做个会飞动的椭圆 但是不见效果
- pv3d 的矩阵 -- Matrix3D演示
- pv3d 的 切换贴图 练习
- 高并发的限流特技
- scala语言的一些特技
- 可以做刷新效果的两个图片飞动
- pv3d 做的3d game
- 关注Flash3D的开源项目-pv3d
- 【PV3D】分割COLLADA模型的动画数据
- PV3D的小练习~太阳系八大行星
- aspnet_merge.exe”已退出,代码为1的错误的解决方法
- 2012年必备的逃生指南(仅供娱乐)
- Windows 用户帐户控制循序
- 程序员的七建议
- Baidu与Google也许还真是差那6个像素
- PV3d特技--飞动的文字
- C/C++字符串另类匹配以及分数化简
- 阵汉字显示
- Windows 不能在 本地计算机 启动 SQL Server (MSSQLSERVER)。有关更多信息,查阅系统事件日志。如果这是非 Microsoft 服务,请与服务厂商联系,并参考特定服务错误代码 3417。
- Windows无法访问指定设备路径或文件,您可能没有合适的权限访问这个项目
- NET2.0 验证控件常用的正则表达式
- 用txt实现一个简单的管理功能
- 重复提交、重复刷新、防止后退的问题以及处理方法
- 人生就是这样