Start a new topic

Render image on a plane

Hello,

I am using the plane detection feature of the SDK to detect vertical walls. I want to render an image from my phone onto that rectangle which appears when a wall is detected but i am unable to do so.

Can anyone help me out?


I am using Android SDK


The samples we have are the ones that are already created extending the Renderable class in the native example, like the PlanePolygon I mentioned. In this case, you will need to create your own class extending Renderable and doing your own OpenGLES implementation to draw an image as a texture. The implementation of the OpenGL part is external to our SDK and has to be done by you, but there is a lot of info about it.


Regards,


Aitor.

Hi Aitor,

I understand your point.

How do i create my own Renderable with my selected image so that it can draw? Is there any documentation or a sample

Hi Rahul,


If you take a look at our PlaneDetection documentation (https://www.wikitude.com/external/doc/documentation/latest/androidnative/instanttrackingnative.html#plane-detection-experimental) and our sample app, you can see that when the onPlaneRecognized callback is called, a plane is returned with a type (VERTICAL for walls). There you have to create your own Renderable (same type than the PlanePolygon) with your own OpenGL implementation to draw a selected image. Once the implementation of the Renderable is done you will have to add that renderable in the same way it is done in our sample: glRenderer.setRenderablesForKey("plane-" + plane.getUniqueId(), imageRenderable, null); and you will be able to see the image in the plane that has been recognized.


Regards,


Aitor.

Hi,

I am new to this AR thing.

Can you guide me? I just want to put an image on the plane. Thats it

Hi Rahul,


As it sounds you're working with the Native API. If this is the case you'll need to implement / use your own rendering engine:


The Native API wraps the main functionalities of the Wikitude and enables the full computer vision power in your app. To keep it lean, the  Native API does not integrate a separate rendering engine, but offers you the full flexibility in terms of rendering augmented reality content. Details on feature support and comparison to the JS API can be found here:


https://www.wikitude.com/products/native-and-js-api-comparison/


So if you don't plan to use a specific rendering engine, we recommend to go with the Unity Plugin in your case.


Thx and greetings

Nicola

Hi,

Please find my response inline:

  • Which version of the SDK are you using? - Latest Android SDK 9.1
  • Are you using any of our Extensions (Cordova, Xamarin, Unity)? NO
  • If yes, which version are you using? N/A
  • Please keep in mind that the plane detection feature is currently available in our Native and Unity SDK (professional edition) only.What device does this happen with (model details and OS version)? Samsung A80, Android 10 Version
  • Is this happening with the sample app or in your own app? MY OWN APP
  • If it happens with your own app, does the sample app and the plane detection sample work on your device? YES, Plane detection works. I have not changed anything from the sample app.

My requirement is to show an image, any image from the device on that detected plane

Hi Rahul,


Can you please provide further details:


  • Which version of the SDK are you using?
  • Are you using any of our Extensions (Cordova, Xamarin, Unity)? If yes, which version are you using? Please keep in mind that the plane detection feature is currently available in our Native and Unity SDK (professional edition) only.
  • What device does this happen with (model details and OS version)?
  • Is this happening with the sample app or in your own app? If it happens with your own app, does the sample app and the plane detection sample work on your device?


Thx and greetings

Nicola

Login or Signup to post a comment