Screen coordinates

I have a problem:I have some 3d objects in game and I need labels with their names on them.How can I transform world coordinates of object to screen coordinates for placing GUI elements?

This is a snipplet from my game. It puts some text attached to the character, so I hope it’s useful to you.

text = TextNode('lines text node')
text.setText('PUT YOUR TEXT HERE')
textNodePath = world.eric.attachNewNode(text)
# world.eric is the nodepath to which text will be attached
# so you should use your own nodepath

it works,thanks