\m/ = RockOnFlash.com Logo == Papervision3D.Demo.download ? true

This is a bit of a re-hash of the original 2D/Flash8 logo I did with dynamic ambient lighting. It just made sense to create a 3D version of the logo and while I was at it, play with video materials and try out the ambient lighting with a 3D model! I seriously don’t think this would have been possible with AS2. There’s over 4000 poly’s in the scene, add to that video decoding AND dynamic ambient dropShadowFilter, and you got yerself a healthy helping of JIT happiness.

I’m releasing the source files as a Papervision3D demo which covers using MovieScene3d, MovieMaterial with an external SWF and dynamic ambient lighting. This time, I took the time to create docs. I’ve started on a Papervision3D library that I’ll be releasing at the classes in June (Rich Media Institute) and using in the samples and I’m including what’s in there now. These are basic classes I use all the time with the PV3D work I’ve been doing:

  • SceneManager: Creates a PV3D scene with camera. Includes a timer that updates the scene
  • SWFManager: Loads and manages external SWF’s and provides easy access to the content
  • BitmapMaterialsTools: Includes createBitmapMaterial() which creates a BitmapMaterial from the class you provide
  • ColladaSceneLoader: Simple class for loading and maintaining the properties of a loaded collada scene
  • ObjectController: Used for basic rotation control of an object on stage with mouse drag as well as keyboard control
  • IlluminationMonitor: This needs to be cleaned up for use with other projects, but it calculates the dominant color in a box area and applies a dropShadowFilter to the specified target

Docs located here
Download the Flex2 Builder project files here (all FLA’s, images, 3DS, ai files are included)
Download this video, and put it in the videos directory. Or use any FLV and call it currentVideo.flv and put it in the videos directory

*NOTE: you don’t need Flex2 builder, you can compile and run this with FlashCS3. Just sent the main document to RockOnFlashLogo and you should be able to compile and run.

I was going to go through a full tutorial on this, but I just don’t have the time unfortunately. So, what I’ll do is describe the steps taken and field any questions after you check out the source and digest.

The workflow for this project included:
FlashCS3 (vector logo) -> ai files -> 3D Studio Max 7 -> DAE (Collada) -> FlashCS3 (create movieclip skin) -> Flex2 Builder

  • Flash CS3
    • Created vector art of RockOnFlash logo
    • Exported to Adobe Illustrator 6.0 files
  • 3D Studio Max
    • Imported .ai files into new 3D Studio Max scene
    • Extruded elements and converted to editable Poly (important to do BEFORE applying textures ;)
    • Added unwrap UVW modifier to objects and applied logo material to the objects created
    • Exported as Collada file
  • FlashCS3
    • Imported RockOnFlashLogo.jpg into FlashCS3 so that I could create a movieclip for use with Papervision3d’s MovieMaterial. I dynamically create a Video object in the SWF at runtime.
    • Published SWF into the deploy directory for runtime loading
  • Flex2 Builder
    • Created ActionScript project in Flex2 Builder
    • In the RockOnFlashLogo.as class:
      • Create new Sprite to be the canvas for the 3D scene
      • Create the Scene with SceneManager and pass our newly created canvas
      • Draw and align the stage
      • Load the LogoSkin.swf (created earlier)
      • Create the MovieMaterial() with the loaded SWF movieclip
      • Add new material to the MaterialsList for the collada scene
      • Load collada scene
      • When the collada scene is loaded and parsed:
        • Start SceneManager.getInstance().monitorScene() – starts rendering the camera to the scene
        • Create the video container and start playing the FLV
        • Tell the IlluminationManager what target and filterTarget to use
        • Tell the ObjectController which stage and object to control by passing collada.getObject() and the RockOnFlashLogo’s stage object
        • Rotate the Logo object slightly for initial view
        • Start timer to update the dynamic ambient color filter

The IlluminationManager reduces the size of the video in half, then uses an even smaller area to sample the colors from. This is for 2 reasons:

  • Performance – the least amount of pixels we have to test, the better
  • Quality – if you test the entire video, you not get a good experience usually because there’s always some dominant color throughout the scene (like black for live music videos). So, you concentrate on the middle where a camera man tries to keep his subjects, and that usually gives you the desired affect.

The green box shows you were I’m sampling the color information from. If I were sampling the entire area, it’d always be black.

And finally: The video is of the Atomic Punks Live performing Van Halen’s “Unchained”. They’re an incredible Van Halen tribute band who’s singer sounds EXACTLY like David Lee Roth – incredible. The guitarist covers Eddie’s stuff in beautiful form and the overall sound they produce FREAKIN’ ROCKS \M/!!! THEY get a 5 rock on rating from me. If their drummer ever dies or just goes away, I’m SOOOOO there!!

RockOn Rating:   RockOn voteRockOn voteRockOn voteRockOn voteRockOn vote

Posted in 3D, AS3, Flash, flv. 5 Comments »

AS3 localToLocal and CoordinateTools

I had said I’d post the AS3 version of localToLocal and here it is! I’ll be adding some modifications for Flex2 stuff as I get more familiar with it, but this works as it did with AS2. I’ve tested with Flex2 and basic AS3 apps and works very well.

I included the entire class here, use it as you will – Rock on \m/

[as]/*
Copyright (c) 2007 John Grden

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions
of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

package com.rockonflash.utils
{
import flash.display.Sprite;
import flash.geom.Point;

public class CoordinateTools
{
public static function localToLocal(containerFrom:DisplayObject, containerTo:DisplayObject, origin:Point=null):Point
{
var point:Point = origin ? origin : new Point();
point = containerFrom.localToGlobal(point);
point = containerTo.globalToLocal(point);
return point;
}
}
}[/as]

Posted in AS3, Flash, Flex. 6 Comments »

Big gap in the Flash industry exploited?

Over the last year or so, I think I’ve done more brokering of Flash talent that accounts for more work in total hours than I probably have done in my entire flash career over the last 8+yrs. To say there’s a need for Flash developers is a complete understatement. If you’re doing AS3/Flex2 development right now, you’re in a really REALLY good place to have some real leverage in your pricing / salary. Throw on top of that some knowledge of FMS, Red5, Apollo, Papervision3D, Cairngorm and any other hot technology, and the possibilities are even higher.

Now, I’m not saying I see the same things happening that went on before the Internet bubble burst, but I have seen SOME things that would make one think we’re back in the late 90’s again. I’ve interviewed many people for Flash jobs over the last few years and I feel like I’ve met everyone in the Los Angeles area who has even breathed the word ActionScript (is it 2 words?) and any other agency, I’m sure, will tell you: there’s a real gap in the development end of the Flash spectrum.

I get calls and emails from people on a weekly basis – and now at conferences, I’m getting hit in the elevator and lobbies. I was just riding up the elevator with Dominic at FITC in April, and the guy in the elevator is hitting us both up about him being a recruiter and looking for Flash Developers. At FF Austin, same deal, only in the lobby outside the sessions. The guy saw my name tag and went to work right then and there on me. And despite Red5 being only at v0.6 and Papervision3D not even released at v1.0, I have emails coming in all the time for people looking for developers for both technologies – incredible!

One interesting thought I had was about how this might affect Silverlight’s adoption rate. I mean, right now, sure, there’s a lot of talk, some good articles and a lot of money being thrown at it to cause the adoption rate to escalate unnaturally, but could it also be affected by high developer costs and very limited experience to draw on for Flex2/AS3/FlashCS3 development? It’s a fact that there’s far more Flex2/Flash work out there right now than you can shake a dead cat at. It’s not going to take too long for M$ to exploit these issues and they’ll start filling the gaps with the many .Net developers who will be very happy to take a piece of that Flash pie.

I don’t get into raising a flag and camping with one technology (insert the very very tired Mac vs PC arguments – I just taunt Chris Allen for fun, but I grew up on Mac ;) . So you’re not going to hear me scream “Save Flash!” “Down with Silverlight!” – please, if it sucks, it sucks. If it’s good, it’s good and we’ll all adjust. But that doesn’t help our industry at the present moment. So back to my point…what was my point?

Oh yeah – Flash development gap. We have a “good” problem that’s unique to Flash, and Grant eludes to it in his article about Silverlight. Flash is unique in the people it attracts – they’re not hardcore developers so much (well, some are), and they tend to come from a mixed background that allows them to be very creative – hence the attraction and loyalty to Flash. We have a bad problem in that what we do is somewhat VooDoo to people coming in and playing. Knowing the player and its little tricks, the do/dont’s in developing Flash apps and sites is a bit steep and unless the person is REALLY driven to learn, they can be easily turned off. That’s the problem we face.

Personally, I think Adobe’s well aware of the issues and have at least a clue about what to do in the future. The move with Flex to Open Source is genius IMHO (surprise surprise), and they’re obviously making moves that mimic proven OS strategies that are very successful. This move brings in many more people who might have not otherwise touched Flash or considered it a viable technology to adopt, and with the energy and time they’re putting into Flex2 right now (and Flex3), I think it’s going to be easier for new developers to get into “Flash” development.

Flex2 is gaining more and more area in the overall “Flash work” pie, but there’s still a HUGE amount of agencies still doing experience sites involving animation and traditional uses of Flash. These 2 worlds, however, are growing closer and closer every day (enter Moxie). I find myself often times using Flex2 for tasks I normally would have done in Flash these days. And I think that anything, these days, that includes some sort of forms/data work causes me to reach for FB2 right away and make Flash bend to my will ;) I don’t think I’m the only one doing this! It’s because Flex2 is so cool from a developer’s POV and it makes our lives 10x’s easier in many ways (it’s not the end all be all, but it’s good enough to make me fight for using it in a project). Adobe’s well aware of this and they’re making things happen as we speak.

OK! conclusion – sorry, this is WAY too long, but it’s good content ;) We have a big gap in Flash/Flex development, that gap is likely to be exploited by Silverlight. But Silverlight lacks the creative/imaginative draw that Flash has always offered – oh and despite the voodoo, it IS easier to pick up and use than Silverlight – forgot to mention that simple fact. Adobe’s making some bold moves to ensure their technology, and yeah M$ has alot of cash, but Adobe’s not dumb :)

Wow, that conclusion kinda sucked. I think you get the point though.

Is there a cult next door?

Man, I feel bad – Here’s Rob Rusher (http://www.robrusher.com) doing this GREAT presentation on Cairngorm and we’re in the next room having a rock concert.

This is during the harmonic solo when we got people clapping along:) Rob handles it like a total pro and pretty well keeps going right on with his presentation and makes a few choice comments. We had no idea it was that loud – SORRY Rob! I’m pretty sure he hates me by now ;(

The ‘Circle’ is now complete.

May 25th, 1977 – can you guess what happened that day? Were you alive? This day and age, asking a flasher if he was alive in 77′ is not a weird question. I was 8, and I’ll never forget it. That was opening day for George Lucas’ Star Wars IV – A New Hope.

That was 30 years ago, and apparently, I really liked the movie. I guess it makes me sound old, but I was actually able to see the original Star Wars in theaters. I remember that it was an electric experience – people were just blown away and the lines were insanely long. We’d never seen anything like it! I saw it at a drive-in with my mom and we brought the saint bernard dog in the backseat (who took over the popcorn tub after about 5 minutes into the movie). I swear I didn’t sleep for 3 days after that.

Its funny how life works sometimes. I just had an awesome experience this past weekend. See, I’d been waiting 8yrs for my daughter to be old enough to see Star Wars. And that time finally came.

We sat and watched and for an hour and a half, and I got to be 8 again and see Star Wars through her eyes. She was absolutely glued to the screen! Each scene was an absolute joy for her – the music, the heroics, the characters and the story! She LOVED it! Which is good, cause I’d have been pretty depressed if she didn’t ;) I think she actually cut off the circulation in my arm during the trench run scene. SHE ROCKS \m/

Anyway, I don’t know why I didn’t put this together, but it just so happens to be the 30th anniversary this month for the original Star Wars movie. I can’t believe the timing – right down to the month, she’s nearly the identical age I was when I first saw it in the theaters – God gives gifts that are total surprises sometimes, and this one was one of the coolest for me.

StarWarsIV

The circle is now complete.

o’Riley (Harmonics Solo) – studio version

I’ve had quite a few people say they couldn’t make out the solo on the videos because of the clapping (everyone did a GREAT job clapping btw!), so I sat down last night and recorded it – hope you like it! Maybe it’s a good thing you couldn’t hear it ;)

I think I’ll call it “o’Riley” – I’m part Irish, my daughter’s name is Riley and it just reminds me of her when I play it. She’s so high energy and zany at the same time – she ROCKS \m/

ActionScript 3.0 Animation by Keith Peters

So, I get home from FITC 2007 expecting to let my mind melt into oblivion for a while and get back to a normal schedule with work and family. I’d like to thank Keith for ruining yet another fine plan for sleeping.

On my door step is a UPS sticker saying I’ve got a package and it’s waiting at the office. I’m thinking “I didn’t order anything…ahh maybe it’s Dream Theater live in New York” – you know, the one with the full Octavarium orchestra? Well, I get to the office, beat on the door, and the manager opens up and throws the package at me like she’s in a HUGE hurry back to her snack and “Days of our Lives”. So, I rip it open and what do I find? Keith FINALLY sends me a copy of his book.

See, I asked for one back in Hollywood, but never got it. I even reminded him, but well, he’s busy ;)

So, the first thing that catches my eye is the title and it has the words “actionscript 3.0″ and “animation” in the title. Well, ok, that IS the title, but my excitement was hindered not. Lately, Papervision3D has taken up many an hour in my mind and ANIMATING PV3D objects has just become a really important issue that we’re dealing with right now. Knowing Keith’s work and abilities with 3D and math, I had an instant flash on (can I say that on the air??)

Ok down to business – why am I writing about a book?? I haven’t bought a flash based book in years. Mostly because I can bum answers and code off of friends for free ;) ( don’t hate me! ) But for the first time, as I skimmed the TOC and chapters, I became more and more excited to keep reading. THEN all of the sudden, I found myself reaching for a highlighter and some torn pieces of paper – I WAS TAKING NOTES!!! Man, it was all over at that point. I was hooked from chapter to chapter. As you’ve guessed, I’m not that great at Trig/formulas but I’m VERY interested and try and read up on whatever I can – just hoping some of it sticks to my brain.

first, let me start off with the forward. I NEVER, and I do mean NEVER – read the forward. I don’t care who wrote it. But this time, I saw that Aral Balkan wrote it and he’s usually good with words blah blah blah – I read it. That’s the best forward I’ve ever read. I’m not kidding. Sounds ridiculous but Aral hit on some great points about our industry and what a “designer” or “developer” is perceived as. It actually was very inspiring, and I thought Aral deserved mention on that. VERY well done my friend.

Order the book here (www.bit-101.com/blog)

Favorite Chapters


Chapter 3: Trigonometry for Animation

This chapter was a fav from the start in that, I’m like Keith – I’ve not had any math beyond High school geometry and whenever I can, I’m trying to learn more about trig. The first paragraph on Degrees and Radians kills me (you’ll have to buy the book and read it for yourself). Just imagine Homer Simpson reading it to you. Then laugh. Maybe its because I can imagine Keith writing it, but I thought it was funny.

For anyone who wants a really nice foundational explanation of Trig as it relates to your work in Flash, you’ll love this chapter.

Quote from the chapter: “Pythagorus was a Greek guy who lived a long time ago.” – its “Pythagoras”, I love that I can correct his spelling when I can’t even remember how to convert radians to degrees right off the top of my head. But I DO love Pie.

Chapter 5: Velocity and Acceleration

In chapter 5, I think you’ll be happy to see how the chapter 3 trig functions are tied in. At one point, he threatens you to not forget to convert your degrees to radians ( fear seems to work well with math for some reason ). I really got into the sections on Gravity and Angular acceleration.

For me, i’m always hacking this sort of code – it’s never been my strong suit and this was great reading! It’s amazing how someone who knows what they’re doing can put your 20 lines of code into 4 lines. At one point, you feel a sense of “Yah BABY!”, and then, you feel stoopid :) and if you were paying attention in Chapter 3 where he says that 90% of the math you’ll use is sin/cos, he backs it up yet again at the end of the chapter with the “Important Formulas” that you’re supposed to burn to the inside of yer eyelids.

Chapter 12: Particle Attraction and Gravity

I really liked this chapter from the start. Of course, I was attracted (HA, pun intended) to the topic because of course, Keith is known for flash/math and I was hoping to get some particle genius out of this chapter. The first thing I want to clarify is: He’s a genius. He says he’s not, but he’s lying.

I love how he tosses out “G” (gravity) in the equation like you’d discard the jello in a boxed lunch as not being necessary. See, its that sort of thing I love seeing someone do – you gotta have some mighty big apples to throw out “G”, yo :)

And MAN fate is weird – I WAS actually considering writing some space based (Saturn V Rocket/LEM) sim (I’m not kidding, I live just down the street from Johnson Space Center in Houston TX) – and there he references that sort of project in the book. Yeah, that’s a little freaky.

Conclusion:
Well, that’s a basic low down on the stuff I’ve been spending time on in the book, but there’s a TON more that covers alot of 3D topics concerning everything from creating primitives, to animation, to lighting for 3D – the list goes on and on. I’ve only scratched the surface to be very honest. This review doesn’t even do it justice.

Keith’s writing is VERY easy to read, and he explains the formulas at the right time and in a way that I think is very easy to grasp and retain.

I haven’t handed out a RockOn Rating in a while, and this is a first for a book, but I’mma give it a 4. A 4 is REALLY high on the scale, I know I KNOW – but this is an extremely difficult subject to understand, much less write about in a coherent manner, AND it’s extremely timely with the advent of Flash CS3 and alot of ActionScript 3 projects that are going on right now both in the new IDE AND Flex2 worlds. We’re really seeing alot of emphasis on marrying Flex2/AS3/FlashIDE content together and this couldn’t have been better timed.

RockOn Rating:   RockOn voteRockOn voteRockOn voteRockOn vote