728x90
회전하는 3d 큐브를 만들어
거기에 AOA의 설현 사진을 넣어 보겠습니다.ㅎ
package { import flash.display.MovieClip; import flash.events.Event; import org.papervision3d.objects.primitives.Cube; import org.papervision3d.view.BasicView; import org.papervision3d.materials.utils.MaterialsList; import org.papervision3d.materials.ColorMaterial; import org.papervision3d.materials.BitmapMaterial; import flash.display.BitmapData; import flash.display.Bitmap; import org.papervision3d.view.Viewport3D; public class main extends BasicView { private var viewport_:Viewport3D; private var cube : Cube; public function main() { init(); } private function init() { viewport_ = new Viewport3D(); viewport_.autoScaleToStage = true; viewport_.interactive = true; addChild(viewport_); var bitmap1:BitmapData = new img1() as BitmapData; var bitmap2:BitmapData = new img2() as BitmapData; var bitmap3:BitmapData = new img3() as BitmapData; var bitmap4:BitmapData = new img4() as BitmapData; var bitmap5:BitmapData = new img5() as BitmapData; //var bit:Bitmap = new img1() as Bitmap; var image1:BitmapMaterial = new BitmapMaterial(bitmap1); var image2:BitmapMaterial = new BitmapMaterial(bitmap2); var image3:BitmapMaterial = new BitmapMaterial(bitmap3); var image4:BitmapMaterial = new BitmapMaterial(bitmap4); var image5:BitmapMaterial = new BitmapMaterial(bitmap5); var material:MaterialsList = new MaterialsList(); image1.smooth = true; image2.smooth = true; image3.smooth = true; image4.smooth = true; image5.smooth = true; image1.interactive = true; image2.interactive = true; image3.interactive = true; image4.interactive = true; image5.interactive = true; image1.doubleSided = true; image2.doubleSided = true; image3.doubleSided = true; image4.doubleSided = true; image5.doubleSided = true; material.addMaterial(image1 , "front"); material.addMaterial(image2 , "back"); material.addMaterial(image3 , "left"); material.addMaterial(image4 , "right"); material.addMaterial(image1 , "top"); material.addMaterial(image2 , "bottom"); cube = new Cube(material,300,300,300,10,10,10); scene.addChild(cube); addEventListener(Event.ENTER_FRAME, render); } public function render(e:Event) { cube.yaw(-1); renderer.renderScene(scene, camera, viewport); } } }
반응형
'배워보자!! > papervision3D' 카테고리의 다른 글
[papervision3D] 페이퍼비전 3D 큐브만들기 ver2 (0) | 2015.04.24 |
---|---|
[papervision3d] 플래시3D 마우스에 반응하는 큐브 (0) | 2015.04.23 |
[papervision3D] 페이퍼비전 3D 큐브(cube) 만들기! (0) | 2015.04.15 |
[papervision3D] 페이퍼비전 3D Plane 만들기! (2) | 2015.04.15 |
댓글