Bumpmap using EnvMapMaterial
OooOOoOOhh pretty.
package { import flash.display.Bitmap; import flash.filters.BlurFilter; import flash.geom.Point; import gs.TweenMax; import gs.easing.Quad; import org.papervision3d.lights.PointLight3D; import org.papervision3d.materials.BitmapMaterial; import org.papervision3d.materials.shaders.EnvMapShader; import org.papervision3d.materials.shaders.ShadedMaterial; import org.papervision3d.objects.primitives.Sphere; import org.papervision3d.view.BasicView; [SWF(width="640", height="480", backgroundColor="#000000", frameRate="60")] public class BumpMapDemo extends BasicView { [Embed(source="assets/3138-bump.jpg")] private var envAsset:Class; [Embed(source="assets/3138.jpg")] private var bumpMapAsset:Class; public function BumpMapDemo() { var headerText:headerContainer = new headerContainer(); headerText.header.text = "Bumpmap Demo: Textures from FilterForge"; addChild(headerText); var light:PointLight3D = new PointLight3D(); light.z = -500; var envBitmap:Bitmap = new envAsset(); var bumpMapBitmap:Bitmap = new bumpMapAsset(); //smooth it out bumpMapBitmap.bitmapData.applyFilter(bumpMapBitmap.bitmapData, bumpMapBitmap.bitmapData.rect, new Point(0,0), new BlurFilter(3,3,3)); var bitmapMaterial:BitmapMaterial = new BitmapMaterial(bumpMapBitmap.bitmapData); var envMapShader:EnvMapShader = new EnvMapShader(light, envBitmap.bitmapData, envBitmap.bitmapData, 0, bumpMapBitmap.bitmapData); var material:ShadedMaterial = new ShadedMaterial(bitmapMaterial, envMapShader); //a nice round sphere var sphere:Sphere = new Sphere(material, 500, 18, 18); scene.addChild(sphere); startRendering(); TweenMax.to(sphere, 10, {localRotationY:360, localRotationX:180, yoyo:true, ease:Quad.easeInOut}); } } }
-
joomla developers
-
Affordable cheap web hosting
-
Domain registration
-
Ps0ram
-
Gabriel.Wang(From China)
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


