FGAR 0.2 released

7 views
Skip to first unread message

bl...@flaminggranny.com

unread,
May 27, 2009, 5:14:45 PM5/27/09
to FLARToolKit userz
Hi All,

I just released FGAR 0.2, which now has Matrix3D result smoothing, via
an instantiated FGARGeometry class. You can check out a sample app
and get the source here:

http://www.flaminggranny.com/blog/2009/05/fgar-02.html

- Blake

holde

unread,
May 28, 2009, 8:48:43 AM5/28/09
to FLARToolKit userz
Hi Blake, great work!

I don´t know if I need to have smoothing, but anyway, I want to use
your components to use FLARToolKit with Away3D. To do the tranform I
changed some code, but the it doesn´t work
Her is the code from SceneHolder.mxml:

....
private function updateMatrix3D():void
{
if(markers[currentMarker])
{
//var tempMatrix3D:org.papervision3d.core.math.Matrix3D =
FGARGeometry.getPapervisionMatrix(markers[currentMarker].matrix);
fBaseNode.setTransformMatrix(markers[currentMarker].matrix);
trace(markers[currentMarker]);
}
}
......

I thought that I get the FLARTransMatResult from markers
[currentMarker].matrix, but when I trace it to see the output I get
the value of the Matrix instead of hte object type.

On 27 Mai, 23:14, "bl...@flaminggranny.com" <bl...@flaminggranny.com>
wrote:

bl...@flaminggranny.com

unread,
May 28, 2009, 12:29:06 PM5/28/09
to FLARToolKit userz
Hi Holde,

Yes, the matrix object of a FGARMarker is a FLARTransMatResult. When
traced, you'll get the toString() function of the object, so I think
that's what you're seeing. I'm not familiar with doing AR in Away3D,
so unfortunately, I'm not sure why the matrix isn't working for you.

- Blake

holde

unread,
May 28, 2009, 2:29:15 PM5/28/09
to FLARToolKit userz
I´ve got an example app source from Rob Bateman, which look like this:
....
....
private var fBaseNode:FLARBaseNode;
private var fDetector:FLARSingleMarkerDetector;
private var fResult:FLARTransMatResult;
....
....
private function onEnterFrame(event:Event):void
{
fCapture.bitmapData.draw(fVideo);

if (update) {
try {
//check for marker
if (fDetector.detectMarkerLite(fRaster, threshold) &&
fDetector.getConfidence() > 0.5) {
view.visible = true;
fDetector.getTransformMatrix(fResult);
fBaseNode.setTransformMatrix(fResult);
trace(fResult);
} else {
view.visible = true;
}
} catch (e:Error) {
trace("Error: " + e.message);
}

view.render();

} else {
fCapture.bitmapData.applyFilter(fCapture.bitmapData,
fCapture.bitmapData.rect, fCapture.bitmapData.rect.topLeft,
blurFilter);
}
}
.....
.....

So, I tried to use fBaseNode which contains all 3D models and the
markers[currentMarker].matrix to tranform the model. I thought that
markers[currentMarker].matrix would give me the FLARTransMatResult,
but it isn´t.


On 28 Mai, 18:29, "bl...@flaminggranny.com" <bl...@flaminggranny.com>
wrote:

bl...@flaminggranny.com

unread,
May 28, 2009, 3:56:26 PM5/28/09
to FLARToolKit userz
Hi Holde,

The matrix object is a FLARTransMatResult. Here's part of the source
of FGARMarker.mxml:

public var matrix:FLARTransMatResult;
.
.
.
public function copyMarker(markerToCopy:FGARMarker):void
{
index = markerToCopy.index;
matrix = markerToCopy.matrix;
centerpoint = markerToCopy.centerpoint;
}

And line 192 of FGAR.mxml:

closestMarker.copyMarker(detectedMarker);

So you can see that the detectedMarker matrix is being copied to
closestMarker, and the matrix object, from the FGARMarker source, is a
FLARTransMatResult. FLARTransMatResult is an extension of
FLARDoubleMatrix34, which is simply a 3D matrix variable holding
class. These matrix variables are what is being outputted when you
trace the result; the actual values of the FLARTransMatResult.

I would look at what is happening in your code after the matrix
result, because markers[currentMarker].matrix is FLARTransMatResult
object.

- Blake

holde

unread,
May 28, 2009, 7:22:18 PM5/28/09
to FLARToolKit userz
I think I almost understood already how your components work. The
difference between the outputted traces of trace(fResult) and trace
(markers[currentMarker]) is that the first trace outputs an object and
it´s type and the second one outputs the actual values (toString()),
like you described. How to get only the object FLARTransMatResult? Or
someone else has an idea to make away3d work with FGAR?

Good night, have to sleep

On 28 Mai, 21:56, "bl...@flaminggranny.com" <bl...@flaminggranny.com>

bl...@flaminggranny.com

unread,
May 29, 2009, 1:59:46 AM5/29/09
to FLARToolKit userz
Okay, this is the last time I'm going to say this (no offense). THE
MARKER OBJECT OF A FGARMarker IS A FLARTransMatResult! If it's not
working with Away3D, it's because of how you're converting the
FLARTransMatResult, markers[currentMarker].marker, not the result
itself.

- Blake

Makc

unread,
May 29, 2009, 4:56:05 AM5/29/09
to flartool...@googlegroups.com
yeah I hear you but how do you explain those trace outputs?

holde

unread,
May 29, 2009, 6:38:18 AM5/29/09
to FLARToolKit userz
Maybe I am not good enough in flex and AS3 and my english isn´t very
well to understand everthing. I can see in the trace that I get the
MatrixResult values, but how could I use those values to make the
transform. I´m sorry for bothering you so much, but I am an absolutly
beginner.

holde

unread,
May 29, 2009, 10:00:40 AM5/29/09
to FLARToolKit userz
Here is the output of trace(markers[currentMarker].matrix);
---------------
[org.libspark.flartoolkit.core.transmat::FLARTransMatResult
-0.873, -0.22, 0.433, 18.015,
-0.292, 0.95, -0.104, 19.797,
-0.389, -0.217, -0.895, 243.705
]
---------------

bl...@flaminggranny.com

unread,
May 29, 2009, 12:33:29 PM5/29/09
to FLARToolKit userz
Makc,

[org.libspark.flartoolkit.core.transmat::FLARTransMatResult
> -0.873, -0.22, 0.433, 18.015,
> -0.292, 0.95, -0.104, 19.797,
> -0.389, -0.217, -0.895, 243.705
> ]

FLARTransMatResult is part of FLARToolkit, not FGAR, so honestly, I
don't know exactly why it outputs the values with it, but you can see
by Holde's output above that it's a genuine 3D matrix.


Holde,

Here's a link that might help you. http://www.gamedev.net/reference/articles/article695.asp

- Blake

Makc

unread,
May 29, 2009, 12:46:57 PM5/29/09
to flartool...@googlegroups.com
On Fri, May 29, 2009 at 7:33 PM, bl...@flaminggranny.com
<bl...@flaminggranny.com> wrote:
> FLARTransMatResult is part of FLARToolkit, not FGAR, so honestly, I
> don't know exactly why it outputs the values with it, but you can see
> by Holde's output above that it's a genuine 3D matrix.
>

ay man relax, I was just pulling your leg there, but probably in a
little non-transparent manner

bl...@flaminggranny.com

unread,
May 29, 2009, 5:57:24 PM5/29/09
to FLARToolKit userz
Sorry Makc, I've explained the marker object so many times in the last
24 hours that I'm hypersensitive about it. :)
Reply all
Reply to author
Forward
0 new messages