Augmented reality using ASFEAT

Software: Away3D 4.x

Samuel Girardin, Member
Posted: 06 November 2011 10:53 PM   Total Posts: 74

Hi ,

I’ve just finish a test using ASFEAT & Away 3D 4. It works very well.

http://www.visualiser.fr/blog/index.php?q=content/away-3d-4-asfeat-in2ar-augmented-reality-fp-11

If someone could solve a projection matrix for a perfect placement (I have to work on other devs and my method looks like a crappy hack), I would be interested in.

Samuel

 

   

Avatar
Fathah Noor, Newbie
Posted: 07 November 2011 05:08 AM   Total Posts: 11   [ # 1 ]

Great! After so much searching and waiting, finally there is example of Away3D 4 - IN2AR that can work. If you do not mind, I am very interested to learn more about the source code, thank you very much~ smile


Anyway, have you tried projection matrix like the one in this link?

 

   

manuelbujes, Newbie
Posted: 07 November 2011 07:39 AM   Total Posts: 10   [ # 2 ]

I am also interested in the source code!! a lot of thankss!!

 

   

T.ale, Newbie
Posted: 07 November 2011 05:22 PM   Total Posts: 1   [ # 3 ]

I would be interested in the code if you can. thank you much

 

   

Samuel Girardin, Member
Posted: 07 November 2011 06:27 PM   Total Posts: 74   [ # 4 ]

tips : no need to display webcam on a 3D plane. I ve just discovered this : away3d.containers.View3D.backgroundImage(value:BitmapData):void.
Best fps with this method.
I love this engine !

For the source, I need to do some change. So be patient.

 

   

Avatar
venom, Newbie
Posted: 07 November 2011 06:33 PM   Total Posts: 26   [ # 5 ]

i have worked with flartoolkit and away3.6 but this is awsome smile what a great success I appreciate smile if you can send me the sourcecode i will be very happy smile thanks a lot already

 

   

Erik, Newbie
Posted: 08 November 2011 12:40 PM   Total Posts: 4   [ # 6 ]

I would be interested in the source code as well, Thanks a lot!!!

 

   

The Aryeh, Newbie
Posted: 09 November 2011 03:28 PM   Total Posts: 3   [ # 7 ]

I’d also love to see the source code for this.  Thanks for offering!

 

   

whoamiwhoareyou, Newbie
Posted: 09 November 2011 03:35 PM   Total Posts: 2   [ # 8 ]

could you share your source code to me, thanks a lot! .(JavaScript must be enabled to view this email address)

 

   

Samuel Girardin, Member
Posted: 09 November 2011 03:41 PM   Total Posts: 74   [ # 9 ]

Hi,

I’m working now on a test with asfeat and awayPhysics. Here is a piece of code to make asfeat matrix compatible with away3D mesh. I started with simple demo.as in asfeat sdk.

protected function onModelDetected(e:ASFEATDetectionEvent):void
  {
   
var refList:Vector.<ASFEATReference> = e.detectedReferences;
   var 
ref:ASFEATReference;
   var 
n:int e.detectedReferencesCount;     
   
   for(var 
i:int 0n; ++i)
   
{
    ref 
refList[i];    
    
    
    var 
m:Matrix3D = new Matrix3D() ; 
    
get3DMatrixLH(ref.rotationMatrix ref.translationVector,false) ; 
    
m.prependRotation(180,Vector3D.Y_AXIS) ; 
    
m.prependRotation(180,Vector3D.Z_AXIS) ; 
    
    
head.transform 
    
   
}
   
  }

public function get3DMatrixLH(R:Vector.<Number>, t:Vector.<Number>, mirror:Boolean false):Matrix3D
  {
   
var data:Vector.<Number> = new Vector.<Number> ;
   
   if (
mirror == false
   
{
    data[0] 
R[0];
    
data[1] = -R[3];
    
data[2] R[6];
    
data[3] 0.0;
    
data[4] R[1];
    
data[5] = -R[4];
    
data[6] R[7];
    
data[7] 0.0;
    
data[8] = -R[2];
    
data[9] R[5];
    
data[10] = -R[8];
    
data[11] 0.0;
    
data[12] t[0];
    
data[13] = -t[1];    
    
data[14] t[2]-600// tZ    
    
data[15] 1.0;
   
}  
   
   
return new Matrix3D(data) ;
  

Still looking for a true projection matrix to apply !

 

 

   

manuelbujes, Newbie
Posted: 10 November 2011 08:16 AM   Total Posts: 10   [ # 10 ]

I cant make view.backgroundImage works!! It’s correct?

myBitmapData.draw(Sprite(_flarManager.flarSource));
view.backgroundImage = myBitmapData;

Thanks!! How do you it?

 

   

Samuel Girardin, Member
Posted: 10 November 2011 01:18 PM   Total Posts: 74   [ # 11 ]

I display the webcam like this (flash player 11.2 only), and I’m at work and don’t have my source there.

protected function ini():void
  {   
   getCam
() ;   
   
stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITYonStageVideoAvailability);   
  
}
  
  
private function getCam(w:int 1024h:int 512fps:int 25):void {
   
   _cambuff 
= new BitmapDatawhtrue0x0 );
   
_cam Camera.getCamera();    
   
_cam.setMode1024512,25true );
   
  
}
  
  
  
private function onStageVideoAvailability(e:StageVideoAvailabilityEvent):void {

stage
.removeEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITYonStageVideoAvailability);   
   
   if ( 
stageVideo == null 
   
{    
    stageVideo 
stage.stageVideos [ 0 ] ;   
    
stageVideo.viewPort = new Rectangle 1024 512 ) ;
   
}
   
   stageVideo
.attachCamera(_cam) ;    
      
stage.addEventListener(Event.ENTER_FRAMErender);
   
  

  
  
  
protected function render(e:Event null):void
  { 
   
// draw video stream to buffer    
   
_cam.drawToBitmapData(_cambuff) ;    
   
_view.backgroundImage _cambuff ;     
   
asfeatLib.detect_cambuff );    
   
view.render() ;    
  

 

   

manuelbujes, Newbie
Posted: 11 November 2011 10:48 AM   Total Posts: 10   [ # 12 ]

My code dont work, i tried your code , flash 11.2 beta crash without debug

i have all working except the webcam capture as background :(


 

   

Erik, Newbie
Posted: 11 November 2011 11:19 AM   Total Posts: 4   [ # 13 ]

I have the exact same thing… But i haven’t found a solution yet!

 

   

Samuel Girardin, Member
Posted: 14 November 2011 11:09 PM   Total Posts: 74   [ # 14 ]

Hi,

I ve uploaded a new test using awayPhysic. There is the source too.

http://www.visualiser.fr/blog/index.php?q=content/away-3d-4-awayphysics-asfeat-ar

And I’m still using in2ar without a projection matrix. If someone solves it ? I would be gratefulll !


Samuel

 

   

Samuel Girardin, Member
Posted: 21 November 2011 06:10 PM   Total Posts: 74   [ # 15 ]

Eugene Zatepyakin updates his in2ar sdk with away3D 4 support.

Samuel

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X