-2

我需要做一个简单的应用程序来渲染 3d 字体到图像。推荐的库是 FTGL,我如何将它与 3dQt 结合使用?

4

2 回答 2

5

OpenGL 不关心您使用的是 Qt、glut、SDL 还是其他任何东西。因此,找一个Qt的OpenGL示例,然后找一个使用FTGL库的示例,从Qt OpenGL示例开始,将两者结合起来,添加初始化FTGL库的代码并尝试渲染一些文本。

PS不幸的是,我没有这样的例子,但它应该是直截了当的。

于 2011-05-22T12:18:27.343 回答
0

OpenGL does care whether you are using Qt, because OpenGL now is a giant state machine, behavior dependent on how context was initialized - Qt obscures it by their objects behavior, because it uses OpenGL for rendering UI. So far I was unable to find any example of use, andy attempt to port glut example (from ftgl itself) to Qt didn't yield font rendering. I suspect that Qt interferes with freetype use (which is used both in QT and in ftgl). Cons from using Qt's rendering subroutine for text: 1) it renders in 2d coords of widget, not in MVP coords 2) it pushes and resets projection and transform matrices with every call of that subroutine, and it uses OpenGl 1.3 calls

于 2014-07-17T03:53:05.753 回答