Scaling sprites with distance?

Started by
1 comment, last by george7378 9 years, 4 months ago

Hi!

I'm wondering if there's an easy way to change the scaling of an ID3DXSprite according to its depth? I'm using a sprite for the exhaust of a spacecraft in my game (using D3DXVec3Project to determine its position on screen):

[attachment=25014:spritescale1.jpg]

...however as I change the camera distance, the sprite stays the same size:

[attachment=25015:spritescale2.jpg]

Perhaps there's a flag I can set? Or failing that, does anyone know how the scaling factor would relate to distance?

Thanks :)

Advertisement

If you double the distance you halve the size.

Thanks, that's great. Multiplying the scale factor by camDistance_0/camDistance scales it correctly :)

This topic is closed to new replies.

Advertisement