顯示具有 away3d 標籤的文章。 顯示所有文章
顯示具有 away3d 標籤的文章。 顯示所有文章

2012年10月18日 星期四

How to play Away3D on mobile phone

Last week I played Away3D on my old iphone 3GS for fun(see my previous post).
Now, you can download the full source from here,
or get ipa and apk file to test on your mobile.

Here is the web demo.



2012年10月8日 星期一

Away3D + Flint 3D Particles Demo: Cloud Effect

Away3D + Flint 3D Particles Demo: Cloud(Fog) Effect

版本:
Away3D v4.0.9
Flint v4.0.1

先來看 demo 圖

重點如下:
建立: view = new View3D();
設定背景: view.backgroundColor = 0x222233;
設定 antiAlias(ie: 2,4,16): view.antiAlias = 4; 

2012年10月5日 星期五

Away3D 4.0.X Gold basics

Away3D 4.0.X Gold 基本教學

之前有寫過幾篇 Away3D 的教學與應用,
新版 4.0.X 後 API 有些許的調整,重新翻了一下文件。

Away3D 基本流程如下:

  • scene
  • camera
  • view
  • light
  • add 3D Object(3D Object -> Mesh -> 面 ->頂點)
  • render

2011年10月7日 星期五

away3d how to move 3D object along a path - part2

preFab 還提供兩種工具 Path Extruder and Path Animator
Path Extruder 可以在 Path 上貼上材質(ie:草皮/柏油/水泥...etc.)
可以用 Geometry -> Path -> Path Extruder
首先點出你要的物件

setting:
select path
subdivision -> 4
closepath
allgntopath
coversegment
mapfit
選材質
build

Path Animator 可以用來預覽效果
Geometry -> Path Animator

seletc path
use camera
offset y:100
allgn to path
preview(camera 沿著 path 移動)

use Object3d
object(your car)
offset y:100
allgn to path
preview(3d object 沿著 path 移動)

away3d how to move 3D object along a path - part1

away3d how to move 3D object along a path
away3d 裡有支援 path animator,可以沿著路徑移動 3D 物件,
以往必需先自己建立路徑,再丟給 PathAnimator 處理

pseudocode:
var aPath:Array = [
new Vector3D(-1000, -1000, -2000),
new Vector3D(-1000, 0, 0),
new Vector3D(1000, 0, 0),
new Vector3D(1000, 1000, -2000),
];
var p:Path = new Path(aPath);
pa = new PathAnimator(path, arrow, o);

簡單的路徑可以自己建立,但是複雜的路徑
這樣搞大概永遠都下不了班,
為了讓大家能夠準時下班,這裡介紹一個好用的工具

2011年10月4日 星期二

away3d load obj/md2/3ds/mqo model

away3d load obj/md2/3ds/mqo model
away3d 可以載入多種 3D 格式,
有興趣可以去翻翻 away3d.loaders。

load obj
loader = Obj.load("resource/Static.obj")

load 3ds
loader = Max3DS.load("resource/monster.3DS", { scaling:5.0 });

load mqo
loader = Metasequoia.load("resource/mion/mion.mqo");

load md2(following md2 texture path)
loader = Md2.load("resource/ogre.md2", { scaling:0.05 } );

objcontainer = new ObjectContainer3D(loader);
scene.addChild(objcontainer);

away3d cube/skybox material

away3d cube/skybox material

cube 六個面貼上相同的材質
cube = new Cube( { material:"blue#white", x: -100, width:50, height:50, depth:50 } );
或者是
cube = new Cube();
cube.material = material;
cube.width = 200;
cube.height = 200;
cube.depth = 200;

cube 六個面貼上不同的材質
cube = new Cube();
cubeMaterial = new CubeMaterialsData();
cubeMaterial.front = new ColorMaterial("random");
cubeMaterial.back = material2;
cubeMaterial.bottom = new ColorMaterial("random");
cubeMaterial.top = new ColorMaterial("random");
cubeMaterial.left = material1;
cubeMaterial.right = new ColorMaterial("random");
cube.cubeMaterials = cubeMaterial;

away3d camera note

away3d camera note
camera 相關原理可以先參考這兩篇
http://www.flashmagazine.com/Tutorials/detail/away3d_basics_the_cameras/
http://blog.tartiflop.com/2008/08/understanding-zoom-focus-and-field-of-view-in-papervision3d/
away3d 有四種 camera,分別是
camera3D:default camera
TargetCamera3D:automatically look at a specified target object
SpringCam:1st and 3rd person camera
HoverCamera3D:hover round a specified target object

本文介紹(最常用) HoverCamera3D,
利用改變 camera.panAngle 及 camera.tileAngle
來產生旋轉及放大縮小的 3D 效果。

away3d video material demo

很久沒碰 away3d,最近因為專案需要,重新看了一下,
這才發現 away3d 做了不少更動,
本篇是以 away3d 3.6 進行 demo
以 videoMaterial 當材質
建立一個可轉動的 cube。