Showing posts with label papervision3d. Show all posts
Showing posts with label papervision3d. Show all posts
Saturday, April 15, 2017
Papervision3D GreatWhite DAE Animation
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 PV3Ds 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 dont
try this one, noobs warning!
Demo
- its look old but its new http://sleepydesign.com/labs/as3/PaperVision3D/GreatWhite/DAEAnimation/
- MD2 its left and right, DAE in middle, all in one to prove it work fine together
- try click on left/right plane to change animation (full loop/half loop)
- dont expect cleaner version
- learn to integrate MD2 mod -> DAE mod
- early use of DAE Animation
- money? sigh....i just got 0.01$ from google ads from my own click ... opps! sorry google just test :P
- last know good PaperVision3D rev 421
- AS Class in old MD2 guide : Papervision3D GreatWhite : MD2 Animation
- your animated DAE (thats must auto play fine in original package)
- Some mod/add below
1. add 2 SleepyController this in orgpapervision3dobjectsparsersDAE.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 orgpapervision3dcoreanimationcontrollersSimpleController.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? lets 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?
- if you not mod addict or really need early use of DAE animation plz skip this ;)
- dig something else and wait for official release
- sigh.... ;P
Go to link Download
Labels:
animation,
dae,
greatwhite,
papervision3d
Sunday, October 16, 2016
Papervision3D GreatWhite MD2 Animation
Papervision3D GreatWhite MD2 Animation
Happy new year! Lets start with some dirty/early coding, lol
Demo
- dirty one (internal use) : http://sleepydesign.com/labs/as3/PaperVision3D/GreatWhite/MD2Animation/
- try click on left/right plane to change animation (sit/stand)
- good/clean demo later (really later)
What for?
- Holy guide to take control MD2 animation.
- happy new year (eh?)
- PaperVision3D 2.0 GreatWhite rev 391
- modded : AbstractController.as
- modded : KeyFrameController.as
- merge modded/original package (1+2+3)
- add MorphController to MD2
- call "gotoAndLoop" function with begin/end frame parameters
- got error(s) and shutdown without save (kidding :P)
- compare modded class with svn, see the diff
- call function like this
var ctrl = AnimationEngine.getControllers(md2)[0] as MorphController;
ctrl.gotoAndLoop(18, 31);
Wheres to go next?
- home?
- bed?
- :P
Go to link Download
Labels:
animation,
greatwhite,
md2,
papervision3d
Thursday, September 29, 2016
Papervision3D GreatWhite Animated Particles
Papervision3D GreatWhite Animated Particles
What for?
- learn to modify more complicate package
- x-mas fun/gift ;D
Required?
- PaperVision3D 2.0 GreatWhite rev 385
- John Grden Shader demo : http://www.rockonflash.com/blog/?p=92
- 2 brains
- i dont want to mess up original "Particle" , so just clone "all" packages that related to "Particle "
- hange "Particle" to "Clip" packages
- merge MovieMaterial to ClipMaterial then i got "MovieClipMaterial" (huh?)
- add "size" to "ParticleField" (call ClipField for now)
MovieClipMaterial.as
after finish doing this, i found this thing useless in "snow" case lol,
package org.papervision3d.materials.special
{
import flash.display.BitmapData;
import flash.display.DisplayObject;
import flash.display.Graphics;
import flash.geom.Matrix;
import org.papervision3d.materials.MovieMaterial;
import org.papervision3d.core.geom.renderables.Clip;
import org.papervision3d.core.render.data.RenderSessionData;
import org.papervision3d.core.render.draw.IClipDrawer;
public class MovieClipMaterial extends ClipMaterial implements IClipDrawer
{
private var scaleMatrix : Matrix;
private var movie : DisplayObject;
private var movieMaterial : MovieMaterial;
public function MovieClipMaterial( movieAsset_DisplayObject=null, transparent_Boolean=false, animated_Boolean=false )
{
super(0, 0);
this.movie = movieAsset;
this.movieMaterial = new MovieMaterial( movie, transparent, animated );
this.bitmap = movieMaterial.bitmap;
this.scaleMatrix = new Matrix();
}
override public function drawClip(clip:Clip, graphics:Graphics, renderSessionData:RenderSessionData):void
{
this.bitmap = movieMaterial.bitmap;
scaleMatrix.a = clip.renderScale;
scaleMatrix.d = clip.renderScale;
scaleMatrix.tx = clip.vertex3D.vertex3DInstance.x;
scaleMatrix.ty = clip.vertex3D.vertex3DInstance.y;
graphics.beginBitmapFill(this.bitmap, scaleMatrix, false, smooth);
graphics.drawRect(clip.vertex3D.vertex3DInstance.x, clip.vertex3D.vertex3DInstance.y,clip.renderScale*this.bitmap.width,clip.renderScale*this.bitmap.height);
graphics.endFill();
renderSessionData.renderStatistics.particles++;
}
}
}
maybe its better to use 2d particles for "Environment effect" like rain, snow or wot ever
full source code ll be release later (actually nothing just rename) its too dirty for now
and need to clean/add method for another case (more useful lol)
happy coding!
Go to link Download
Labels:
animated,
greatwhite,
papervision3d,
particles
Subscribe to:
Posts (Atom)