TriangleMesh3D – Create your own mesh
This shows you how to make little baby triangles. If you put enough of these together with the proper coordinates and rotations, you could make a Tyrannosaurs Rex!
package { import flash.events.Event; import org.papervision3d.core.geom.TriangleMesh3D; import org.papervision3d.core.geom.renderables.Triangle3D; import org.papervision3d.core.geom.renderables.Vertex3D; import org.papervision3d.materials.ColorMaterial; import org.papervision3d.view.BasicView; [SWF(width="640", height="480", backgroundColor="#000000", frameRate="60")] public class TriangleMesh3DExample extends BasicView { private var triangleMesh3d:TriangleMesh3D; public function TriangleMesh3DExample() { var material:ColorMaterial = new ColorMaterial(0xcc0000); material.doubleSided = true; //all the 200's are points of a triangle var vertex3D_1:Vertex3D = new Vertex3D(-200, -200, 0); var vertex3D_2:Vertex3D = new Vertex3D(200, -200, 0); var vertex3D_3:Vertex3D = new Vertex3D(-200, 200, 0); var triangleVertices:Array = [vertex3D_1, vertex3D_2, vertex3D_3]; //use null because we haven't created its parent mesh yet var triangle3d:Triangle3D = new Triangle3D(null, triangleVertices, material); var triangleFaces:Array = [triangle3d]; triangleMesh3d = new TriangleMesh3D(material, triangleVertices, triangleFaces, null); //for the triangle to be "renderable", it needs to know who its daddy is //this is the same property as the "null" parameter a few lines above triangle3d.instance = triangleMesh3d; scene.addChild(triangleMesh3d); startRendering(); } override protected function onRenderTick(event:Event=null):void { triangleMesh3d.rotationY = -viewport.containerSprite.mouseX / 2; super.onRenderTick(event); } } }
-
1010013548
-
周杰
-
king
-
Alex
-
Tomas
-
Kyle
-
John Lindquist
-
trix
-
JB
-
Soenke
Search
Recommended Books
Speaking at FITC Toronto
Recent Posts
- Moving to johnlindquist.com
- AsyncCommand with Robotlegs, Signals, Flight, MinimalComps
- Search Widget – Robotlegs, Signals, Flight, Minimal Comps, Yahoo Astra
- FDT Super Awesome March Deal
- haXe Tutorial
- AS3 Signals Tutorial
- Preferred Video Tutorial Resolution?
- TweenMax – Tweening a timeline (Advanced Tweening)
- Robotlegs + Flight + Union Platform
- Back in the saddle
- Eclipse Theme Designer Preview
- RobotLegs Hello World Video Tutorial
- 10 Things Every Senior Flash Developer Should Know
- Efflex – 3D Effects for Flex
- MorphController – Mighty Morphing Papervision3D
Recent Comments
- list of lpn courses on SpringCamera3D and Driving a Car
- rn to bsn in montgomery al on archive
- PowerPoint Recovery on Eclipse Theme Designer Preview
- cheat mw3 on Test if a plane is within the view of the camera (aka testing if culled)
- Goa Hotels on Looking around the inside of a Sphere
- cheat gratuit on Looking around the inside of a Sphere
- Application Development on Robotlegs + Flight + Union Platform
- nexium on Moving Faces
- buy nexium on Holy Sphere
- buy aldara online on Tweening a “moveForward()” behavior
Categories
Archives
Preferred Video Tutorial Resolution
- 1024x768 (53%, 85 Votes)
- 1280x1024 (15%, 24 Votes)
- 1920x1080 (15%, 24 Votes)
- 800x600 (13%, 20 Votes)
- 480x320 (4%, 6 Votes)
- 640x480 (0%, 2 Votes)
Total Voters: 160


