문제

I use sprite to display an image texture but the sprite width and height are in 3D world units and I need to automatically display the loaded image texture without stretching.

I know how to load a texture I only need a way to resize the sprite automatically according to the loaded image.

tools used are Delphi / GLScene

도움이 되었습니까?

해결책

Use a TGLHUDSprite, it'll be directly displayed and positioned in 2D in screen units.

TGLSprite is for when you want a sprite in 3D, you can position it in screen units, but you'll have to do the math for that (look at TGLHUDSprite's and imposter's source code for hints on that math).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top