Monday, February 11, 2008

Papervision3D GreatWhite : DAE Animation

Happy Chinese New Year, look like i always come up when new year eh? :P

actually i already post this to PV3D's mail archieve for a month
also PV3D team said that "soon" to release woking version
so i decide to leave my dae mod in trash, but many one keep asking me
for a guide, so...this is a quick/mod guide!
anyway if you not understand my MD2 last post yet, plz don't
try this one, noobs warning!




Demo
  1. it's look old but it's new http://sleepydesign.com/labs/as3/PaperVision3D/GreatWhite/DAEAnimation/
  2. MD2 it's left and right, DAE in middle, all in one to prove it work fine together
  3. try click on left/right plane to change animation (full loop/half loop)
  4. don't expect cleaner version
What for?
  1. learn to integrate MD2 mod -> DAE mod
  2. early use of DAE Animation
  3. money? sigh....i just got 0.01$ from google ads from my own click ... opps! sorry google just test :P
Required?
  1. last know good PaperVision3D rev 421
  2. AS Class in old MD2 guide : Papervision3D GreatWhite : MD2 Animation
  3. your animated DAE (that's must auto play fine in original package)
  4. Some mod/add below
How to?

1. add 2 SleepyController this in org\papervision3d\objects\parsers\DAE.as

//public lazy hack
public var SleepyController1
public var SleepyController2
private function buildAnimationController( joint:Node3D, keys:Array,
matrices:Array ):void
{
var mats:Array = new Array(matrices.length);
var ctl:SimpleController = new SimpleController(joint,
SimpleController.TRANSFORM);
if(!SleepyController1){
SleepyController1 = ctl
}else {
SleepyController2 = ctl
}

2. line #100 at \org\papervision3d\core\animation\controllers\SimpleController.as to fix weird animation (just over frame)

var endFrame:AnimationFrame = this.frames[ currentFrame ];
//proof it work
trace(firstFrame,currentFrame,nextFrame,lastFrame)

3. add controller after "controller complete" not just model complete in your "main.as"

dae.SleepyController1.gotoAndLoop(10, 20)
dae.SleepyController2.gotoAndLoop(10, 20)


4. mix up with MD2? let's see

if(mouse3D.x>0){
ctrl.gotoAndLoop(0, 16)
dae.SleepyController1.gotoAndLoop(10, 20)
dae.SleepyController2.gotoAndLoop(10, 20)
md2.setMaterial(new BitmapFileMaterial("pg.png"));
}else {
ctrl.gotoAndLoop(18, 31)
dae.SleepyController1.gotoAndLoop(0, 40)
dae.SleepyController2.gotoAndLoop(0, 40)
md2.setMaterial(new BitmapFileMaterial("pg_angry.png"));
}


Next?


  1. if you not mod addict or really need early use of DAE animation plz skip this ;)
  2. dig something else and wait for official release
  3. sigh.... ;P

5 comments:

cccccnews said...

Hi,may i have the sources of the above flash? Since I tried hard but can't figure out how to make it work. Thanx a lot. chikiuso@gmail.com

katopz said...

my sample already out of date, plz do try follow this thread instead

http://osflash.org/pipermail/papervision3d_osflash.org/2008-May/021662.html

hth :D

cccccnews said...

Thanx a lot, I just tried following the thread at osflash, but it doesn't seem to be good for a beginner at all ... without the whole picture ...

Anonymous said...

I have a class to control DAE animations, i'm working in the final version but there is the current version available to download.

look here: http://pablobandin.wordpress.com/2008/12/06/control-dae-animation/

Alessandro Previti said...

Hi! Where exactly in the DAE.as is the code suppose to be placed?
I receive lot of errors from my flashbuilder...