Start a new topic

Camera background and draw model 3D without recognizing image


i have 2 problems.

1. How can i draw model 3D and snap to screen without recognizing image? 

For example start from this code:

2. How can i add background for my camera and my model 3D is in front of background. When i used CSS, model 3D was always behind background (attach).
I tried to use CSS properties z-index but it doesn't work

i use Android Javascript API


Good morning,

the answer to both of your questions is plugins.

The only way to draw a model without making use of the tracking algorithms is a concept we call positionables. You can find the corresponding documentation here. Essentially, an AR.Positionable in JavaScript takes the place of the trackable class, but has its transformation set from within the C++ plugin. This allows implementing custom custom tracking algorithms for the JavaScript API, or, in your case, simple positioning.

Drawing in-between the camera feed and the augmentations can only be done from within a plugin as well. The HTML/CSS content is displayed by an Android WebView, which always sits on top of the camera feed and the augmentations. Instead, you will need to override the Plugin's startRendering method, which will be called after the camera frame has been drawn, but before the augmentations have been drawn. Note that this requires you to do any rendering in OpenGL, not HTML/CSS. Documentation on the plugins can be found here.

May I ask what you use case is exactly? It strikes me as odd, that you would render a 3D model to a fixed position on the screen without any tracking involved.

- Daniel

Thanks Daniel. I try to do it with your advices.

One part of app is showing a product details where you can see this product in model 3D. It is necessary in situation when you don't have target to recognize or you drop your target, but you still want to see product in model 3D.

Login or Signup to post a comment