In many pay on-line games the names of the players appear over their heads. The fonts increase and decrease in size as the players move closer or farther away, and they stay perfectly centered. Can anyone point me to some sample code on how this is done in OpenGl. I have tried several approaches on my own, but the results are terribble. Usually the font noticeably jumps in size, and the centering based on character length causes the name to jiggle to the left and right.
Registriert: Mo Sep 23, 2002 19:27 Beiträge: 5812
Programmiersprache: C++
What approaches did you try?I also used fonts over the heads of players in the multiplayermode of a game I wrote and had no problems with the font jumping or jiggling.
I use a normal billboard over the player's head and draw it in 3D.
I was using bitmaped fonts. I wanted to be able to change the text dynamically during play, and this seemed the easiest way. The buildboard sounds like a texture mapped to box, with everything but the letters being transparent. I can see how this would solve all the problems I spoke of.
Registriert: Mi Jul 17, 2002 12:07 Beiträge: 976 Wohnort: Tübingen
Hallo!
In all cases i would use Outline Fonts. You can size, color and texture them. You should only translate over the player model, billboard and draw the text!
Hab ich irgendwelche Fehler gemact?
_________________ "Du musst ein Schwein sein in dieser Welt, sangen die Prinzen, das ist so 1.0. Du musst auf YouTube zeigen, dass dir dein Schweinsein gefällt, das ist leuchtendes, echtes Web 2.0." - Hal Faber Meine Homepage: http://laboda.delphigl.com
Mitglieder in diesem Forum: 0 Mitglieder und 4 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.