Archive for the ‘Flash 3D’ Category

Apple buys 3D Flash app

Saturday, July 17th, 2010

Screen shot 2010-07-16 at 19.31.05

I just found this article about Apple acquiring 3D mapping company Poly9, whose site has been taken down since the acquisition.

As far as I can tell, the French-Candian Poly9 is most well known for their in-browser 3D globe, that on the surface looks like a JavaScript library but is actually Flash (albeit with HTML overlays). The right-click menu has been sneakily hi-jacked so it’s quite well disguised, although I’d recognise those scroll bars anywhere! (and of course check the generated source to see the Flash object embed tag).

I’d be very interested to see what Apple are hoping to do with this technology, I’m guessing they’ll be de-Flashifying it pretty soon, certainly a simple 3D globe like this should be possible in HTML5 Canvas with something like Mr Doob’s three.js.

I’m wondering if Poly9 own any other technology or patents that could be useful to them..?

[UPDATE see Mr Doob's JavaScript globe here.]

2 days of Papervision3D and Flash games training for £249!

Tuesday, June 8th, 2010

Depth of Field particles in Papervision3D

I’m very pleased to announce that I’m running 2 days of training in Birmingham (UK) at the end of July, along with my friends at FlashMidlands. And if you book the Super Early Bird tickets (before June 15th), you’ll get both days for only £249! (saving £180 from the full price!) But I’d hurry, these courses usually sell out.

I’ll show you how to get started with Papervision3D and before you know it, you’ll be working with models, texture baking, depth of field particle effects (see image above) and of course, FLARToolkit using SimplAR. I’ll also be revealing many of the optimisation and production techniques behind high quality Papervision3D projects.

Asteroids from seb.ly

On the second day we’re going to look at making Flash games and programming animation, especially concentrating on interactivity, optimisation and making the games feel just right. And you’ll take away the base code for Space Invaders, Asteroids, a top down driving game, 3D soccer shootout, a platform game engine, a simple framework and more!

Naturally I’d encourage you to come to both days, but of course you are free to choose a single day if you prefer. The last course I ran in Brighton got a 97.78% approval rating and you can read more feedback here.

There are very limited super early bird tickets available (only 8) so book now to ensure your space!

FlarToolkit made easy : SimplAR

Thursday, June 3rd, 2010

As cool as bell-bottom pants according to Keith Peters! Which is pretty damn cool. And it can be really fiddly setting up the FLARToolkit, so I’ve finally released some of my AR code. Just in time for it to go out of fashion. :)

It uses the Alchemy branch of the FLARToolkit and includes everything you need to get up and running. It also has a very optimised automatic threshold adjustment system that takes virtually no extra processor time.

Here’s a quick intro :

It’s easy to use, there’s just one class. And I’ve also included swc files for the FLARToolkit Alchemy branch and the latest revision of Papervision2.1. You just need to extend the class and override the add3DObjects function.

package ly.seb.simplarexamples
{
	import ly.seb.simplar.SimplarBase;
	import org.papervision3d.objects.primitives.Sphere;
 
	[SWF (width="640", height="480", backgroundColor="0x000000",frameRate="30")]	
 
	public class AR_Sphere extends SimplarBase
	{
 
		override public function initialise() : void
		{
 
			var sphere : Sphere = new Sphere(null, 40); 
			sphere.rotationX =  90; 
			sphere.z = -50; 
 
			//add it into the container that is updated 
			//relative to the pattern marker
			container.addChild(sphere); 
 
		}
 
	}
}

Check out the screencast below to see how to use a custom marker, handle when the pattern is lost and found, and load a 3D model in.

You can check out the project from my googlecode repository at : http://code.google.com/p/sebleedelisle/

There area couple of extra things I’d like to add to the code, at the moment the size is fixed at 640×480 and the image is not mirrored; both things I would like to fix in the future.

I’d like to thank thesven.com for his FLARToolkit Alchemy code that saved me masses of time! Thanks also to Jesse Freeman and Kyle Kellogg for helping me test this.

3D engine in 10 lines*

Tuesday, March 9th, 2010

UPDATE – HTML 5 Canvas version now online

During my session at the Flash Gaming Summit, I showed a very simple 3D particle renderer to attempt to demystify the process of converting 3D into 2D.


Flash simple 3D particle renderer

Click and drag.

The actual code that converts from 3D to 2D is easy! First you have to figure out how much you have to resize things depending on how far away they are. (ie what their z position is).

newscale = f/(f+z);

Where f is a notional field of view. Changing this will change how wide the (virtual) camera is. A good starting point would be 250. Then you multiply the 3D x and y positions by the newscale to get their 2D x and y positions.

x2d = x3d * newscale; 
y2d = y3d * newscale;

So that’s where we put our particle, in this case represented by a MovieClip that we also need to resize by our new scale :

clip.scaleX = clip.scaleY = newscale;

And then the final thing we need to do is sort by the z position so that particles in front appear above particles in the background.

particles.sortOn("z", Array.DESCENDING | Array.NUMERIC); 
for(var i:int = 0; i< particles.length;i++)
{
	particle = particles[i];
	particleClip.setChildIndex(particle.clip, i); 
}

There’s some other stuff in there too, to create the depth of field blur and also the bitmap trails, but have a look and see what you can do with it.

Download the source code for simple 3D engine.

* I haven’t actually counted the number of lines. I’m guessing it’s about 10. :-)

More training courses in Cologne, Minneapolis, New York and San Francisco

Wednesday, February 10th, 2010

I’ve just finished my Brighton training courses which were seriously good fun, and everyone seemed to enjoy themselves, I’ve certainly got excellent feedback so far!

My next training course is short notice; it’ll be a Papervision course in San Francisco on the 9th March particularly aimed at 3D games. It’ll coincide with the Flash games summit so if you’re interested, let me know and I’ll make sure to get in touch with more information as I have it.

Then it’s on to Cologne for FFK in April, where I’m running both a Papervision3D course and a Flash games training course! More info on the FFK website.

And back to NYC for Flash and the City in May, and I’ll be running courses around the conference. Again, mail me if you’re interested and I’ll send you the details as they are announced.

And finally in FlashBelt in June, I’ll be teaching a one day Flash games workshop. Teaching you maths by stealth – who knew that you could learn trigonometry from Asteroids and vector maths from platform games? :-) It’s a fantastic conference and I’m really looking forward to coming back for my fourth year in a row!

Can’t make any of these events? Then help me organise one near you! Mail me.

UK Papervision3D training February 2010

Thursday, December 3rd, 2009

Back in my home town Brighton and my favourite venue the Lighthouse, I’m running another 2 day Papervision workshop on the 1st and 2nd February 2010.

As ever, I’ll be covering everything you need to know to get started with Papervision and then on to the cool stuff, games, skyboxes, augmented reality, interactivity and much, much more!

Papervision games Plug-in Media case studies Papervision3D Lines

And looking at case studies, including BAFTA award winning* Big and Small!

There are limited early bird places at £249 and also 4 student places at £99, but please book early as space is very limited.

Click for more details and to book Papervision3D training in Brighton.

* well how could I resist that particular prefix? ;-)

UPDATE : Now you can learn everything I know about programming Flash games! More information.

Simple Flash 3D drawing API

Friday, November 13th, 2009

I’m most passionate about hiding complexity with simple APIs, which is one of the reasons I’m so excited about Hype.

A few weeks ago Peter Elst told me that he was trying to find a simple way to draw 3D shapes, and so I helped him with a bit of code. He’d done some great work, and it really inspired me to continue to simplify things even more.

Get Adobe Flash player

So I spent a couple of hours putting together an experiment to see whether I could build a simple 3D drawing API for Flash that works more or less exactly like the 2D Flash drawing API.

I’m not sure whether this was the right approach but I thought it would be a fun experiment nonetheless and a great way to canvas opinion and get some feedback and ideas!

So here it is FlashDraw3D. The first thing you do is create a Graphics3D object:

var g3d : Graphics3D = new Graphics3D(this);

As you can see you pass it through a reference to the DisplayObject that you want to draw into. Once you’ve made it you can then draw into it :

g3d.lineStyle(1, 0xff0000, 1); 
g3d.moveTo(-10, 0, -10);
g3d.lineTo(10, 10, 10);

With of course the same syntax as the 2D drawing API except with 3 (x, y, z) coordinates instead of 2 (x, y).

And just like the flash drawing API has a drawRect, we have a drawCube :

g3d.drawCube(0, 0, 0, 100, 100, 100);

I’ve also added a couple of extras :

g3d.rotateY();

Just to show that it’s 3D :-) . I really should have added rotateX and rotateZ but hey I only did it in a couple of hours. :-) I’ll add it soon I promise.

And also some handy 2D to 3D converting commands :

g3d.moveTo2D(mouseX, mouseY, 0);
g3d.lineTo2D(mouseX, mouseY, 0);

Where you can pass through 2D screen co-ordinates that are converted to a 3D position at the z depth you gave it. In the example that comes in the code base this is used to draw in 3D with the mouse.

Please note : it’s very much a rough prototype and it’s absolutely not optimised at all! It’s incomplete and poorly documented. I’m just putting it out there to see what you think.

Download the code at http://code.google.com/p/flashdraw3d/source/checkout and give it a try! I’d love to hear any suggestions you have. (Polite ones anyway ;-) )

Here’s the code for the above example :
(more…)

Exciting changes for Papervision3D

Tuesday, October 13th, 2009

You’ve probably seen the official announcement on the Papervision3D blog already but I just wanted to summarise here and give my take on the situation.

Of course, Ralph has left, and i’ll miss him. But smart people like him need constant new challenges and I have no doubt that he will move on to bigger and better things! And I seem to be seeing him just as much as before!

Papervision3D 3.0
So we’re moving on with PV3.0, which will be our Flash Player 10 optimised version, rebuilt from scratch. Tim’s already making great headway with some of the core code such as how we handle rotations (with quaternions at the heart of every DO3D) and even some niceness with frustum clipping.

Openness
I think we’ve been guilty in the past of a lack of transparency in our process. When we all work hard for a living, it can be hard to make sure that we keep the community updated with what’s going on.

So we’ve decided this time to make the source code for 3.0 available on github as we’re working on it. If you have something to contribute, you can fork the code and have a go. If we like it, we’ll add it in!

New team members
Which brings us to the fact that we want new team members. If you do cool work with the code base we’ll most likely ask you to join us. Already we’ve enlisted Ben Hopkins who caught our attention with some crazy PixelBender experiments. Perhaps you could too?

Backwards compatibility
There are many things that need to be changed in the new version, so we’ve made a rule. That rule is that we’ll keep the API the same as PV2.0 unless there’s a very good reason to change it.

One of the more notable changes is that the axis system has changed, the z-axis now comes out of the screen rather than going into it. This is to bring PV3D in line with pretty much all the other serious 3D engines, and it should also make it easier to port code from OpenGL.

Papervision2.1 support
We realise there are some issues still to resolve in 2.1 and I for one, am going to continue using this branch for some time. So although there is a lot of energy and excitement around PV3, it doesn’t mean we’ve forgotten about the older code base.

I’m really really excited about these changes, and the renewed sense of energy that it brings. I believe the Papervision team members are among the best Flash programmers in the world, and it’s such a privilege to be a part of it.

Big and Small finalists in Adobe Max awards!

Tuesday, September 29th, 2009

Did I mention it before? I think I mentioned it :-)

Big and Small

I really do hate to ask, but if you like Big and Small, please take the time to vote for us in the Adobe Max awards.

Big and Small in .net magazine

Friday, September 11th, 2009

Just in case you missed it, there’s a 3 page article in this month’s .net magazine all about how we made Big and Small.

How me made Big and Small in .net magazine.

I’m so pleased that we’re starting to get some recognition for this site : we’ve just earned our very first FWA Site of the day award, and we’re also a finalist in the Adobe MAX awards!

And we’ve just won another project for BBC, and we went to Pinewood studios yesterday to check out the set. This will also be an immersive Papervision3D project, but we’re not allowed to talk about it yet.

Bad Behavior has blocked 793 access attempts in the last 7 days.