Retrieving Screen Coords of a Node

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Hi there,

I want to create labels for entities by creating titles connected to nodes.

The titles will be positioned at the border of the graphics area. Therefore I want to get the position of the node on screen (0..1 width/ 0..1 height). Hence the result should be 0.5/0.5 for a node exactly in the middle of my current view. This should allow me to position the titles in a way the lines do not go across the screen and intersect a lot ...

There are several functions related to this problem but i didn't find a way to extract the screen position of a node correctly:

hm_getviewport, hm_getcurrentview

and more general for hm views: *viewset, *quatrotate, *window, *trueview

Does anybody have a code snippet doing the conversion between model coords and screen position or does a hm command exist doing the job?

Or is there some information about the transformation matrix used in *viewset and hm_getcurrentview?

Thank you very much for your help!

Greetings from Vienna.

Thomas

Tagged: