Papervision 3D Tutorials ReflectionView

Hello everybody had to miss the time, but here you are a new tutorial! Have you ever wondered how to make a reflection effect with 3d Papervison similar to the now famous iTunes Cover Flow? Nothing is easier! Here we are in fact help the Class ReflectionView pv3d native package.
Meanwhile, beware of the demo:
Demo
1) a template Pv3d
Before starting the tutorial make sure you have read and downloaded the first post in the series. If you already have familiarity Conti library Papervision 3d and you can instantiate an object you can proceed without problems.
Papervision 3d start-up your template first tutorial
2) Import
First we import the class needed to create the reflection.
import org.papervision3d.core.effects.view.ReflectionView; 3) Extends
We extend our function manufacturer so that it inherits the properties of the class ReflectionView:
public class ReflectionClassPv3dTut extends ReflectionView Four) SurfaceHeight
We define the level of reflection:
surfaceHeight = Number; 5) My Class
// DavidSalvatori.com // First Pv3d Reflections Class Tutorial // Papervision3D_rev859 package { import flash.events.Event; import org.papervision3d.materials.MovieAssetMaterial; import org.papervision3d.objects.DisplayObject3D; import org.papervision3d.objects.primitives.Plane; import org.papervision3d.core.effects.view.ReflectionView; import org.papervision3d.cameras.Camera3D; public class ReflectionClassPv3dTut extends ReflectionView { private var plane:Plane; public function ReflectionClassPv3dTut () { super (1024,768,false,false); init (); camera.z = -400; surfaceHeight = -350; this.addEventListener (Event.ENTER_FRAME,enterFrame); } private function init ():void { var material_mc1:MovieAssetMaterial = new MovieAssetMaterial("mc_1", true); plane = new Plane(material_mc1, 250, 350, 4, 4); scene.addChild (plane); } private function enterFrame (e:Event):void { singleRender (); } } } Conclusion & downloads
That's it! As promised the class implementation is really simple. If you want to deepen the use do not miss the reference to the official documentation of Papervision3D . ReflectionView class using the course we are not facing a true reflective material, but a copy of our BasicView precisely reflected.





Comments
ranawaiana
July 14, 2009
hello, I was trying to use your tutorial to understand certain dynamics of 3D
depending on what you have calculated that the camera was -400 az?
using a cubic-h 134 I'm crazy for understanding the optimal proportion to move the camera just enough so as not to overlap with the reflective surface mc home!
I'm going crazy, can not be empirically!
David
July 14, 2009
hello,
I do not understand exactly say ... I tried changing the z but I do not see the problem you describe ...
If you need to position your mc 134px h so that accurate?
laura
February 23, 2010
Hello David,
I'm trying to use this class but I will add a black background when I add a ReflectionView ... what's wrong??
Laura
David
February 23, 2010
Hello Laura,
where you will add the black background? the entire viewport or the reflection of the object that reflect? If you have for transparencies?!