Mathieu Badimon | FIVe3D
http://five3d.mathieu-badimon.com/
平面のオブジェクトを3Dで扱う為のライブラリ
ここの中の人がつくったみたい
LAB | Mathieu Badimon
http://lab.mathieu-badimon.com/
ActionScript2.0なんだけど3.0っぽいクラス名で構成されてる。 five3D.utils.Drawing で描画したオブジェクトを動かす感じで、テキストも半角英数なら3Dで動かせる。どうやらテキストはクラスに座標を定義してあって、lineToとかで描画してるみたい。HelveticaMedium.as とかフォントのクラスがあった。
適当にサンプルつくってみた
http://labs.un-q.net/flash/five3d/test01/
import five3D.display.DynamicText;
import five3D.display.Scene;
import five3D.display.Sprite;
import five3D.utils.Drawing;
var scene:Scene = new Scene(this);
var root:Sprite = scene.getRoot();
var text:DynamicText = root.createDynamicText("text", 1);
text._typography = five3D.typography.HelveticaBold;
text._size = 40;
text._color = 0xffffff;
text._text = "Unknown Quality";
text._x = 120;
text._y = 50;
text.onEnterFrame = function() {
this._rotationx += 10;
}
var rect:Sprite = root.createSprite("rect", 0);
Drawing.rectangle(rect,300,100,0xFFFFFF);
rect._x = 120;
rect._y = 200;
rect.onEnterFrame = function () {
this._rotationx -= 10;
}
回転の中心がうまく決められない。 サンプル見たら、コンテナみたいなのにのせて動かしてたから真似てみた。
http://labs.un-q.net/flash/five3d/test02/
import five3D.display.DynamicText;
import five3D.display.Scene;
import five3D.display.Sprite;
import five3D.utils.Drawing;
var scene:Scene = new Scene(this);
var root:Sprite = scene.getRoot();
root._x = 280;
root._y = 200;
var container:Sprite = root.createSprite("container", 0);
Drawing.rectanglePlace(container, -180, -150, 360, 300, 0xffffff);
var text:DynamicText = container.createDynamicText("text", 1);
text._typography = five3D.typography.HelveticaBold;
text._size = 40;
text._color = 0x999999;
text._text = "Unknown Quality";
text._y -= 20;
text._x -= 160;
text._z -= 20;
var text2:DynamicText = container.createDynamicText("text2", 0);
text2._typography = five3D.typography.HelveticaBold;
text2._size = 40;
text2._color = 0x000000;
text2._text = "Unknown Quality";
text2._y -= 20;
text2._x -= 160;
text2._z -= 10;
container.onEnterFrame = function() {
this._rotationy++;
//this._rotationx++;
//this._rotationz++;
}
裏側が見えてしまってるのは仕様かな?




コメント (2)
FIVe3D、ソースちら見してみましたが、z-sorting してないので、
表示順序は root に追加したオブジェクト順になってしまいますね…。
投稿者: secondlife | 2007年08月14日 12:21
日時: 2007年08月14日 12:21
> secondlife さん
あーなるほど。
その辺はわりきってある感じなのかな。
投稿者: ll_koba_ll | 2007年08月15日 09:29
日時: 2007年08月15日 09:29