您的位置:首页 > 其它

Papervision3D 2.0 Released - Great White

2007-12-06 21:16 351 查看
导读:
    Categories: Flash, 3D, Papervision3D.
  Well, if you're into 3D and haven't heard the buzz about Papervision3D 2.0, you've probably been under a rock or working for an agency on a 6 week deadline in a room with blacked out windows. We've all waited for this release with much anticipation and it's been a long wait, but that wait is FINALLY over!

 如果你对3d有所了解而且也听说过PV3D,那你也许在一个公司上班,一周6天。窗外一片空白。我们等待PV3D第二个版本的RELEASE已经很久了,虽然过程很漫长,但到底还是来了。
  Ralph and Tim have been cracking away at 2.0 and putting in amazing amounts of hours to do so - these guys haven't slept much, so give em' a break if you find bugs with the alpha release. This is the first alpha release PV3D has had and we're hoping the community rallies around it and helps to test and improve the code base. RALPHA和TIM在2.0上了很长的时间。这些人没充足的睡眠,所以当你们发现ALPHA版本有BUG的时候,别介意。让他们休息会儿。
  What's new? Glad you asked. 有什么新鲜的呢?很高兴你这样问
  Shaders,shaded materials 阴影,阴影材料
  phong, flat, cell, gouraud shading
  bumpmaping
  Viewport3D 视角的3维华
  BasicRenderEngine 基本的渲染引擎
  Adoption of ASCollada with DAE object
  MD2 support
  Frustrum Camera
  re-write of render loop - now there's render lists centeralized in the RenderEngine
  refactored and greatly improved InteractiveSceneManager(ISM) - much faster
  upgrading current projects: 当前项目的升级
  If you're going to try 2.0 with your latest project, you need to be aware of a couple of things: 如果你想在你的项目中尝试2.0那么你要注意以下一些事项。
  1. Setting up the initial scene is different - in a good way You no longer create a sprite container to pass to Scene3D, nor do you pass a boolean value for interactivity to Scene3D. Viewport3D extends Sprite, and includes the ability to do: 设置场景的时候有不同,你不再需要创建一个SPRITE容器来传递给Scene3D也不许哟传递一个布尔值。Viewport3D 扩展了SPRITE并且包含了以下的功能。
  auto resizing/centering 自动调整大小/居中
  interactivity 互动性
  autoClipping
  autoCulling
  Actionscript: 例子
  varviewport:Viewport3D = newViewport3D(0, 0, true, false)
  addChild(viewport)
  
  varrenderer:BasicRenderEngine = newBasicRenderEngine()
  
  varscene:Scene3D = newScene3D()
  varcamera:FreeCamera3D = newFreeCamera3D()
  Then, when you want to render:
  Actionscript:
  renderer.renderScene(scene, camera, viewport)
  The new Viewport3D really opens up the doors to do cool things like BitmapViewportMaterial - think of using a camera's view as a material 新的Viewport3D 类真的打开通往那些最酷的世界的门,例如BitmapViewportMaterial ,想象下将摄像机的视角作为材料
  


  
  Actionscript:
  publicfunctionViewport3D(viewportWidth:Number= 640, viewportHeight:Number= 480, autoScaleToStage:Boolean= false, interactive:Boolean= false, autoClipping:Boolean= true, autoCulling:Boolean= true)
  2. The engine's been refactored a bit and so you'll have to go through and update your imports. Most notably, Objects have moved. 引擎被重构了,因此你要重新注意你的导入包。最重要的OBJECTS被去除了
  3. No more precision materials. Now all materials have a "precise" boolean. Just set it to true if you need precision. 不再需要精度材质了,现在所有的材质有一个精度布尔值。如果需要的话,你可以自己设置
  Actionscript:
  metalicBoxMaterial = newBitmapMaterial(boxTextureBitmap.bitmapData)
  metalicBoxMaterial.precise= true
  Using shaders
  Actionscript:
  // create your light
  varpointLight:PointLight3D = newPointLight3D()
  pointLight.moveUp(350)
  pointLight.moveRight(350)
  
  // create your materials
  varearthMaterial:MovieAssetMaterial = newMovieAssetMaterial("earthMap")
  varearthBumpMaterial:MovieAssetMaterial = newMovieAssetMaterial("earthMapBump2")
  // create shader
  varearthShader:PhongShader = newPhongShader(pointLight, 0xFFFFFF,0x303030,20, earthBumpMaterial.bitmap, earthMaterial.bitmap)
  // combine shader with original material, for a shaded material
  varearthShadedMaterial:ShadedMaterial = newShadedMaterial(earthMaterial, earthShader)
  // add to sphere
  varearth:Sphere = newSphere(earthShadedMaterial, 250, 12, 12)
  
  scene.addChild(earth)
  I hope this helps the learning curve for 2.0! I'll try and get the benchmark for 2.0 out there, but initially, an older revision of it was 23% faster than 1.9 Phunky! 希望这篇文章对大家学习PV3D有帮助
  
本文转自
http://www.rockonflash.com/blog/?p=92
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: