HUBBA HUBBA HUD

Blitz3D Forums/Blitz3D Beginners Area/HUBBA HUBBA HUD

Buggy(Posted 2006) [#1]
How exactly do I create a HUD for a split-screen 3D game? I guess I could use 2D commands, but that's slow, right?

When I use sprites, not only is it difficult, but on the other side of the split-screen multiplayer action, all of the sprites are easily seen floating around with the character.

I thought it would be easy, buy 3D is a tricky game.


Matty(Posted 2006) [#2]
Since you are probably using two cameras, one for each of the split screen views then simply render from each camera one at a time hiding all the other player's HUD elements while rendering from the player's camera. If you parent each player's HUD elements to their camera then simply by hiding their camera their HUD elements will also disappear.

This means it would look something like this:


;this would be in your main loop instead of "updateworld, renderworld, flip"

updateworld

;player 1 view
showentity player1camera
;camera view port would be the top half for instance
;remember all HUD sprites for player1 are children of the player1camera (and the same for player 2)
hideentity player2camera
renderworld

;player2 view
showentity player2camera
hideentity player1camera
renderworld

flip




Stevie G(Posted 2006) [#3]
You could also use a 3rd camera positioned far away from the main scene and render the hud elements there. Then just overlay this ontop of the 2 split screen camera renders making use of cameraclsmode. Providing you set up the hudcamera to renderlast usign entityorder then you don't need to hide the other cameras during renderworld().

Stevie


Buggy(Posted 2006) [#4]
Thanks for the input, guys. Is there a major slowdown associated with using DrawImage?


Stevie G(Posted 2006) [#5]
The simple fact is that some cards don't like mixing 3d and 2d, in particular the newer ones. Best to go with a 3d solution if it's a 3d game.

Stevie