Question

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

Was it helpful?

Solution

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top