Monday, June 30, 2008

Looking to Hire Sales Pro

The Basement is looking to hire a sales pro. Please check Jacob Leffler's blog for the details.

Monday, June 23, 2008

Scale9Grid Class for Masking in AS3

UPDATE: Revised classes and test files can be found here.

---------------------------------------------------------------------------------

I ran into another quirk with Flash today. I couldn't get Flash to apply Scale9Grid correctly on sprites/movieclips that were being used as Masks. After searching for help it seems as though the two features are not compatible (please correct me if I am wrong). Therefore, I threw a class together this afternoon that creates a Rectangle with rounded corners that automatically scales according to the scale9Grid rules. The class allows you to use the rounded rectangle as a mask without having the corners distort when it scales.

Its nothing fancy and when I wrote it I didn't intend it for the public population. However, I haven't been good at donating code so I figured I should throw it out there anyways. Hopefully it will help me start a habit of publishing my code, which should improve my coding practices and maybe even help someone in the process.

View the source code here.

Feel free to use/edit/demolish the code and as always feedback is greatly appreciated.

Wednesday, June 18, 2008

Papervision Offset / Scale UV

I started working on a Papervision project this week. I've experimented before and had gone through the tutorials on Papervision2 and GotoAndLearn (both of which where a great help), but this is my first "official" papervision project.

Almost immediately my first hurdle was trying to figure out how to manipulate material on planes. By default the material fills the entire plane no matter what, but I wanted to use 1 material on multiple planes and have each plane show a different section of the material. I could easily cut up a bitmap and use that, however the project called for a Video so that option was clearly out. Basically I needed a function to scale and offset the material.

After digging through the API and scouring the Forum I eventually found out that each plane is made up of 2 faces. Each face is a triangle and has 3 vertexes and 3 uv values. By looping through both faces and each vertex and changing their uv values one by one I was able to scale/offset the entire plane's uv.

The following code snippet shows the general idea:

var geo:GeometryObject3D = plane.geometry;
var face:Triangle3D = geo.faces[0];

var left:Number = .5;
var right:Number = 1;
var top:Number = 1;
var bottom:Number = .5;

var topLeft:NumberUV = new NumberUV(left,top);
var topRight:NumberUV = new NumberUV(right,top);
var bottomLeft:NumberUV = new NumberUV(left,bottom);
var bottomRight:NumberUV = new NumberUV(right,bottom);

var numberUV:NumberUV = face.uv0;
numberUV.u = bottomLeft.u;
numberUV.v = bottomLeft.v;

After this point you would continue to alter the other 2 uv values on the face (uv1, uv2) and then do the same for the remaining face.

UV values range from 0 to 1 (when the material is not tiled, it can be greater when tiled). By default the left value should be 0, the right value would be 1. By changing both the left and the bottom to .5 we should only see the top right corner of the material on the plane. Everything on the left half and bottom half would be cropped.

Let me know if you have an easier way to achieve the same effect. Would love to hear it.

I will post the project once it is complete.

Monday, June 16, 2008

3D TV's and the Future

Yesterday I watched 3D Sea Monsters at the IMAX. Great stuff. It really makes you want to just reach out and grab a hold of the fishies on the screen.

It had been awhile since I have gone to a 3D movie and I found it interesting that they no longer use the green/red goggles and instead had some tinted blue ones. While trying to figure out how the new goggles worked I stumbled across an article from last week on the Technology Review called "3-D Viewing without the Goofy Glasses".

Basically the article states how Phillips is developing TVs that have special lenses attached to the front of the screen that enable people to view things in 3D (I wonder if they will jump out of the screen as far as the goggles allow them too). If this is true then that means no more goofy goggles and better yet, no more having to go to the IMAX or theme park to experience 3D video. They are hoping to bring it into every home and have it be the next big thing since HD.

That got me thinking... If they can do that, then the next step would be to make it interactive. I want to hold a wiimote (or whatever is fashionable at the time) and interact with this 3d world. Better yet, I want a glove that gives feedback in the fingertips when I try to touch a fishy floating by. Also, if its on the TV then I want it on my monitor. I want 3D Flash jumping out of the screen when I view the web.

Maybe I want to much, but I don't see why any of these ideas would not occur in the near future.

Tuesday, June 10, 2008

Officially Done With Freelance

I've been doing freelance multimedia work on top of my job/classes for about the last 5 years. Initially I would take anything I could get: Video, Interactive CD, Web Site, Flash Animation, mow someone's lawn... it didn't matter. Over time I started to narrow it down a bit. I'd only accept web related work... mainly html, css, and of course Flash. Within the last year I had only been accepting Flash projects.

As of today... I am accepting nada. NO NADA NO MORE. Feels good, real good actually. It used to be exciting to have an extra project to work on in the evenings, but now it is just a burden. Freelance was a hobby and a passion... but now my job has become my passion which is a great feeling. Any time I would have used for Freelance I would like to dump back into the Basement. We have so many cool projects coming up, I want to focus and make them badass.

Will keep you posted on upcoming projects as they develop. Also, if you are in need of some freelance work I might know of some people looking for a Flash developer... just drop a comment.

Tuesday, June 3, 2008

MochiAds "adds" version Control and Encryption

I am a big fan of MochiAds and think they provide a great service for aspiring game developers. If you don't know what they are about, basically they help game developers get their games distributed on the web and assist in placing advertisements within the game. The service is free and then they share the advertisement profits 50/50 with the developer.

Judging from a recent post on their forum it sounds like their latest update will have 2 new features.

1. Version Control. So if you upload a new version of your game. Users will be prompted to download the update before they play. Pretty cool... no longer will there be different versions of popular games floating around the web.

2. Encryption. This should help prevent people from decompiling your game and stealing source code. There are 2 sides of this issue. Some people believe that all Flash files should have their source readily available to promote learning/better coding practices. Lee Brimelow would probably fall on this side of the fence. On the flip side, some people think decompiling is stealing/unethical.

Personally, I am cool with it as long as its for the right reason: to learn. If you want to see how something was done and pick up some tips... great. If you are actually copying and pasting code, then we have a problem. And that is where this encryption could be handy.