Chapter 11

Text positions and the projection matrix

That is related to the view and projection matrix of the camera. As we could see in the example code, the HUD camera is using the absolute reference frame (not affected by parent ones) and the identity view matrix (the camera is facing towards the negative Z axis), which means that texts in the XOY plane can be fully displayed in the camera's view. While projected into a 2D orthographic camera, the text position should be set according to the clipping planes (0, 0) - (1024, 768). The bottom-right corner is near the coordinate (1024, 0) in this situation.

Get OpenSceneGraph 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.