Author Topic: draw text in jpct-vuforia  (Read 2661 times)

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
draw text in jpct-vuforia
« on: April 07, 2015, 11:54:35 am »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: draw text in jpct-vuforia
« Reply #1 on: April 07, 2015, 01:16:53 pm »
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.

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
Re: draw text in jpct-vuforia
« Reply #2 on: April 07, 2015, 05:29:35 pm »
could you please send me that link?
because i search and did't find it.
thanks

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: draw text in jpct-vuforia
« Reply #3 on: April 08, 2015, 12:02:34 pm »
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.

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
Re: draw text in jpct-vuforia
« Reply #4 on: April 09, 2015, 06:52:41 am »