开发者

How to write text on a texture using java3D API?

I'm 开发者_如何学Pythonwondering how I can write some text on a given texture (during execution) ?

I'm using the java3d API.

Thanks !


I believe you can fetch your texture's ImageComponent from the getImage or getImages methods, cast them to ImageComponent2D (if you can), then call the getImage method on them to get access to the BufferedImage object which finally gives you access to a Graphics object for text drawing.

You will probably have to do this for every MIP level, or regenerate the lower levels from the highest level every time you change it.

Alternatively, if you're not going to be updating the texture very frequently, you should be able to just create and apply a new texture from an Image every time you need to using the TextureLoader.


I think you should be able to figure it out using this guide (start on page 18 where they're 'drawing' on the cube).

The Joy of Java 3D

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜