Archive for the ‘Programming’ Category

Flash Player 10 - 3D Example

Tuesday, October 21st, 2008

I’ve tinkered a bit with Flash Player 10. One thing that seems almost funny about the 3D effects of Flash thus far is that very few examples show off actually 3D objects. Most examples I’ve examined show 2D planes transformed in 3D space. So, I’ve created a sample 3D cube primitive in AS3 as a convenient example for people who want to get started with their own parsers or drawing tools (etc).

(more…)

Flash player 10

Wednesday, October 8th, 2008

Its that time again. Time to get into the latest and greatest tech from one of those giant software engineering companies. This time, the tech is Adobe’s Flash player 10.

Step 1: download the Flex 4 SDK and the Flash player 10 (debug version).

Step 2: Create a fresh config file that will target Flash player 10.

Step 3: Use MXMLC to compile your Actionscript or MXML file.

Step 4: Explore AS3 with Flash 10!

I’ve only tinkered around a bit at this point. But as soon as I get a chance to build a crazy app, I’ll have a more thorough write-up. So far, I’m quite excited at the new features. Be sure to read up on the following:

new Vector class

The inverse kinematics package

The new Shader class

The all new text engine package

ColourLovers API

Tuesday, September 16th, 2008

Colour Lovers API lets you pull color palette information with very Flash-friendly urls and XML results! I dare you to make something with this.

Also, I found this little blog post very interesting.

Double Dissapointment

Friday, August 22nd, 2008

ECMA script 4 (or 3.1) and OpenGL 3.

I may be in the (rare?) position of being highly interested in two disparate technologies. The first being an online scripting language standard governed by ECMA (used in Javascript & Actionscript). The second, an open standard for real-time rendering governed by the Khronos Group (OpenGL). In recent days these two languages have faced most unfortunate developments. First the ECMA script 4…

(more…)

Papervision3D Part 3: Features continued

Sunday, August 17th, 2008

This posting is part 3 of a series. If you find that you’d rather start from the beginning, check out Part 1 and Part 2 first. In this post, I’ll cover Papervision animation, the ASCollada project, render statistics, performance optimization.

Animation
Animation in Papervision3D can be performed the exact same way animation would be performed in 2D. Simply apply any tween or algorithm to an object property (like x, y, rotationX, scaleY, etc) and re-render the scene. But, for imported animations its not quite that simple. Lately Moses’s GoASAP package is being adopted in testing for the Papervision engine. It could soon become adopted by the system.

The Collada DAE Parser
Imported animations come in plenty of flavors but must conform to the same system. That’s the reason the animations package exists. Papervision has long supported externally created 3D assets. You’ll find those file parsers in pv3d.objects.parsers. Although, these importers are nice to have, a big part of Great White was the introduction of the open source project ASCollada. ASCollada is an amazing parser for the standard 3D asset interchange format known as Collada. Collada files are basically very dense XML files that use a .dae file extension. Collada files can be exported from Maya, 3D Studio Max, Blender, Google Sketchup, and XSI. However, level of support for those programs probably follows this order: 3D Studio Max, Maya, Blender, Google Sketchup, XSI. Also, if you’re importing MD2 models, the MD2 file parser will import most animations as well.

(more…)

Papervision3D Part 2: Features

Friday, July 25th, 2008

This is part 2 of a 4 part series outlining 3D in Flash by dissecting the open source Papervision3D library. Before getting deep into features let me first make a few points about using Papervision3D.

The Papervision3d source SVN location includes the standard AS3 version of Papervision3D (version 1.7 as of this writing). If you look at the branches folder inside trunk you will find version 2.0 which is code-named “Great White”. This series is focused on that branch, and NOT version 1.7. Also, its important to know that Great White is probably the fastest and most frequently changing part of the Papervision source and thus details in this article will likely change over time.

Also, as a convention in these posts, I’ll be putting direct references to actual Google Code hosted repository files inside this page. If you don’t wish to open that repository each time you want to know the path of a class, then simply mouse over the link and look at the link address or the tool tip that shows up for the link. All references to Papervision3D classes assume that all uses of the term “pv3d” refer to the root Papervision3D package.

(more…)

Papervision3D Part 1: Introduction

Friday, July 18th, 2008

I have many friends asking me for more information on Papervision 3D. Usually, they’re just genuinely interested in learning about it and also how they can use it. These friends are bright people, but generally unfamiliar with the topic of computer graphics. I’ve consistently directed them to Wikipedia articles that I think will make everything clear to them (in this order):

  1. Computer Rendering
  2. Rasterisation
  3. 3D Projection
  4. Matrix Multiplication

Unfortunately, I think people are reluctant to read those articles because they’re half written in math formulas. Those formulas are critical for getting a real understanding of what’s going on “under the hood” but I admit they’re annoying to read if you don’t really want to learn the math. And also, those articles won’t mention a single Papervision class file anywhere (naturally). I’m sure this is a little less exciting for someone who’s into 3D in Flash. Therefore, I’m reviewing and dissecting Papervision3D 2.0 (Great White) in a multi-part series for those who are curious about 3D in Flash.

Part 1 will review those Wikipedia articles and relate them to Papervision along the way. If you’re already familiar with computer graphics as a topic of CS, you may wish to skip this post. Parts 2 & 3 will review the details of many features of Papervision3D. Part 4 will be a set of useful notes and tips for anyone who’s not already experienced with Papervision3D.

(more…)

Actionscript 3 performance tuning review

Wednesday, July 9th, 2008

After late-night conversations amongst coworkers and friends over beers, I’ve discovered that many flash developers remain unfamiliar with AVM2’s inter workings. A while ago, I found a couple documents which have benefited me greatly in understanding AVM2 and AS3:

Actionscript 3.0 and Performance Tuning

AVM2 Overview

There are definitely some big take-aways in these two documents. I would list them here, but then you might not read them for yourself! ;)

The first document is 74 powerpoint slides (prepared by Gary Grossman of Adobe) which is very useful for getting a quick understanding of AVM2 topics such as garbage collection, the benefits of strong typing, the Actionscript byte code (abc) format, the code interpreter and JIT compilation. For an AS3 developer this is a must-read.

The second document is a bit more dense. It contains 108 pages of more formally described underpinnings of the virtual machine. It focuses a lot on how your AS3 code will ultimately be run as processor instructions. Its a great follow-up to the first document. If you’re a geek, I would highly recommend reading this overview.

Technique: Semaphores

Thursday, June 19th, 2008

For the past year(!) or so I’ve had a series of articles I meant to write about some intermediate programming concepts that can allow you to write code at a higher level. I regret that it’s taken so long to come around to them, but I hope they can be of some use. This series will cover semaphores, asynchronous tokens, and green threads, and I may extend it with some brief notes on assertions and iterators. Today I’d like to talk about semaphores.

(more…)

Flash Site Experience Profile

Monday, June 2nd, 2008

This is essentially the second part to my last post. This time however, I’m concentrating on the user experience of the same campaign site (www.starbuckscoffeeathome.com) based on tracking data. I’ve used a custom-built statistics class which helped me to derive plenty of useful numbers from a normal user experience flow. My method was to record all important events and normal status data like the amount of external data loaded, the frame rate, and the memory usage. After recording the information I designed an infographic about what I discovered. You can see the graph here.

As you can see, there’s some disappointing trends. I noticed there seems to be a memory issue -something that must have become unresolved before final launch. The framerate reflects the usage on my trusty Intel 2 Ghz Mac Book Pro. Very unimpressive considering this is a decent machine really. I’m sure there’s a little bit of overhead which came from the statistics activity. Although the experience didn’t seem out of pace with the same one when the statistics class inactive. After considering when the average user leaves the site, I decided to make a second graphic which can be seen here.

And this is a little bit unfortunate. I will confess however that the connection speed on the machine I recorded the statistics with was a very slow DSL. A DSL connection would’ve produced more favorable results (assuming the user wasn’t doing other download work in the simultaneously). Although, as you can see a very large amount of time is consumed by watching a loader which brings me to the point of this post. If you build Flash sites which rely upon a pleasant user experience, then make sure all the content you load is well worth its weight.