Login  Register

Re: Need help understanding use of TextRenderer

Posted by Ryan McFall on Mar 05, 2021; 5:48pm
URL: https://forum.jogamp.org/Need-help-understanding-use-of-TextRenderer-tp4041009p4041038.html

One reason I struggle with begin3DRendering is that I am unsure of what vertices the draw method uses for the quads that it renders.  Therefore I often end up with something that looks more like ink blots than text, because whatever projection matrix I'm using  is making the rendered quads too large, effectively "zooming in" on the font.



I now recall the draw3D method, which is maybe what I should be using.  This method includes a scaleFactor parameter which I am guessing is designed to address the "ink blot" problem described above.  The above image uses a scaleFactor of 1, with a 2D world coordinate system set up with gluOrtho2D.  Both X and Y values range from -1 to 1.  If I change the scale factor to 0.01 through trial and error, I get this image



The documentation doesn't really say how to use scaleFactor.  How do I calculate an appropriate value for scaleFactor, instead of guessing?