Samsung / GearVRf

The GearVR framework(GearVRf) is an Open Source VR rendering library for application development on VR-supported Android devices.
http://www.gearvrf.org
Apache License 2.0
407 stars 217 forks source link

SceneObject not visible with GVSphereSceneObject #2021

Closed adiliqbl closed 5 years ago

adiliqbl commented 5 years ago

I am trying to show a SceneObject on GVRSphereSceneObject. But, only the GVRSphereSceneObject is showing where as scene object hides once the texture image becomes visible. If I add both sphere and object using addSceneObject, then image is shown on one side and rest of view is black.

I have tried rendering order but it doesn't seem to fix this issue.

  GVRMaterial material = new GVRMaterial(gvrContext);
material.setMainTexture(gvrContext.loadFutureTexture(new GVRAndroidResource(gvrContext, R.raw.pano)););

GVRSphereSceneObject sphereObject = new GVRSphereSceneObject(gvrContext, 18, 36, false, material);

Pointer = new GVRSceneObject(gvrContext,
            new FutureWrapper<>(gvrContext.createQuad(0.05f, 0.05f)),
            gvrContext.loadFutureTexture(new GVRAndroidResource(this.gvrContext, R.drawable.pointer)));
Pointer.getRenderData().getMaterial().setColor(Colors.RED[0], Colors.RED[1], Colors.RED[2]);

Pointer.getTransform().setPosition(0.0f, 0.0f, -1.0f);
Pointer.setName("Pointer");
sphereObject.addChildObject(Pointer);
scene.addSceneObject(boom);
liaxim commented 5 years ago

Try this:

        Pointer.getRenderData().setDepthTest(false);
        Pointer.getRenderData().setRenderingOrder(SXRRenderData.SXRRenderingOrder.OVERLAY);
liaxim commented 5 years ago

You might also find this useful: http://www.gearvrf.org/tutorials/play_with_controller/

adiliqbl commented 5 years ago

Thanks. It worked.