Othographic Projection Overlays

Does any one know how to draw lines, dots, or pictures over the GLCanvas? The basic use of this would be to have an overlay on the screen, like FPS or some other type of interface. The second more complicated use would be to draw a box around different objects on the screen. Is there a way to convert world cords easily to window cords?

You can search this forum for “HUD”, you should find solutions involving the View object and foreground nodes…

Lilian

Just an idea, don’t know if it’s correct at all (sorry), to convert worls coords to window coords you could simply transform your point by the View.getTransform() matrix ? (But it should be slow if you have a great number of things to display.
You may be interested also in the Foreground node if you add Alpha-textured quads to it you can achieve cool GUI effects.
I’m just curious, which effect exactly you want to achieve ?

[quote="<MagicSpark.org [ BlueSky ]>,post:3,topic:27640"]
I’m just curious, which effect exactly you want to achieve ?
[/quote]
Right now im thinking about a few things. I’m making a space game and would like to add velocity lines, lines that the ships computer adds to give the pilot an idea of how fast he or she is going. A selection box, preferable a stylistic one, around other ships you have targeted, and dots for ships out of range or other such things. Once I see what I can do about those im sure more uses will come to mind.

I’m going to go look at the foreground nodes now.

Right now im thinking about a few things. I’m making a space game and would like to add velocity lines, lines that the ships computer adds to give the pilot an idea of how fast he or she is going. A selection box, preferable a stylistic one, around other ships you have targeted, and dots for ships out of range or other such things. Once I see what I can do about those im sure more uses will come to mind.

I’m going to go look at the foreground nodes now.
[/quote]
You could use real 3D objects instead : I think it would be fancier.

[quote="<MagicSpark.org [ BlueSky ]>,post:5,topic:27640"]
You could use real 3D objects instead : I think it would be fancier.
[/quote]
I could, and I may. I got the velocity lines I wanted, and technically they are 3d, but I used the Foreground node to keep them centered around the camera. For the other stuff I think im going to go look and see what I can get out of bill-boarding. I see there is a Billboard node, does anyone have a better way to do it?

I could, and I may. I got the velocity lines I wanted, and technically they are 3d, but I used the Foreground node to keep them centered around the camera. For the other stuff I think im going to go look and see what I can get out of bill-boarding. I see there is a Billboard node, does anyone have a better way to do it?
[/quote]
Well, the problem with Billboard is it’s a quad. I wanted to have a BillboardGroup class but I didn’t took time to implement it.

[quote="<MagicSpark.org [ BlueSky ]>,post:7,topic:27640"]
Well, the problem with Billboard is it’s a quad. I wanted to have a BillboardGroup class but I didn’t took time to implement it.
[/quote]
I modified the PickingLibrary class a few days ago so that it is able to pick Quads. Load it from CVS to benefit from the changes.

But I have problems picking very near Nodes, too.

I modified the PickingLibrary class a few days ago so that it is able to pick Quads. Load it from CVS to benefit from the changes.

But I have problems picking very near Nodes, too.
[/quote]
Thanks !