Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

need help with HUD coordinates

Varun Blitz
Registered User
Join date: 22 May 2008
Posts: 62
05-30-2008 02:22
hi friends,

i recently started working with HUDs but am not able to understand the coordinates which they follow.
i read the wiki article regarding the coordinates of HUD but didn't understand them at all.
each time i create a HUD,it gets lost because of wrong coordinates and positioning.
plz help me..........
Galena Qi
Registered User
Join date: 9 Sep 2006
Posts: 249
05-30-2008 08:12
You shouldn't have to set coordinates. Just attach the HUD object to the desired attachment point (use "Attach to HUD" in the menu). If you have made the HUD transparent on all faces except one and the the HUD rotation is wrong, the HUD may be invisible on your screen. In that case, use the keyboard shortcut CTL-ALT-T to make all transparent objects visible and edit the HUD rotation so it's visible. The HUD will remember the rotation, and as long as it is attached to the same attachment point, or "worn", it will always have the correct rotation.
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
05-30-2008 13:51
presumeably you are making a hud that moves itself

the coords afaik are x out of screen, y left, z up or some such and the screen is about 1x1 in size.

I'll double check when I'm online tonight.
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
06-03-2008 09:20
The rendered window is always 1 unit (meters are meaningless in the HUD context) in height, the width being proportionate to the window's aspect ratio. +Y is left, +Z is up.

The local origin within the window is particular to the attachment point used. So for the two centers, <x,0,0> would be in the center, the top edge will always be at Z 0.5, the bottom edge at Z -0.5. For the top left attachment point, <x,0,0> would be the top left corner, the top edge will always be at Z 0.0, the bottom edge at Z -1.0, and so on.

Note that if an object is attached to the right or left side of the screen, and the aspect ratio of the rendered window changes, the attachment will remain at center-relative position until re-attached (including re-logging). For example, if an object is attached to the bottom left point, and the window height is reduced without changing the width, the object will seemingly move to the right. Note, however, this has no effect on coordinates indicated by llGetLocalPos().