mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix 3d text scaling in projected display mode
This commit is contained in:
parent
e28af89de2
commit
736cdb0980
1 changed files with 3 additions and 4 deletions
|
|
@ -71,10 +71,9 @@ void TextsRenderer::renderNote(
|
|||
if (preset.displayMode == NoteDisplayMode::PROJECTED) {
|
||||
float scale = 1.0f;
|
||||
if (glm::abs(preset.perspective) > 0.0001f) {
|
||||
float scale2 = scale /
|
||||
(glm::distance(camera.position, pos) *
|
||||
util::sqr(camera.zoom) *
|
||||
glm::sqrt(glm::tan(camera.getFov() * 0.5f)));
|
||||
float scale2 =
|
||||
scale / (glm::distance(camera.position, pos) * camera.zoom *
|
||||
glm::sqrt(glm::tan(camera.getFov() * 0.5f)));
|
||||
scale = scale2 * preset.perspective +
|
||||
scale * (1.0f - preset.perspective);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue