Panorama

From Flare3D Wiki
Jump to: navigation, search

This example shows how to make a simple 360º panoramic view. Click with the mouse to rotate the camera around. This was initially implemented by Emanuele Feronato for Flare3D 1.0, you can see the original post here: [1]. Picture originally taken from here: [2]

Usage Example

package  
{
	import flare.basic.*;
	import flare.core.*;
	import flare.materials.*;
	import flare.materials.filters.*;
	import flare.primitives.*;
	import flash.display.*;
 
	/**
	 * ...
	 * @author Ivan Vodopiviz
	 */
 
	[SWF(frameRate = 60, width = 800, height = 450, backgroundColor = 0x000000)]
 
	public class PanoramaExample extends Sprite 
	{
		[Embed(source = "../bin/panorama6.jpg")] private var PanoramaImage:Class;
 
		private var _scene:Scene3D;
		private var _texture:Texture3D;
		private var _material:Shader3D;
		private var _sphere:Sphere;
 
		public function PanoramaExample() 
		{
			_scene = new Viewer3D( this );
			_scene.antialias = 2;
 
			_texture = new Texture3D( new PanoramaImage );
			_texture.mipMode = Texture3D.MIP_NONE;
			_material = new Shader3D( "panoramaMaterial", [new TextureFilter( _texture ) ] );
			_material.twoSided = true;
			_material.enableLights = false;
			_sphere = new Sphere( "panoramaSphere", 50, 60, _material );
 
			_scene.addChild( _sphere );
		}
	}
}
blog comments powered by Disqus