How to put 3D object on top of Sprite Candy Hud ?

Blitz3D Forums/Blitz3D Programming/How to put 3D object on top of Sprite Candy Hud ?

semar(Posted 2007) [#1]
Hi Blitzers,

do you know if there's a way to put a 3D object on top of an Hud in Sprite Candy ?

So far the 3D model remains 'covered' by all the huds and layers.

Do I have to use a second camera ? If so, how ?

Thanks in advance,
Sergio.

P.S.
Here is what I mean: the stars background is a layer, and I would like to set it behind the earth --> Image here


(tu) sinu(Posted 2007) [#2]
try the entityorder command, set the hud higher so it is drawn after everything else.


GfK(Posted 2007) [#3]
Yeah, EntityOrder will work.

Just a note about EntityOrder - the manual gives the impression that you can only use -1, 0, or 1. This isn't the case. You can give it pretty much any number and all objects will be drawn accordingly.


semar(Posted 2007) [#4]
Thanks, problem is that the HUDs are not like normal entities - the command Entityorder does not seem to work with them, I get 'entity does not exist', even if each hud have been declared global and correctly initialized with hud_create(...).

Changing the entityorder of the 3d object (with negative, 0 or positive values) did not help too.

*edit*
The command HUD_Create returns an handle to an SC_HUD type, which contains various fields, and a pivot. Sadly, the EntityOrder does not work for pivots, but only with meshes or cameras !

*edit2*
I've modified the HUD_Create and the SC_HUD type, in order to return an extra field, wich is the mesh used to create the HUD; but also in this way, playing with EntityOrder did not work :/

Sergio.


Moraldi(Posted 2007) [#5]
I had the same question 3 weeks ago, take a look here:
http://www.blitzbasic.com/Community/posts.php?topic=68449


semar(Posted 2007) [#6]
Thank you Moraldi for the link, - and of course, thank you @rtur for the code, it works like a charm :)

Kind regards,
Sergio.