viromedia / virocore

ViroCore cross-platform AR/VR renderer
MIT License
370 stars 108 forks source link

Could virocore combine with Vuforia or EasyAR? #245

Open ZhengzhongSun opened 5 years ago

ZhengzhongSun commented 5 years ago

Environment

Please provide the following information about your environment:

  1. OS: Mac
  2. Version: ViroCore1.12.0
  3. Device(s): What device(s) are you are seeing the issue on (i.e. Samsung Note 8, Pixel 2 XL, etc)

Description

I found virocore can support AR with ARCore. Could it possible combine with other AR SDK such as Vuforia and EasyAR? How to do it? Thanks!

dam00n commented 5 years ago

We don't support Vuforia or EasyAR. We can add it to our backlog. Is there a particular feature offered by those services that you are interested in that ARCore does not offer?

dthian commented 5 years ago

Thanks @ZhengzhongSun, also in addition to the comment above, you can actually grab camera frames directly from the ViroCore through it's API.

As such, if Vuforia and EasyAR just needs a camera feed, then theoretically you should be able to get it working in conjunction with ViroCore.

Note that however that Google's ARCore coordinate system vs Vuforia's coordinate system may be different when localizing positional data in AR.

ZhengzhongSun commented 5 years ago

We don't support Vuforia or EasyAR. We can add it to our backlog. Is there a particular feature offered by those services that you are interested in that ARCore does not offer?

Then main problem is that ARCore only support specific phones, I want to make a AR app for more android phones.

ZhengzhongSun commented 5 years ago

Thanks @ZhengzhongSun, also in addition to the comment above, you can actually grab camera frames directly from the ViroCore through it's API.

As such, if Vuforia and EasyAR just needs a camera feed, then theoretically you should be able to get it working in conjunction with ViroCore.

Note that however that Google's ARCore coordinate system vs Vuforia's coordinate system may be different when localizing positional data in AR.

Could I modify the ViroViewScene to another which can support the Vuforia or EasyAR, such as your ViroViewARCore. Your sdk is not open source, so actually I'm not sure how to do it.

dthian commented 5 years ago

Then main problem is that ARCore only support specific phones, I want to make a AR app for more android phones.

Ah i see. To re-iterate @dam00n's comment - we don't officially support Vuforia or EasyAR.

Having said that, you may be able to hack around this by having an Android layout that contains both the ViroViewScene (this is simply a Framelayout with GLTextureView and thus could be laid out top of other Android Views), and then underneath that 3D ViroViewScene, you can place your actual camera view that is used by Vuforia / whatever AR sdk. The android view layout in your activity visually would be:

//User looks from this direction top down
<FrameLayout>
<ViroViewScene with 3D Components> 
<Android's Camera Surface fed by Vuforia> 
</FrameLayout>

Thus, with the above, I was considering the situation where: 1) Android renders the camera feed onto the camera surface under our 3D ViroViewScene. 2) Vuforia is initialized, provides camera + marker 3D positional data to your activity. 3) ViroViewScene is initialized on top of the camera feed. 4) You use Vuforia's 3D positional data to move Viro's camera, 3d elements, etc.

If that works above, this can all effectively be wrapped up in a custom android control - for example, a ViroViewVuforiaScene.

Again this is all experimental, not officially supported, and may / may not work.

If you do decide to continue experimenting, do let me know how it goes - I'm definitely interested to hear your findings. :)

lezan commented 5 years ago

Hello @dthian I am trying to do something like that when I found this post. I can not use ARCore and so I am using an alternative SDK for AR, but I need to augmented 3d object and so I am here trying how to figure out some issue with ViroCore.

  1. What kind a view do you suggest to use to achieve that? I am using something like that as layout

    
    <?xml version="1.0" encoding="utf-8"?>
    <FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/activity_research"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    
    <com.viro.core.ViroViewScene
        android:id="@+id/research_surface_viroviewscene"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
    </com.viro.core.ViroViewScene>
    
    <android.opengl.GLSurfaceView
        android:id="@+id/research_gl_surface_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>


2. How can I use this layout with ViroCore? Normaly - with ViroCore - I do something like that

```Java
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);

    m_viroViewScene = new ViroViewScene(this, startupListener);
    setContentView(m_viroViewScene);
}

but this time I need a different layout (the previous one) for our activity.

  1. How can I feed camera view into GLSurfaceView? Can I use CameraImageListener to achieve that? Can I use it with a ViroViewScene or I need an ArCoreView?

Thanks in advance for your answer.