www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: MegasXLS on February 17, 2011, 06:55:40 pm

Title: Text on top the object3D
Post by: MegasXLS on February 17, 2011, 06:55:40 pm
Guys

Anyone know a way to put text on top of a 3D object?

I got thinking about creating a plane and add a text in one texture and adds it as child of my 3D object. But I think there a better way.

I know how to put text on the screen using blit, but I wish it had a text object on top of him and follow him when the object moves.




I have used the method:

Code: [Select]
TextBlitter.blitText (smallFont, buffer, "Hello.", 37, 500, Color.black);
to display something on screen.

thanks for the help =)
Title: Re: Text on top the object3D
Post by: raft on February 17, 2011, 08:22:12 pm
text is very sensitive for scaling such that it gets ugly and unreadable. that's why assigning text as a texture to a plane is not a good idea. it was my first attempt (see this image (http://www.aptalkarga.com/en/history_album/slides/karga02.html)) but than i decided to blit text. this how it looks (http://www.aptalkarga.com/en/album/slides/016.html)

for moving text with object, you can do that programatically. quite easy indeed. the catch is, since blitting always done after scene is rendered, there is no perfect solution to z-order text and 3d objects properly. but this problem does not happen very much. also depends on the scene

Title: Re: Text on top the object3D
Post by: MegasXLS on February 17, 2011, 09:37:36 pm
Thanks for the help Raft. =) I'll try.