Molehill 3d APIs – Show on MAX 2010 Develop

Molehill” is the code name for a new set of low-level, GPU-accelerated 3D APIs that will enable advanced 3D experiences across screens through the Adobe® Flash® Platform runtimes. These new low-level APIs will provide advanced 3D and 3D engine developers the flexibility to leverage GPU hardware acceleration for significant performance gains. Today, Adobe Flash Player 10.1, renders thousands of non z-buffered triangles at approximately 30 Hz. With the new 3D APIs, developers can expect hundreds of thousands of z-buffered triangles to be rendered at HD resolution in full screen at around 60 Hz. Using the new 3D APIs in Flash Player and AIR will make it possible to deliver sophisticated 3D experiences across almost every computer and device connected to the Internet.

The 3D capabilities enabled by the new APIs will also be available to the broader developer community through popular ActionScript® 3D frameworks, such as Alternativa3D, Away3d, Flare3D, Sophie3D or Yogurt3D.

PV3D初探 – 球形全景

昨晚开始研究PV3D,选了一个常用的的球形全景做测试,对Viewport, Camera的使用有了些了解。全景图片比较大,载入可能比较慢,请耐心等待。(全景图是网上找的,出处不详,如有版权问题请提醒我)

代码:

package
{
	import flash.events.Event;
	import org.papervision3d.cameras.CameraType;
	import org.papervision3d.materials.BitmapFileMaterial;
	import org.papervision3d.objects.primitives.Sphere;
	import org.papervision3d.view.BasicView;

	/**
	 * 全景测试
	 * @author Xuanfei Liu
	 */
	public class Panorama extends BasicView
	{
		private var sphere:Sphere;
		private var material:BitmapFileMaterial;

		public function Panorama()
		{
			super(600, 400, true, false, CameraType.FREE);
			camera.z = 0;
			camera.focus = 400;
			camera.zoom = 1;
			material = new BitmapFileMaterial("assets/sphere.jpg");
			material.opposite = true;//这行很关键,要把材质贴在球体内部
			material.smooth = true;
			sphere = new Sphere(material, 400, 40, 40);
			scene.addChild(sphere);
			startRendering();
		}

		override protected function onRenderTick(e:Event = null):void
		{
			camera.rotationY += (mouseX - stage.stageWidth/2) * 0.01;
            camera.rotationX += (200 * mouseY / stage.stageHeight - 100 - camera.rotationX) * 0.1;
			super.onRenderTick(e);
		}
	}
}

有时间我再试试Cube全景,有人能提供立方体全景图吗?

Flash RIA的可用性 —— 在Flash Camp 2010上的演讲

周六的Flash Camp 2010活动圆满结束,见到了赶来捧场的云开大哥和做了精彩演讲导致我肚子很饿的接口帝小S弟,很开心。唯一的遗憾是Adobe的平台技术总监Gray Zhu由于航班的原因没有到现场。

我在活动上的演讲题目是“Flash RIA的可用性”,这个话题很大,我这次主要是从Flash开发者的角度讲了一些可用性相关的点,希望由点及面引起开发者对可用性问题的思考,所以演讲的内容偏向常识方面,包括:

  • Flash的浏览器兼容性
  • Flash RIA 如何符合用户的网页浏览习惯
  • 如何利用全屏模式
  • 如何适应不同的屏幕分辨率
  • 如何创建全球化应用

Slideshare的转码有问题,建议把PPT下载下来看。

在这里查看演示,点右键有福利

2010年9月26日更新:
视频出来了…

2010年9月27日更新:
活动视频列表: http://v.ku6.com/playlist/index_3851258.html
活动回顾: http://www.wedoswf.com/posts/988

用swffit改变Flash控件的大小

swffit

为了适应不同的屏幕分辨率,我们通常把Flash控件的高度和宽度设置为100%,这样做的副作用就是如果Flash内容的大小超出屏幕的分辨率也不会出现滚动条。

swffit能解决上述问题,基于swfobject,swffit提供了相应的js和as的接口来实时的改变flash控件的大小。使用方法类似于swfaddress,页面中引用swffit.js,flash中可以按需引用as2或者as3版本的SWFFit.as,如果需要事件回调,还可以引入SWFFitEvent.as.

例子 | 下载

UIMovieClip动画在Flex中的位移问题

在界面效果复杂或者组件需要复杂的开场动画时,常常会在Flash中用时间轴或者Tween类制作动画,并发布为UIMovieClip组件,在Flex中引用。

由于Flex会自动计算UIMovieClip的大小,所以如果动画过程中Symbol有位移或者大小的变化,就会造成在Flex中显示的时候组件本身会发生连续位移。

第一反应是设置组件的explicitWidth和explicitHeight来固定大小,结果位移是没有了,但是动画过程中,原件会不断的缩放。

解决这个问题,我采用的方法是在Flash中加入一层透明的图形填充来标示实际的组件大小,这样Flex中组件的大小就固定了。

这个方法比较Dirty,如果你有更好的方法,欢迎留言!

Flash Debug Player引起Firefox 3.6.6崩溃的解决办法

最近把我的Firefox升级到最新的3.6.6以后,调试Flash的时候,只要有异常,弹出异常窗口以后,Firefox就不响应了,过一会会显示Flash插件崩溃的信息,只能通过任务管理器强行关闭Firefox。

反复多次之后,我求助了Google大神,原来这个问题还挺普遍的,具体可以看这里

按照帖子里说的,解决方案如下:

  1. Firefox地址栏输入about:config,打开高级设置,如果有警告直接忽略
  2. 在Filter里搜索dom.ipc.plugins
  3. 双击dom.ipc.plugins.enabled.npswf32.dll设为false
  4. 也可以把dom.ipc.plugins.timeoutSecs设为-1来禁用插件崩溃的timeout
  5. 重启Firefox,搞定!

AIR vs. Silvelight? 纽约时报:Adobe Win!

Silverlight和微软失去了一个非常重要的客户:纽约时报决定放弃从2006年开始在Times Reader中采用的Silverlight/WPF转而使用Adobe Air,目前Air版的Times Reader 2.0也已经发布。显然纽约时报不想再听到读者关于阅读器兼容性的抱怨,而且Silverlight有些情况下动态字体不清晰对于新闻出版业也是个不可原谅的Bug。Rob Larson写到:

This version is powered by Adobe AIR and will run equally well on Windows , Mac and Linux computers. With this latest release, Times Reader resembles the printed paper even more closely, and it updates every five minutes with the latest news from the Web.

附Flash和Silverlight的功能比较表,来自Flash vs. Silverlight: What Suits Your Needs Best?

Features Flash Silverlight
Animation better
File size better
Scripting better
Video/Audio better
Sound processing better
Accessibility better
Platform compatibility better
Text representation/SEO better
Supported image formats better
Socket programming better
Webcam support better
Deployment better
Windows application better
Media streaming better