pv3d测试
来源:互联网 发布:js页面倒计时代码 编辑:程序博客网 时间:2024/05/18 01:18
来自前面介绍的日本网址: http://wonderfl.net/search?q=pv3d
下面是其中之一: 源码: http://wonderfl.net/code/d9bc3d0d3b237cd9feca41335fe49c4624064034/download
demo : http://wonderfl.net/code/d9bc3d0d3b237cd9feca41335fe49c4624064034/fullscreen
codes :
- package
- {
- import flash.display.BitmapData;
- import flash.events.Event;
- import org.papervision3d.core.geom.TriangleMesh3D;
- import org.papervision3d.core.math.Number3D;
- import org.papervision3d.core.math.Plane3D;
- import org.papervision3d.core.utils.MeshUtil;
- import org.papervision3d.materials.BitmapColorMaterial;
- import org.papervision3d.materials.BitmapMaterial;
- import org.papervision3d.objects.primitives.Plane;
- import org.papervision3d.objects.primitives.Sphere;
- import org.papervision3d.view.BasicView;
- public class MeshCuttingExample extends BasicView
- {
- protected var planeMaterial:BitmapColorMaterial;
- protected var sphereMaterial:BitmapMaterial;
- protected var sourceSphere:Sphere;
- protected var hemiSphereA:TriangleMesh3D;
- protected var hemiSphereB:TriangleMesh3D;
- public function MeshCuttingExample()
- {
- super(0, 0, true, false);
- opaqueBackground = 0;
- setupScene();
- }
- protected function setupScene():void
- {
- //Setup a bitmapdata material for the spheres to use.
- var bmp:BitmapData = new BitmapData(512,255,false,0);
- bmp.perlinNoise(64,64,4,123456,true,false);
- //Create a new sphere, which we will use as a source geometry, cutting it.
- sphereMaterial = new BitmapMaterial(bmp);
- sphereMaterial.doubleSided = true;
- sourceSphere = new Sphere(sphereMaterial, 400, 15,15);
- //Setup a plane3d along which we will cut the sphere.
- var normal:Number3D = new Number3D(.5,.5,0); //Some angle
- var point:Number3D = new Number3D(0,80,0); //at position...
- var cutPlane:Plane3D = Plane3D.fromNormalAndPoint(normal, point);
- //Cut the sphere along the plane3D, returns an array of maximum 2 meshes.
- var meshes:Array = MeshUtil.cutTriangleMesh(sourceSphere, cutPlane);
- //Add result meshA
- hemiSphereA = meshes[0];
- hemiSphereA.x = 400;
- scene.addChild(hemiSphereA);
- //Add result meshB
- hemiSphereB = meshes[1];
- hemiSphereB.x = -400;
- scene.addChild(hemiSphereB);
- //Start rendering
- startRendering();
- }
- override protected function onRenderTick(event:Event=null):void
- {
- //Rotate the spheres.
- hemiSphereA.yaw(1);
- hemiSphereB.yaw(-1);
- super.onRenderTick(event);
- }
- }
- }
- pv3d测试
- pv3d视频教程
- PV3D手记
- pv3d视频教程
- pv3d笔记
- pv3d练习(motion plane)
- pv3d 与 dae交互
- pv3d 的VideoStreamMaterial练习
- pv3d 的 Camera3D练习
- pv3d 的 Quaternion练习
- people walk by pv3d
- pv3d 切换动作
- pv3d笔记本展示
- PV3D获得二维坐标
- PV3D Culling & Clipping
- pv3d源码分析
- pv3d入门及贴图
- 2 PV3D的坐标
- November, 23
- flex的“session”代替方案
- 博客
- Vector Markup Language (VML)
- 运行 Unix网络编程 中的第一个例子 unp学习 实例的运行
- pv3d测试
- Automatically Capturing a Dump When a Process Crashes
- 左连接示例
- linux修改字符集
- 更改配置文件: glib的函数实现key-data
- 关机和重启
- 索引的介绍
- 目的
- 程序语言之愚见