Archive for February 2008

Considerations in Collision Detection with PV3D

February 28, 2008
col.png
use left and right arrows.

The collision detection in Papervision3D is not a big deal. Is easy to detect collision between two DisplayObject3D for that task PV3D provide us with two methods

public function hitTestPoint( x:Number, y:Number, z:Number ):Boolean

public function hitTestObject( obj:DisplayObject3D,multiplier:Number=1 ):Boolean

The first method is to test if the current DisplayObject3D is hitting a point in the scene and the second one is to detect if the current object is hitting another DisplayObject3D in the scene.
This is quite similar to the display architecture used by flash and its DisplayObject the difference is when we have a main DisplayObject3D with other objects 3D as childs.
In that case we would be tempted to use hitTestObject assuming that the collision test will be tested using the parent DisplayObject3D and their childs but that is wrong.
(more…)

Advertisements

Particle System for Papervision3D

February 22, 2008

A few weeks ago I made some modifications to the Zeus Lab particle system for Actionscript made by Josh Tynjala . The Josh’s particle system is neat, simple and if you combine the particle system with the use of filter you can obtain beautiful visual effects. I wanted to continue using it while experimenting with Papervision, the only problem is that it is 2D, so I made the port of the particle system to make it usable in a 3D environment, the result was some kind of distribution of the particle system because I didn’t touch the 2D code I only extended to be usable with the display architecture and classes in PV3D.

In the following example I will explain how to use it combined with the Effects branch to obtain something like this:

particle.png

(more…)

Bump mapping in flash

February 18, 2008

I’ve been playing around lately with Papervision3D 2.0 which still in alpha yet. But this new version has a lot of new cool features one of the new features are shaders. So make things look like this:

mars2.png

(more…)

Seven tips about performance optimization in Actionscript 3

February 15, 2008

This post is a list of tips and tricks for tunning performance in Actionscript 3. Keep in mind the following quote while reading this:

“Premature Optimization is the root of all evil.” – Hoare and Knuth
(more…)