Bright Hub
 
Matthew Casperson's Hubfolio

Away3D Programming Tutorials - Away3D Lite

Article by Matthew Casperson (227,413 pts )
Published on Sep 22, 2009

Away3D Lite is a new streamlined 3D Flash engine, based on Away3D. Learn how to get your first Away3D Lite application up and running with Flex.

Introduction

Away3D Lite (download here) is a new Flash 3D engine based on the popular Away3D engine. Away 3D Lite includes the core Away3D components to create an engine that is small and fast – ideal for simple 3D applications like banners. Extracted the Away3D source files weigh in at 1.8 MB, whereas Away 3D Lite is only around 300 KB.

Also included in Away 3D Lite are a number of templates that can be used to get a new application up and running with a minimum of code. In this tutorial we will look at getting these templates working with Flex.

Code Documentation

SpriteUIComponent.as

All of the Away 3D Lite templates extend the Sprite class. In order to add a control to a Flex application it needs to extend the UIComponent class – adding a Sprite using the addChild function will throw an exception. The SpriteUIComponent class provides a simple wrapper for a Sprite. The SpriteUIComponent adds a Sprite as a child of itself, and then the SpriteUIComponent can be added as a child of the Application class.

ExSphere.as

The ExSphere class is taken straight from the Away 3D Lite demos (which you can download here) – no modifications have been made. It extends the FastTemplate class.

A3DL_GettingStarted.mxml

This is the main Flex application. We set the appComplete function to be called when the application has finished loading. [code]

Then in the appComplete function we add a new instance of the SpriteUIComponent class as a child, with the SpriteUIComponent constructor being passed a new instance of the ExSphere class which it will add as its own child. [code]

Final Words

Away 3D Lite is a great new engine that makes developing small 3D Flash applications quick and simple. With the SpriteUIComponent class providing the code necessary to use the new Away 3D Lite templates it’s also easy to use Away 3D Lite with Flex applications.

Go back to Away3D Tutorials

Related Files

Images

Screenshot

Next Article

Away3D Lite TerrainAway3D Lite Programming Tutorials - Terrain Demo

Find the limits of Away3D Lite by creating a highly detailed terrain demo.

Related Article

Sandy-HXMaking your first Sandy-HX 3D JavaScript Application

This article shows you the steps required to setup, compile and run your first 3D JavaScript application.

Search More About:

Comments

Oct 29, 2009 8:14 PM
RE: Away3D Programming Tutorials - Away3D Lite
Your best bet would be to look at how other primitives, like the Plane, are created.
Oct 29, 2009 10:44 AM
Martin
Triangle Primitive
Hi,
Thanks for your tutorials, they are very useful. :]
I can not seem to find a Triangle primitive in away3dLite, how can we create a triangle primitive and set the x, y, z for every vertex?

Thanks!
 
Follow Matthew Casperson
Receive weekly updates from Matthew Casperson
 
Bright Hub - Science & Technology Articles, Buyer's Guides, How-To Tips and Software Reviews
About Bright Hub | Contact Us | Advertise with Us | Become a Writer | RSS | Site Map | Terms of Use | Privacy Policy | Copyright Policy
©2010 Bright Hub Inc. All rights reserved. Page copy protected against web site content infringement by Copyscape