draw text in jpct-vuforia

Started by nima.sh23, April 07, 2015, 11:54:35 AM

Previous topic - Next topic

nima.sh23

Hi
I use of jpct for draw 3D model,2D model and text,I can complete 2D and 3D but in the draw a text i have a problem:
I use of this Link for tutorial
https://primalpond.wordpress.com/2013/02/26/rendering-text-in-opengl-2-0-es-on-android/
and this link for download project:
https://github.com/d3kod/Texample2
i set text in camera but i want when vuforia detect marker draw text,i don't know how can i calc matrix 4*4.

       GLES20.glEnable(GLES20.GL_BLEND);
      GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ONE_MINUS_SRC_ALPHA);

      Matrix.multiplyMM(mVPMatrix, 0, mProjMatrix, 0, mVMatrix, 0);
      
      mVMatrix=modelViewMat;
         
      glText = new GLText(mActivity.getAssets());
      
      glText.load( "Roboto-Regular.ttf", 14, 2, 2 );
      
      // TEST: render the entire font texture
      glText.drawTexture( width/2, height/2, mVMatrix);            // Draw the Entire Texture
      
      glText.begin( 0.0f, 0.0f, 1.0f, 1.0f, mVMatrix );         // Begin Text Rendering (Set Color BLUE)
      glText.draw( "More Lines...", 50, 200 );        // Draw Test String
      glText.draw( "The End.", 50, 200 + glText.getCharHeight(), 180);  // Draw Test String
      glText.end();


"Matrix.multiplyMM()" Multiplies two 4x4 matrices together and stores the result in a third 4x4 matrix.
help me please

EgonOlsen

You are not supposed to mix direct calls to GL with jPCT-AE unless you absolutely have to. In this case, you actually don'thave to. There should be a link to the GLFont class in a sticky topic here in the forum.

nima.sh23

could you please send me that link?
because i search and did't find it.
thanks

EgonOlsen

It's right on the first page of the jPCT-AE as a sticky topic. I can't post the link, because i'm on mobile only ATM and this gprum sucks on mobile when it comes to inserting links.