Jump to content

Make billboard always face screen


Tiel

Recommended Posts

I'm looking for a way to have a billboard always face the screen, not just the camera position in the world.


This is to put a kind of 3D text above certain objects-kinda like waypoints but editable (is there a term for this?). What I have now works well enough, just not supergood with the BBs presenting themselves at an angle to adjust to the camera.


I think the only alternative would be to have hidden textctrls on playgui and schedule them to update when a special object is in view, though that seems less than ideal.


Greatly appreciate any input here

Link to comment
Share on other sites

Thanks for your thoughts,


I was never able to get shapenameHUD working, it's reluctant to function when set up like so

g4pQg3.png


What I'm working with is

http://imageshack.com/a/img924/6854/I6LWgT.png


I'm not certain it's possible to get similar results with shapeNameHUD - also there's a lot going on in the gamespace and not sure how to make the control discriminate objects.

Link to comment
Share on other sites

I think the ShapeNameHud should basically do what you want. The control already walks the client object list, culls obstructed objects, positions text in relation to the object in 2d gui space, then scales the size and performs a fade-out based on distance.


At worst it would take some minor tweaking of the gui's C code to get it the way you want it. For example, the text does not currently rotate to match the object.


To get any shapeBase-derived object (pretty much everything with a 3d model) to display a name, the object must be assigned a shapeName using Object.setShapeName("name").


The full template will set the shapeName automatically for players - based on player name sent when connecting to the server (which defaults to "visitor"). It also sets the field for vehicles/turrets - based on a field "nameTag" defined in a vehicle/turret's datablock. At least in the 3.8 template ... I haven't played with the 3.9 one yet.


If those routines are bypassed or the name-popup functionality is desired for additional object types, it is necessary to call the setShapeName() function on the objects when they are added in script.

Link to comment
Share on other sites

I would just go with what is already there and extend it later eventually, if you want to customize everything from the beginning you will just waste time on unimportant visual extra features instead on spending time developing the core game.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...