Archive for the ‘Papervision3d’ Category

Dreaming in Flash at The Tech Labs

Monday, July 7th, 2008

We're proud to announce that Dreaming has published a few tutorials over at The Tech Labs, these tutorials are exclusive and can be accessed at: http://www.thetechlabs.com/

They include an air contact manager, and two sound equalizer how-tos with one of them showing how to get those cool pv3d equalizers.

Enjoy!

Papervision3d GW Memory Leak

Tuesday, February 19th, 2008

Yesterday I came across a nasty leak with GW, it just wouldn't kill my moviematerials after I removed all the references to them, I tried it all, removeChild, removeListener, weak keys... you name it.

So I finally decided to go have a look at Papervision's destroy methods, and surprise surprise they weren't being called, no harm there, it's alpha these things are meant to happen :)

So here's what you have to do to force those destroy methods to execute, and clean your memory.

In org.papervision3d.core.proto.MaterialObject3D  set the destroy method from protected to public, do the same to all the materials that you use, like org.papervision3d.materials.MovieMaterial . When you're done with these just the destroy method in your class. For me it looks something like this:

Hope this helps.

WOW meets Papervision3D

Wednesday, January 23rd, 2008

WOW was released today, in case you don't know what WOW is let me quote a little description from WOW: "WOW-Engine is a free AS3 open source physics engine written by Seraf ( Jérôme Birembaut ) capable to handle positions in a 3D environment."

We've all been waiting for this moment for a very long time, to have physics
and 3D come together, so without further due here's a little demo I've thrown together in an hour or so.

The code will follow shortly, I just need to tidy it up :).

demo

Enjoy.

Papervision 2.0 PhongCube Demo

Wednesday, December 5th, 2007

Today a milestone in the internet world was achieved, Papervision 2.0 Alpha codename GreatWhite is out :)

So here's a little demo on the new Phong shader :) As soon as i have the time tonight i'll put on a much nicer one. This is just to show that altough PV3d just got a new whole set of features it's still easy to use :)

PhongCube

9-Slice and Bitmap

Monday, December 3rd, 2007

Have you ever tried to take a snapshot using bitmap.draw() of a movieclip that has 9-slice enabled?

//my9SliceEnabledMc is a 40 by 40 9-slice enabled movieclip on stage
my9SliceEnabledMc.width = 200;
my9SliceEnabledMc.height = 300;
var myBitmapData = new BitmapData(200,300);
myBitmapData.draw(my9SliceEnabledMc);
addChild(new Bitmap(myBitmapData));

So what you'd expect to happen above is to have a new bitmap that looks the same as my9SliceEnabledMc,
but what you get instead is the original 40x40 movieclip.
This doesn't make sense at all, i have no idea what Adobe was thinking when they let this one through.
This was driving me crazy for a while now, and today i finally found the answer, as simple as it seems,
putting the my9SliceEnabledMc inside another sprite corrects the issue!!

//my9SliceEnabledMc is a 40 by 40 9-slice enabled movieclip on the library
var myContainer = new Sprite();
var my9SliceEnabledMc = new my9SliceEnabledMc();
myContainer.addChild(my9SliceEnabledMc);
my9SliceEnabledMc.width = 200;
my9SliceEnabledMc.height = 300;
var myBitmapData = new BitmapData(200,300);
myBitmapData.draw(myContainer);
addChild(new Bitmap(myBitmapData))

Also i should add that this is a major issue with PV3D since you cannot directly use a 9-slice item as a texture.

Papervision3D Branches

Thursday, November 15th, 2007

Inside the Papervision3D source, besides existing an AS2 and AS3 version, there are five derivate branches: MaterialsRestructor, Phunky, ascollada, frustrum and timk_frustum. I decided to research a bit about each one and write about what I founded..

The most important of these branches is the one called Phunky. It is the branch that will soon became the 2.0 version of Papervision3D, which in the SVN trunk is now tagged Beta 1.7 (dated 20.08.07). So, if you're using trunk, you should expect only bug-fixes. It's a bit different from other open-source projects where trunk normally means the latest revision of the project. For Papervision3D, you can think of trunk as a stable version (whatever that means for a software that's in Beta).

Someone said on the list that "switching from trunk to Phunky shouldn't break anything (doesn't impinge on the API) but should net you a performance increase".

MaterialsRestructor was a branch created to test code regarding Materials. Once changes are tested the most likely is that they go into trunk or Phunky.

I don't know much about the 'ascollada' branch besides the fact that it was created by Tim Knip and that he tries to maintain it in sync with ascollada, a actionscript library for parsing COLLADA files. I've tested loading some COLLADA files with Beta 1.7 and it works fine so I don't have the need to use this branch yet but Ivan is using it (the DEA class), so he might have something to add here.

The 'frustum' (definition) branch has a 'BVH mocap importer class' with a beautiful sample here, but I was unable to find the real purpose of this branch. You can check the examples folder for the sample sources.

'timk_frustum' is a branch that appeared when Tim Knip put up for testing a new FrustumCamera3D, in early August 2007. This class is now also at the 'frustum' branch.

And that's it. If you know more about this and want to share please do. Thanks.

Update: John Grden posted a comment explaining a bit more about the branches, thanks!

Double-faced Plane (or Cube with depth=1) in Papervision3D

Thursday, October 11th, 2007

Today I had my first experiments with Papervision3D and after some time playing around I wanted to try having a double-faced Plane() with a different material on each face.

Its likely that a better way to do this exists, but one way to emulate a double-faced Plane() is to have a Cube with depth = 1, and hiding all but the front and back faces. Here's a demo and the code.

The hint to do this was from ldoru and the car in the images too!

 Update:  I would not longer use such an approach to achieve a double-faced Plane() with a different material on each face. I would recommend using a DisplayObject3D with two normal one-face planes inside it.

Carrousel How-to

Tuesday, July 31st, 2007

Hi there,

First be sure you have either flash cs3 or flex2 installed on your machine, then you'll want to download the Papervision3d engine.

Now we can get started :)
Look in the code for instructions :)

Download Actionscript source file

And that's it, if you have any questions please post them!! :) We'd love to hear from you.
Lo.

The mighty carrousel!

Monday, July 30th, 2007

This is a rework of the carrousel that Lee did over at flashblog. I've added the extra blur effect and a little revamp of the calculations for the plane rotation.

Code to come soon.