Change origin of billboard effect, TextNode positioning

Hi!

I’m trying to setup tooltips for 3d objects in the world. Therefore, I created a TextNode and attached it to a NodePath. Then I added the billboard effect with setBillboardPointEye().

text = TextNode('xx/nxx/nxx/nxx/n')
nodepath = aspect2d.attachNewNode(text)
nodepath.setBillboardPointEye()
nodepath.reparentTo(someObject)

Unfortunately, the tooltip appears to rotate around some point right between the first and the second line of the text (there are around 5-10 lines of text). I’d rather have it rotate around the bottom edge or something like that. If I change the position of the NodePath itself and the camera then turns around the tooltip, it still rotates around this point between the first and the second line. Just the whole TextNode was shifted to some other global coordinate. Is there an easy possibility to somehow shift the origin of the billboard effect respectively the origin of the TextNode?

grafik

In the screenshot you can see that there are two tooltips that are fixed at the (light) blue dot, right between the first and second line. How does Panda3d decide to position the TextNode like this and how can I change this without having to do coordinate transformations relative to the camera when positioning the NodePath?

If you are trying to attach hints in a 3d world, then attach them to the render.
Since the aspect2d is an ortho lens camera, and in addition it is a cartesian coordinate system.

You simply need to put the text on a child node and apply a position offset to this child node, while the billboard effect is applied to the parent node.

1 Like