Best way to do 3d HUD?

Blitz3D Forums/Blitz3D Programming/Best way to do 3d HUD?

Chroma(Posted 2006) [#1]
Basically wanting to avoid putting any 2d on screen at all. What's your opinion on how to do a basic 3 digit hud quad overlay that shows something like armor (0 to 100)?


Rroff(Posted 2006) [#2]
Offhand I'd say the best way to do it would be to have a quad that was always aligned to the viewpoint and write directly to the texture for that quad, theres plenty of code samples for this around these forums/archives.


Matty(Posted 2006) [#3]
Or have a quad for each digit (3 digits in this case) with an animated texture with the values 0-9 laid out sequentially in the image, then simply change the current texture frame of the quad when the numbers change.


Chroma(Posted 2006) [#4]
Yep that's working great.

Now I just need to figure out how to imitate 2d coords. I have a sprite that's 1 unit in front of the camera. Camerarzoom is 1. graphicswidth is 0 to 1024 pixels.

EDIT: This looks about right...

hudx# =  100
hudx = 2 * Float ( hudx/GraphicsWidth() ) - 1



Chroma(Posted 2006) [#5]
And this for Y positioning a 3d sprite in 2d coords. Seems kludgy though... :(

hudy# = 30
hudy = 1.35 * Float( -hudy/GraphicsHeight() ) + .7



CodeGit(Posted 2006) [#6]
If you want to spend money you could also look at Sprite Candy.

This used to be the web site.

http://www.x-pressive.com/

This is the forum.

http://playerfactory.proboards25.com/index.cgi


John J.(Posted 2006) [#7]
I use nSprite 2 for all 2D graphics in my 3D games, and it works really well.


boomboom(Posted 2006) [#8]
Another vote for sprite candy. If al you want is a GUI then go with candy


Mustang(Posted 2006) [#9]
I have one made by Sswift, dunno if he sells that anymore. Cheaper than SC and almost just as good.


jhocking(Posted 2006) [#10]
I use FONText. I have no idea if it's still available since I bought it years ago. I got it for the bitmap font editor, but the HUD code that came with it has proven to be at least as useful, if not more so.


Chroma(Posted 2006) [#11]
Thanks for all the tips guys! :)


OrcSlayer(Posted 2006) [#12]
I like Sswift's GUI library...the quick tech support when I couldn't get it working was a great plus (and, as usual, it was my fault that it didn't work). Great guy to work with...


Mustang(Posted 2006) [#13]
Sswits system (there's a downloadable demo too):

http://www.blitzbasic.com/logs/userlog.php?user=963&log=268

Other stuff made by Sswift:

http://www.blitzbasic.com/logs/userlog.php?user=963