2D elements within Cardboard

edited January 2017 in Android Mode

Hi,

I'm trying to use the Cardboard library for a 2D project. Although this might not be common, I assumed there would be a way to include 2D elements in a Cardboard sketch, such as an info overlay, and things like that. I tried using hint(DISABLE_DEPTH_TEST), which works in other scenarios, but it still prints elements within the 3D space.

Am I missing something or is that not possible? Thanks

Answers

  • Can you provide your code to show your approach of printing 2D elements in 3D space?

    but it still prints elements within the 3D space

    So you don't want to print the extra information?

    Kf

  • Sure. What I want is to print 2D elements in 2D, in the coordinates I specify in relation to the screen, not floating in some 3D point. Here's an example Thanks:

    import processing.cardboard.*;
    
    void setup() {
      fullScreen(PCardboard.STEREO);
     }
    
    void draw() {
      background(0);
      hint(DISABLE_DEPTH_TEST);
      rect(width/4,height/4,(width/4)*3,(height/4)*3);
      hint(ENABLE_DEPTH_TEST);
    }
    
  • kf, like a Head Up Display.

  • Not possible with VR - no fixed monitor

  • i don't see why not. your head may be moving in 3d space but no matter where is is or which way it's looking there's always a position that's, say, 6 inches in front of it and oriented the same way.

  • This is the most interesting question I've seen posted in a while. I'm on Team It's Possible, but for the life of me, I have no idea how.

    Does the Cardboard library manipulate the same transition matrix? If so, a simple pushMatrix(); resetMatrix(); draw_HUD_twice(); popMatrix(); might do it...?

  • Thanks TfGuy44, but it does not look to be working. Nothing draws inside draw_HUD_twice()

Sign In or Register to comment.