Hi guys.
There is some code that worked in older versions
GLSceneViewer1.Buffer.RenderToBitmap (bmp, Round (96 * 2));
I got a picture twice the size.
Now I tried to use it - the labels are displaced. If dpi = 0, then everything is ok!
Same problem! I solved the issue by replacing the "f" factor with 1 (or simply remove "f" from the code lines): gl.Translatef(X*1-rci.viewPortSize.cx/2, rci.viewPortSize.cy/2-Y*1, Z);
and gl.Scalef(Scale.DirectX*1, Scale.DirectY*1, 1);
This code is located in the GLS.HUDObjects.pas, TGLHUDText.RenderTextAtPosition method. I'm not sure if this is the correct solution, it's more of a "quick fix".
Last edit: Vitalii 2023-07-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the quick fix. However if you use both TGLHUDText (sprite) and TGLAbsoluteHUDText (3D object) the scale factor is needed, here is a suggestion, in TGLHUDText.RenderTextAtPosition():
ifSelfisTGLAbsoluteHUDTextthenf:=1// fixelsef:=rci.renderDPI/96;// original code
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi guys.
There is some code that worked in older versions
GLSceneViewer1.Buffer.RenderToBitmap (bmp, Round (96 * 2));
I got a picture twice the size.
Now I tried to use it - the labels are displaced. If dpi = 0, then everything is ok!
Labels are made using TGLAbsoluteHUDText
Last edit: Alexander Dev 2021-03-29
Same problem! I solved the issue by replacing the "f" factor with 1 (or simply remove "f" from the code lines):
gl.Translatef(X*1-rci.viewPortSize.cx/2, rci.viewPortSize.cy/2-Y*1, Z);
and
gl.Scalef(Scale.DirectX*1, Scale.DirectY*1, 1);
This code is located in the GLS.HUDObjects.pas, TGLHUDText.RenderTextAtPosition method. I'm not sure if this is the correct solution, it's more of a "quick fix".
Last edit: Vitalii 2023-07-22
Thanks for the quick fix. However if you use both TGLHUDText (sprite) and TGLAbsoluteHUDText (3D object) the scale factor is needed, here is a suggestion, in TGLHUDText.RenderTextAtPosition():