2月 262010
 

FralToolKitの中の、SimpleCube.asを以下のように変更するだけで、画像ファイルを表示できました。
緑色の部分が変更点です。
1.import部分 は、「BitmapFileMaterial 」クラスを呼び出すために追加。
2. wmat には、画像ファイルを渡します。
この画像ファイルは、modelディレクトリの下に、sample.gifを置いた場合の設定です。
画像を、もう少し立った感じに見せたい場合は、以下の部分の値を、変更してみます。
_plane.rotationX = 180;
120くらいにするとだいぶ、立体的な感じに見えます。

package {
import flash.events.Event;
import flash.events.MouseEvent;
import org.papervision3d.lights.PointLight3D;
import org.papervision3d.materials.WireframeMaterial;
import org.papervision3d.materials.shadematerials.FlatShadeMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.primitives.Cube;
import org.papervision3d.objects.primitives.Plane;
import org.papervision3d.materials.*;
[SWF(width=640, height=480, backgroundColor=0x808080, frameRate=30)]
public class SimpleCube extends PV3DARApp {
private var _plane:Plane;
public function SimpleCube() {
// Initalize application with the path of camera calibration file and patter definition file.
// カメラ補正ファイルとパターン定義ファイルのファイル名を渡して初期化。
addEventListener(Event.INIT, _onInit);
init('Data/camera_para.dat', 'Data/flarlogo.pat');
}
private function _onInit(e:Event):void {
var wmat : BitmapFileMaterial = new BitmapFileMaterial( "model/sample.gif" );
_plane = new Plane(wmat, 80, 80); // 80mm x 80mm。
_plane.rotationX = 180;
_markerNode.addChild(_plane); // _markerNode に addChild するとマーカーに追従する。
}
}
}

よく読まれている記事

この記事を読んだ人は次の記事も読んでいます:

このエントリーをはてなブックマークに追加
はてなブックマーク - flarToolKitで画像を表示する
[`google_buzz` not found]
[`yahoo` not found]
[`livedoor` not found]
[`friendfeed` not found]
[`tweetmeme` not found]
[`grow` not found]
[`evernote` not found]

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)