添加文本用OpenGL到屏幕 [英] Adding Text to Screen with OpenGL

查看:172
本文介绍了添加文本用OpenGL到屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我工作的一个OpenGL的项目,这里是screenshoot我做什么

Currently, I am working on a OpenGL project and here is the screenshoot what I did

现在的问题是,我想补充文本(度),以指南针和想做的​​事,与纯OpenGL的方法。我发现的 TextRenderer 类然而,无法管理,下载和使用它。如何使用TextRenderer类在我的Java项目?如果没有添加文本之外TextRenderer任何其他方式,将非常乐意倾听吧。

The question is, I want to add texts(degrees) to compass and want to do that with pure OpenGl methods. I found TextRenderer class however, couldn't manage to download it and use it. How to use TextRenderer class in my Java project? If there is any other way of adding text besides TextRenderer, would love to hear it.

我的第二个最重要的问题是有关合并秋千/ AWT方法与OpenGL和使用多个对象。我写了只使用一个GL2对象中的程序和工作完美,它是明智的同一帧上使用多个openGL的对象呢?此外,使用Swing方法和OpenGL方法一起使用是一个好主意?

My second and most important question is about merging swing/awt methods with OpenGL and using multiple objects. I wrote the program with only using one GL2 object and worked perfectly, is it sensible to use multiple openGL objects on the same frame? Furthermore, using swing methods and openGL methods together is a good idea?

推荐答案

做一些研究之后,我已经想通了如何安装并正确地使用它。

After doing little research, I ve figured out how to install it and use it correctly.

首先,去那个网站,在下载的情况下JOGL的版本适合您的操作系统你不要有任何库:
http://jogamp.org/deployment/autobuilds/master/jogl-b1011-2013-06-19_05-41-38/

Firstly, go to that web site and download suitable version of jogl for your os in case you dont have any library: http://jogamp.org/deployment/autobuilds/master/jogl-b1011-2013-06-19_05-41-38/

然后,下载jar文件并将其添加到您的用户库。
http://www.java2s.com/$c$c/Jar /j/Downloadjogl20jar.htm

Then, download that jar file and add it to your user library. http://www.java2s.com/Code/Jar/j/Downloadjogl20jar.htm

这是文件中包含TextRenderer类。

That file contains the TextRenderer class.

如果你不知道如何做一个,使用该链接:
<一href=\"http://riccardotramma.com/2011/04/setup-eclipse-to-develop-opengl-glut-apps-in-java-cc-on-windows-mac/\" rel=\"nofollow\">http://riccardotramma.com/2011/04/setup-eclipse-to-develop-opengl-glut-apps-in-java-cc-on-windows-mac/

If you dont know how to make one, use that link: http://riccardotramma.com/2011/04/setup-eclipse-to-develop-opengl-glut-apps-in-java-cc-on-windows-mac/

然后,按照说明:的http://download.java.net/media/jogl/jogl-2.x-docs/com/sun/opengl/util/awt/TextRenderer.html

这是非常容易使用,我完全添加号码,我的指南针。但是,效率不高,据我可以告诉。

It's very easy to use, I perfectly added numbers to my compass. However, not efficient as far as I can tell.

这篇关于添加文本用OpenGL到屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆