NYC Papervision class slides and demo files

I’ve had quite a few requests offline about seeing the slides used and the sample files from the class, so here they are. The slides are meant to be informative at times, and then just a intro to a much bigger demo that we do together in class, so I’m not sure they’ll be much of a help, but here you go ;)
NYC Class slides

I’ve also posted the demo files I used at the NYC class and it includes the 3D assets as well as the flex2/3 project files and simple FLA examples. The version of PV3D that’s included in the “classes” folder is 2.0, but not the same revision that’s on google code right now. You should point to the GreatWhite code base when running these demos. They should still work as-is.
NYC Class files

Papervision 2.0 Effects Branch released

We’ve created a new branch called Effects after a ton of requests to play with Andy’s Effects API. He’s also posted the famed Borg cube demo – have fun ;)

Papervision3D effects demos

At the end of Sunday’s PV3D training class in NYC, I think everyone was in a bliss stupor – including myself. It was the first time I had a real chance to get my head around the possibilities his classes give us with PV3D and as I walked around class to make sure everyone was compiling ok, I was seeing people take off in amazing directions with the effects demo of the Borg cube (above). I could hardly wait to sit down and start playing with this stuff myself! So, in the taxi on the way to the airport, I pulled out the laptop, borrowed Mr Doob’s new ball and went to town on the effects api :) BIG thanks to Moses (Yes, of Fuse Fame) for the color transform that makes it look like fire ;)

Red Ball Acceleration Demo
As the ball gets faster, it warms up! The code below shows you how you can use BlendModes and color transforms to really come out with some sick affects. The only thing holding me back with these is my lack of experience with color manipulation. In the hands of someone like Grant, Carlos or Andy, it'd be unbelievable what they could come up with!

[as]bfx = new BitmapEffectLayer(stage.stageWidth, stage.stageHeight, true, 0, BitmapClearMode.CLEAR_PRE);
pv3dContainer.viewport.addRenderLayer(bfx);
bfx.addEffect( new BitmapLayerEffect( new BlurFilter(10,10,4)));
bfx.addEffect(new BitmapColorEffect(.99, .98, .98, 0.98));

ct = new ColorTransform(1, .2, .1, 0.45); // RED

var drawCommand:BitmapDrawCommand = new BitmapDrawCommand(null, ct, BlendMode.ADD);
bfx.drawCommand = drawCommand;
bfx.drawLayer.blendMode = BlendMode.OVERLAY;
[/as]

Blue Vapor Trails
It's supposed to be what it might look like if this really cold blue ball were falling through a evening atmosphere hitting warm pockets of air and creating some sort of vapor trail

[as]bfx = new BitmapEffectLayer(400, stage.stageHeight, true, 0, BitmapClearMode.CLEAR_PRE);
pv3dContainer.viewport.addRenderLayer(bfx);
bfx.addEffect( new BitmapLayerEffect( new BlurFilter(10,10,4)));
bfx.addEffect(new BitmapColorEffect(.95, 1.0, .98, 0.98));

ct = new ColorTransform(0, .5, 1, 0.18); // BLUE

var drawCommand:BitmapDrawCommand = new BitmapDrawCommand(null, ct, BlendMode.ADD);
bfx.drawCommand = drawCommand;
bfx.drawLayer.filters = [ new GlowFilter(0xFFFFFF,.5, 0, 50, 10)];

bfx.drawLayer.blendMode = BlendMode.MULTIPLY;
bfx.clippingPoint = new Point(9, -20);[/as]

And Finally - this guy's right out of the NYC class and creating sickness
I guess he liked the effects ;)

Papervision3D 2.0 Released – Great White

New branch in the googlecode repo: http://papervision3d.googlecode.com/svn/trunk/branches/GreatWhite/

Well, if you’re into 3D and haven’t heard the buzz about Papervision3D 2.0, you’ve probably been under a rock or working for an agency on a 6 week deadline in a room with blacked out windows. We’ve all waited for this release with much anticipation and it’s been a long wait, but that wait is FINALLY over!

Ralph and Tim have been cracking away at 2.0 and putting in amazing amounts of hours to do so – these guys haven’t slept much, so give em’ a break if you find bugs with the alpha release. This is the first alpha release PV3D has had and we’re hoping the community rallies around it and helps to test and improve the code base.

What’s new? Glad you asked.

  • Shaders,shaded materials
  • phong, flat, cell, gouraud shading
  • bumpmaping
  • Viewport3D
  • BasicRenderEngine
  • Adoption of ASCollada with DAE object
  • MD2 support
  • Frustrum Camera
  • re-write of render loop – now there’s render lists centeralized in the RenderEngine
  • refactored and greatly improved InteractiveSceneManager(ISM) – much faster

upgrading current projects:

If you’re going to try 2.0 with your latest project, you need to be aware of a couple of things:

1. Setting up the initial scene is different – in a good way :) You no longer create a sprite container to pass to Scene3D, nor do you pass a boolean value for interactivity to Scene3D. Viewport3D extends Sprite, and includes the ability to do:

  • auto resizing/centering
  • interactivity
  • autoClipping
  • autoCulling

[as]var viewport:Viewport3D = new Viewport3D(0, 0, true, false);
addChild(viewport);

var renderer:BasicRenderEngine = new BasicRenderEngine();

var scene:Scene3D = new Scene3D();
var camera:FreeCamera3D = new FreeCamera3D();[/as]

Then, when you want to render:

[as]renderer.renderScene(scene, camera, viewport);[/as]

The new Viewport3D really opens up the doors to do cool things like BitmapViewportMaterial – think of using a camera’s view as a material ;)

[as]public function Viewport3D(viewportWidth:Number = 640, viewportHeight:Number = 480, autoScaleToStage:Boolean = false, interactive:Boolean = false, autoClipping:Boolean = true, autoCulling:Boolean = true)[/as]

2. The engine’s been refactored a bit and so you’ll have to go through and update your imports. Most notably, Objects have moved.

3. No more precision materials. Now all materials have a “precise” boolean. Just set it to true if you need precision.

[as]metalicBoxMaterial = new BitmapMaterial(boxTextureBitmap.bitmapData);
metalicBoxMaterial.precise = true;[/as]

Using shaders
[as]// create your light
var pointLight:PointLight3D = new PointLight3D();
pointLight.moveUp(350);
pointLight.moveRight(350);

// create your materials
var earthMaterial:MovieAssetMaterial = new MovieAssetMaterial(“earthMap”);
var earthBumpMaterial:MovieAssetMaterial = new MovieAssetMaterial(“earthMapBump2″);
// create shader
var earthShader:PhongShader = new PhongShader(pointLight, 0xFFFFFF,0×303030,20, earthBumpMaterial.bitmap, earthMaterial.bitmap);
// combine shader with original material, for a shaded material
var earthShadedMaterial:ShadedMaterial = new ShadedMaterial(earthMaterial, earthShader);
// add to sphere
var earth:Sphere = new Sphere(earthShadedMaterial, 250, 12, 12);

scene.addChild(earth);[/as]

I hope this helps the learning curve for 2.0! I’ll try and get the benchmark for 2.0 out there, but initially, an older revision of it was 23% faster than 1.9 Phunky!