Road&Load_Web

2011-05-24

[] ENTER_FRAME mouse位置 15:55

import caurina.transitions.Tweener;

import caurina.transitions.properties.CurveModifiers;

CurveModifiers.init();

// フレームアクションでPapervision3D

import org.papervision3d.cameras.Camera3D;

import org.papervision3d.events.*;

import org.papervision3d.events.InteractiveScene3DEvent;

import org.papervision3d.objects.DisplayObject3D;

import org.papervision3d.objects.primitives.*;

import org.papervision3d.materials.WireframeMaterial;

import org.papervision3d.materials.utils.MaterialsList;

import org.papervision3d.view.BasicView;

import org.papervision3d.view.*

import org.papervision3d.materials.*

// 3D表示用のインスタンスを作ります

var world:BasicView = new BasicView();

addChild(world);

world.startRendering();

// テクスチャー(=マテリアル)を作ります

//var material:BitmapAssetMaterial = new BitmapAssetMaterial('EarthMap')

var top_bfm:BitmapFileMaterial = new BitmapFileMaterial("01.jpg");

var left_bfm:BitmapFileMaterial = new BitmapFileMaterial("02.jpg");

var right_bfm:BitmapFileMaterial = new BitmapFileMaterial("03.jpg");

var bottom_bfm:BitmapFileMaterial = new BitmapFileMaterial("04.jpg");

var front_bfm:BitmapFileMaterial = new BitmapFileMaterial("01.jpg");

var back_bfm:BitmapFileMaterial = new BitmapFileMaterial("01.jpg");


var sphere:Cube = new Cube(new MaterialsList({top:top_bfm , left:left_bfm , right:right_bfm , bottom:bottom_bfm , front:front_bfm , back:back_bfm}) , 300 , 300 , 300);

world.scene.addChild(sphere);


var sphere2:Cube = new Cube(new MaterialsList({top:top_bfm , left:left_bfm , right:right_bfm , bottom:bottom_bfm , front:front_bfm , back:back_bfm}) , 300 , 300 , 300);

world.scene.addChild(sphere2);

sphere2.x = 200;

sphere2.y = 300;

addEventListener(Event.ENTER_FRAME, function(e){

var xx = ((mouseX / 500) * 180 - 90);

var yy = ((mouseY / 500) * 180 - 90);

Tweener.addTween(world.camera,{x:xx,y:yy,time:0.8});

});

トラックバック - http://d.hatena.ne.jp/jaming6614/20110524/1306220107