JPCT-ae + GoogleTango = Occlusion/Stencil

Started by ares91x, August 26, 2017, 11:48:45 AM

Previous topic - Next topic

ares91x

Hi everyone,
Im using Google Tango for a project and Im trying to find a way to hide(partialy or totaly) virtual object that are behind a real object.
I found this project http://www.modeso.ch/blog-posts/augmented-reality-using-tango-occlusion.html but this is in OpenGl and in C (I dont know both of them) and I was wondering if exists a similar way to implement that in JPCT-ae or something similar for example creating a stencil with the point coming from depth perception sensor of GoogleTango and than applying the stencil to the view in order to cover(not render) part of 3D object. So in few words how to create a stencil given some points (point coordinates are in 3D) and apply it to an view?

EgonOlsen

You could create an Object3D based on your points, render it, clear the color buffer only (FrameBuffer.clearColorBufferOnly()) and render the scene. That will "hide" everything behind your (now no longer visible) object...if that's what you actually mean...

ares91x

mmm yes this could work

Exists a way do create stencil in jpct?

EgonOlsen

A stencil buffer? No, there's no support for this.