Papervision3D “Sprite3D” object

[UPDATE] Added a yawing example to make more clear what's going on. [/UPDATE]

It's been quite a while since my last post. In between I've been on vacation for a couple of weeks and had some strong deadlines to deliver my daily work. I've many cool idea's to work out and write about on this blog. One of them is called a "Sprite3D", which name is based on Sprite 3D from Sandy.

The concept is that you'll have just a basic plane which is always faced up to the camera. Depending on the angle between a camera and a sprite3D object it will change it's texture. When you have for example 360 images of an object which rotates 360 degrees, you can show for each angle a different texture, which will give a 3D effect to this plane. This makes it possible to show advanced models without actually rendering them! Because it's all shown at a plane, it's all very light for your CPU.

I've put this all together in a class which extends DisplayObject3D. Working with this class is like working with standard objects like cubes or planes, so it's pretty straightforward like you will see in the following example.

 
var materialList:MaterialsList = new MaterialsList();
// angle range -45 (315)  - 45
materialList.addMaterial(new BitmapFileMaterial("assets/image1.png"));
// angle range 45 - 135
materialList.addMaterial(new BitmapFileMaterial("assets/image2.png"));
// angle range 135 - 225
materialList.addMaterial(new BitmapFileMaterial("assets/image3.png"));
// angle range 225 - 315
materialList.addMaterial(new BitmapFileMaterial("assets/image4.png")); 
 
//Just enter your materialList and dimensions
sprite3D = new Sprite3D(materialList,300,150);
//add sprite3D to the scene, like you would do with any object.
scene.addChild(sprite3D);

Depending on how many materials you'll add to the sprite3D it will automatically calculates on which angle it should change a texture. In case you'll add just one MovieMaterial to the materiallist, it will look at the number of frames within this MovieClip as your textures. This is especially useful when you have a 360 frames render of an object. You don't want to add 360 separate materials to the materiallist.

Below you'll find two working examples of a rotating car. You can change your position by using your arrow keys.


Same example, but with a yawing sprite3D:

I have to say this approach also has it's downsides:

  • You'll get bigger downloads, since you need to load image sequences.
  • You can't get too close with a camera, this will make it feel unnatural.
  • Only rotation on the Y axis is implemented. Implementing another axis will end up with an even bigger download (360*360 images if you want the best quality)
  • Animation of a texture should be possible, however you'll end up here as well with a big download.

Anyway, I think it's a very useful object type, below you'll find the source files. Hopefully it will also be useful for you. Let me know if you have any ideas of what to implement, how to improve performance or adjustments you did yourself. I would like to hear your feedback!

Downloads:


Example model used from Troyano

Wanted: Actionscript 3 expert with good Papervision3D skills

I'm happy to announce my company, DNBmedia, is looking for a new team member! DNBmedia is based in Amsterdam, where we build lot's of cool stuff! Papervision3D, Paperworld3D, Red5, AIR, all the stuff you read here and a lot's of other cool technologies. Since our commercial work has multiplied we are in need of a new team member.

Have a look at the full description here: http://www.dnbmedia.com/jobs/actionscript3-papervision3d-expert.html
I hope receiving lot’s of impressive resumes soon.

Don’t live nearby Amsterdam? No problem, housing will be arranged!

Paperworld3D v0.1 Installation tutorial

To set up a Paperworld3D project you need to use several programs, which might be partly new for the average Flash developer. Since I know this makes it kind of hard to set up a project for the first time, I wrote down all the steps which I've taken to get the demo files up and running on my local machine.
Follow these steps exactly and you are able to get it all running too!
[NOTE] I'm using Windows XP, I'm not sure if all these steps are the same on Vista and Mac (Let me know!).

(more...)

Alternativa3D 5.0 (Milestone 1)

A couple of months ago I accidentally found a demo of a AS 3D engine, called Alternativa. Alternativa is a project founded by the Russian company called “GRTOV Studio". Basically it is a full AS3 3D engine, with future multiplayer support.

They described Alternativa as:
Alternativa is a platform for creating, implementing and supporting multi-user browser media over the Internet. It consists of server core (data store and exchange, synchronizing, managing hardware load), clients part (3D-engine, GUI and other client apps), administrating part (integrated payment services, through user registration, statistics), documentation (”how to create and to manage projects” guide, public classes and methods description etc.), support system (developers portal, forum, FAQs etc.), and the applications made on a platform themself.

Alternativa Platform — simple and useful integrated development tools, world editors, free to use resources (game objects logic modules, textures, sounds etc.). Platform takes care of data storing and user data synchronizations, gives development methodology and hosting, shares its community, supports projects at all their stages.

Every company or end-user will be able to create personal 3D-world and to fine tune it according to own goals and preferences. We aim to give talents an opportunity to develop, to give developers tools to create great projects, to let business to market their goods and services through their own innovative personalized multy-user media.

Once in a while they post a new demo online, to show the world their progress. All of those demo's are pretty amazing, but their last demo (called Alternativa3D 5.0 (Milestone 1) ) which is posted today really rocks! It has a great performance and a good level of detail for this size of the scene!

Alternativa3D Bunker Alternativa3D Temple



Unfortunatly nothing can be found if the source code will go public soon, or if it will be open sourced at all. For now we just have to wait and see and be blown away by their impressing examples.

Vodafone/TNF campaign

Vodafone/TNFRecently we (DNBmedia) delivered in cooperation with the Dutch marketing agency Ubachs Wisbrun/JWT a campaign site for Vodafone/TNF. TNF offers IP based data communication solutions. Since this might be difficult to handle you'll need TNF to get the overview and manage it all for you. This is visualized by a labyrinth with an overview map, so you know exactly what to do on each intersection (like you know exactly what to do with TNF's support).

I personlly really liked this project, since we combined 3D with flash. In this case the flash part is not real 3D, since it was a requirement to display objects in a way which isn't possible with any 3D flash engine yet. Our in-house 3D developers rendered their scenes to a video output which we converted in flash. These video's can be played forwards and backwards, depending on the users arrow key input.
One of my personal features I liked was to build in the ability to go each possible direction on the intersections. This would have given it an extremely cool result. I already figured out how to do this and wrote the first parts for a smart loading engine, since you don't want to preload all possible choices. Unfortunately this feature isn't implemented in the final release, because we had a strict time schedule and off course it all needs to be kept on budget.

There where two big challenges for this project:

  1. Keep the download as small as possible while having the best quality on a high resolution. Although the site is a little over 25MB I think we've taken the best out of it!
  2. Get a smooth performance. I've faced a lot of performance issues when I started up the project. The memory usages raised very fast when walking through the labyrinth. Beside this, when we walked backwards we where moving with just a few frames per second. I'm sure we came with some good solutions for this.

I really think you should check out this website. It's completely in Dutch, including the instructions at the beginning. The most important thing to know is that you can move forwards and backwards using your arrow keys, you can click on the 4 objects you'll find on your way and you can click on the hotspots on the map to warp to an object.

I would like to hear your impression about this website!

On AIR Tour Amsterdam

On AIR Tour Amsterdam

Last friday I attended the Adobe's On AIR Tour in Amsterdam.

The sessions were interesting for actionscript developers, as well as javascript developers. For both type of developers where some specific sessions.

At Adobe Max last year I followed an AIR training, so I already knew the possibilities of the AIR API. Since the 1.0 release I haven't had the chance to see what's new. One of the things that where missing in the previous beta releases was the possibility to start an AIR program on system startup. It wasn't sure back then if this would be possible in the 1.0 release. Between the lines, Lee Brimelow spoke about this possibility!

During the day some prices where given away randomly. Some O'reilly books, Flex 3 software, T-Shirts, posters and finally 2 Adobe CS3 Master Collections. Guess what who won the CS3 Mac version! Indeed, I won it!! I'm really happy with it, although I'm not a mac user... So when you are reading this and you are a Mac user having a windows license, please contact me, so we can exchange our software:-) I would be really happy having the whole CS3 Master collection installed on my laptop!

Paperworld 3D v0.1 released!

Go check out yourself: http://www.paperworld3d.com

Later on this weekend, I'll post my thoughts and examples about this very promising project!

[Update 2008-04-06]
During this weekend I've been looking into the source code. It's all well organized and Trevor Burton did an excellent job!
Since it's a first release, without any tutorials yet, it is kind of hard to get it all running right now. Errors found in the project could mean that I've misconfigured something, or that I've found a bug.
Trevor showed his will to help me out which I really appreciate. As soon as I have some working examples I'll write down my experiences on this blog.

Multiplayer Papervision3D using Red5

With Paperworld3D coming to us very soon I've been experimenting with a multiplayer papervision3D application. I've been using Adobe Media Server before to build some multiplayer applications, but this time I want to build it in red5, since I was inspired by Chris Allen's session at FITC Amsterdam about a month ago.

To keep it all very simple for now, I just made a simple cube with some textures. Each visitor of the application will be represented as an avatar, which is in this case just a plane with a random colored texture. The avatar can be controlled by using your arrow key's in combination with the mouse.
Locally the avatar is moving in a 3D environment and pushes it's position (x/y/z/rotationX) every half a second to the server. Every half a second each avatar in the 3D environment will look where all the other avatars are positioned at that moment and tweens each plane to that position, so it will all happen smoothly with a delay of half a second.

(more...)

Drawing a cubic bezier curve using actionscript 3

Flash curve exampleRecently I came up with an idea for a project to work on and where I plan to write about soon on this blog. As a part of this project I need to draw curved lines. I thought it would be a good idea to make this similar as the curves which you can draw with the pen tool in Flash and Illustrator. An example of this kind of curve is on the left. I expected this would be really simple and it was just a standard drawing API which I had to use to draw this kind of curve...
(more...)

Colin Moock’s ActionScript 3.0 From The Ground Up Tour

Today I attended Collin Moock's AS3 From the ground up tour. This was organized at the same location of FITC which ended yesterday.

I heard some stories about the though material to get through during this 9 hour training day. Good preparation and a good night of sleep where required to follow his presentation. However it was a long day sitting at very uncomfortable wooden chairs, it was really good to follow. Collin mentioned some very useful tips and information that where new to me.

The audience was mixed from really beginners to pro's. I can understand the real beginners needed the preparation before attending, but for the professionals only the last few hours where really interesting. I think this training would be perfect for people who're now working from the timeline only and are thinking about starting with classes. They could learn a lot from Collin's clear explained and well organized information.

I've a lot of respect for Collin's knowledge. Like a walking reference guide he knew without looking at any documentation all answers to very specific questions which came from the audience. He's very talented and the right person to be on tour right now!