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
Post a Comment