Forked from: oreore's forked from: [PV3D] Simple Sphere diff:12 forked from: forked from: [PV3D] Simple Sphere 必要なライブラリをインポートします travis forked:1favorite:1lines:47license : MIT License modified : 2009-08-02 19:18:42 Embed Tweet // forked from toni's forked from: [PV3D] Simple Sphere // forked from clockmaker's [PV3D] Simple Sphere package { import flash.events.Event; // 必要なライブラリをインポートします import org.papervision3d.materials.ColorMaterial; import org.papervision3d.materials.special.CompositeMaterial; import org.papervision3d.lights.PointLight3D; import org.papervision3d.materials.shadematerials.FlatShadeMaterial; import org.papervision3d.materials.WireframeMaterial; import org.papervision3d.objects.primitives.Plane; import org.papervision3d.objects.primitives.Sphere; import org.papervision3d.view.BasicView; import org.papervision3d.core.effects.view.ReflectionView; public class Main extends ReflectionView { private var ball:Sphere; private var cy:int=5; public function Main() { init(); } private function init():void { //カメラ位置//////////////////////////////////////////////// //床の作成////////////////////////////////////////////////// var wm:WireframeMaterial = new WireframeMaterial(); var col:ColorMaterial = new ColorMaterial(0xffffff, 0.5); var co:CompositeMaterial = new CompositeMaterial(); co.addMaterial(wm); co.addMaterial(col); var floor:Plane = new Plane(co, 1000, 1000, 1, 6); floor.pitch( -90); //床を3Dシーンに表示///////////////////////////////////////// scene.addChild(floor); // 球面を作成/////////////////////////////////////////////// var material: CompositeMaterial = new CompositeMaterial(); material.addMaterial(new WireframeMaterial(0xff6633)); material.addMaterial(new ColorMaterial(0xdcdcdc)); ball = new Sphere(material, 100, 8, 8); ball.y = 100; // 球面を3Dシーンに表示////////////////////////////////////// scene.addChild(ball); addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onEnterFrame(e:Event):void { ball.rotationY +=30; singleRender(); camera.y +=cy; if (camera.y<1 || camera.y>(900)) cy=-cy; } } } Code Fullscreen Preview Fullscreen assen_nissen.. material rotationY Math.floor Event.ENTER_FRAME Event int sort new page view favorite forked pv131 forked from: forked from: fork.. travis forked:0 favorite:0lines:47 (diff:3)