博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Flash Player10 3D测试
阅读量:4079 次
发布时间:2019-05-25

本文共 1169 字,大约阅读时间需要 3 分钟。

在Adobe于5.15 发布Flash Player 10beta版以来一直想试试这个牛X的功能:3d支持

今天抽空玩了下3d旋转,性能上比之前pv3d,sandy,away3d等模拟出来的牛X很多

 

演示:(需要 ActiveX for IE / Plugin for Firefox ,否则看不到上面的效果)

package

{
import flash.display.Bitmap;
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;
import flash.display.StageAlign;
public class main extends Sprite
{
public function main()
{
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = "noScale";
//load a picture as display object
var ldr:Loader = new Loader();
ldr.load(new URLRequest("photo1.jpg"));
ldr.contentLoaderInfo.addEventListener("complete",onloaded);
addChild(ldr);
function onloaded(e:Event):void
{
//trace(e.target.content)
var bmp:Bitmap = Bitmap(e.target.loader.content);
//bmp.width /= 2
//bmp.height /= 2
bmp.x = -bmp.width/2;
bmp.y = -bmp.height/2;
stage.addEventListener(Event.ENTER_FRAME, rotateMovieClip);
}
function rotateMovieClip(e:Event):void
{
ldr.rotationX -= (stage.stageHeight/2-mouseY)/50;
ldr.rotationY += (stage.stageWidth/2-mouseX)/50;
//ldr.rotationZ += 5;
ldr.x = stage.stageWidth/2;
ldr.y = stage.stageHeight/2;
}
}
}
}

posted on 2010-05-12 11:23 阅读(...) 评论(...)

转载地址:http://lhpni.baihongyu.com/

你可能感兴趣的文章
linux环境下C语言中sleep的问题
查看>>
ubuntu 12.04 安装 GMA3650驱动
查看>>
新版本的linux如何生成xorg.conf
查看>>
xorg.conf的编写
查看>>
启用SELinux时遇到的问题
查看>>
virbr0 虚拟网卡卸载方法
查看>>
No devices detected. Fatal server error: no screens found
查看>>
新版本的linux如何生成xorg.conf
查看>>
virbr0 虚拟网卡卸载方法
查看>>
Centos 6.0_x86-64 终于成功安装官方显卡驱动
查看>>
Linux基础教程:CentOS卸载KDE桌面
查看>>
db sql montior
查看>>
read humor_campus
查看>>
IBM WebSphere Commerce Analyzer
查看>>
Unix + OS IBM Aix FTP / wu-ftp / proftp
查看>>
my read work
查看>>
db db2 base / instance database tablespace container
查看>>
hd disk / disk raid / disk io / iops / iostat / iowait / iotop / iometer
查看>>
project ASP.NET
查看>>
db db2_monitorTool IBM Rational Performace Tester
查看>>