DAE Animation starts without marker

12 views
Skip to first unread message

SDaniel

unread,
Oct 28, 2009, 1:39:18 AM10/28/09
to FLARToolKit userz
Hi group!

Well, just like the subject, if I accept the camera just when appears,
everything fine. But, if I accept 5 seconds later, I will see the
animation 5 seconds advanced.

My code is pretty simple:

public class InkFrame extends PV3DARApp
{
private var view:BasicView;
private var matList:MaterialsList;
private var dae:DAE;

public function InkFrame()
{
this.init('data/camera_para.dat', 'data/marker.pat');
}
protected override function onInit():void
{
super.onInit();
this.dae = new DAE(true, "dae", false);
this.dae.load("data/sombrilla.dae");
this.dae.z = 90;
this.dae.rotationX = -90;
this._baseNode.addChild(this.dae);
}
}

I was trying with the example of Collada Animation in FLARManager but
I get the same problem.

Any help will be appreciated.

Thank you.

malpeli

unread,
Oct 28, 2009, 3:37:40 AM10/28/09
to FLARToolKit userz
hy daniel!

If i remember ... onInit run when the the program start... try to
define the model when the marker was added...


i think if you use ezflar he gonna handle that for you, he started the
animation from beggining every time the marker was found:

import com.tchatcho.EZflar;
import com.transmote.flar.FLARMarkerEvent;
private var _ezflar:EZflar;
private var _symbols:Array = new Array();
//put dae in models folder, pat in resources (with the others)
_symbols.push([[“marker.pat”, “sombrilla.dae”]]);
_ezflar = new EZflar( _symbols );
_ezflar.mirror();
_ezflar.initializer(stage);

_ezflar.onAdded(function(marker:FLARMarkerEvent):void {
_ezflar.getObject(0).rotationX = -90;
_ezflar.getObject(0).z = 90;
});

i hope you enjoy!!

[]s

Tcha=Tcho

SDaniel

unread,
Oct 28, 2009, 1:16:58 PM10/28/09
to flartool...@googlegroups.com
Thank you malpeli!
Now works, just one thing, I don't know why with rotationX the object don't rotate :S
--
- ZФiX -
Sergio Daniel Fernández González
www.inkframe.com
www.neuronafugitiva.com

eric socolofsky

unread,
Oct 28, 2009, 8:51:54 PM10/28/09
to flartool...@googlegroups.com
probably because you're applying the transformation matrix and it's overwriting your rotationX.  try putting your DAE inside a container, rotate the DAE, and apply the transmat to the container.

-e

SDaniel

unread,
Oct 29, 2009, 1:30:18 AM10/29/09
to flartool...@googlegroups.com
Eric, thank you for your answer, before I read, I added in DAEconstructor.as, the line to rotate the DAE, another solution :)

Eric and Malpeli, thank you.

Shachar Oz

unread,
Dec 16, 2009, 12:39:06 AM12/16/09
to FLARToolKit userz
what you did is exactly what eric suggested, actually.


On Oct 29, 7:30 am, SDaniel <xsdan...@gmail.com> wrote:
> Eric, thank you for your answer, before I read, I added in
> DAEconstructor.as, the line to rotate the DAE, another solution :)
>
> Eric and Malpeli, thank you.
>
>
>
>
>
> On Wed, Oct 28, 2009 at 7:51 PM, eric socolofsky <e...@transmote.com> wrote:
> > probably because you're applying the transformation matrix and it's
> > overwriting your rotationX.  try putting your DAE inside a container, rotate
> > the DAE, and apply the transmat to the container.
>
> > -e
>
> > On Wed, Oct 28, 2009 at 10:16 AM, SDaniel <xsdan...@gmail.com> wrote:
>
> >> Thank you malpeli!
> >> Now works, just one thing, I don't know why with rotationX the object
> >> don't rotate :S
>
Reply all
Reply to author
Forward
0 new messages