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

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...)

Papervision3D 2.0 The Great White from the ground up

In this article you'll learn about some basic functionality with the latest version of Papervision3D. After reading and understanding this article whith it's examples you should be able to build something like the simple example from above.

(more...)

Papervision3D Public Alpha 2.0 - The Great White documentation

Last week I've been working on some simple tests with the latest Alpha release of Papervision3D. I found out there was no documentation available yet (or at least I couldn't find it). That's why I generated my own ASDocs documentation and published it online. I think that I might not be the only one who’s looking for this.

 

The documentation is based on the the Public Alpha 2.0 - Great White release which can be found at Google code.

 

Please notice that this release is in Alpha status, so as Ralph Hauwert mentioned here, don't use it when you need to deliver a project by tomorrow, the code isn't optimized yet!

 

You can find the documentation here.

 

I plan to post some examples of it early next week.