private function createScene():Group {
var g:Group = new Group();
var myXLineine3D = new Line3D( "x-coord", new Vector(-50, 0, 0), new Vector( 50, 0, 0 ));
var myYLineine3D = new Line3D( "y-coord", new Vector(0, -50, 0), new Vector( 0, 50, 0 ));
var myZLineine3D = new Line3D( "z-coord", new Vector(0, 0, -50), new Vector( 0, 0, 50 ));
var t***s:T***s = new T***s( "theT***s", 120, 20);
var materialAttr:MaterialAttributes = new MaterialAttributes(
new LineAttributes( 0.5, 0x2111BB, 0.4 ),
new LightAttributes( ***e, 0.1)
);
var material:Material = new ColorMaterial( 0xFFCC33, 1, materialAttr );
material.lightingEnable = ***e;
var app:Appearance = new Appearance( material );
// make texture, assuming class Texture extends BitmapData
var tex:BitmapData = new Texture (0, 0);
// set stage to no-scale mode
stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT;
// some standard Sandy stuff
var scene:Scene3D = new Scene3D ("myScene", this, new Camera3D (100, 100), new Group ("myRoot"));
var planelane3D = new Plane3D ("myPlane", tex.height, tex.width);
plane.appearance = new Appearance (new BitmapMaterial (tex));
// add plane to scene and render it to fill its view matrix
scene.root.addChild (plane); scene.render ();
// finally, make resize handler
function onResize (e:Event):void
{
// get new stage dimensions
var w:Number = stage.stageWidth;
var h:Number = stage.stageHeight;
// update the viewport
scene.camera.viewport.width = w;
scene.camera.viewport.height = h;
// get plane distance to camera
var d:Number = plane.getPosition ("camera").getNorm ();
// focus camera on wz = d for 1:1 scale
scene.camera.fov = 2 * Math.atan2 (h / 2, d) * (180 / Math.PI);
// re-render the scene
scene.render();
}