c++ - How to render 3D Text in OpenGL? -


i want draw 3d text in opengl viewport.
have applied following method shows text @ 2d positions.

void renderbitmapstring(float x, float y, float z,void *font,const char *string){     const char * c;       //glrasterpos2f(x, y);      // glutbitmapcharacter(font, string);      glrasterpos3f(x, y ,z);      //glrasterpos3i(x, y ,z);      (c=string; *c != '\0'; c++) {          glutbitmapcharacter(font, *c);      }     } 

opengl not render text. not part of standard. render textures or bitmap images. way render text sure sort of 2d rendering library cairo. should create bitmap text in it. once have bitmap, can render bitmap texture. careful though, cairo uses bgra format bitmaps might need swizzle red , blue components things working.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -