Unwanted sprite rescale

Blitz3D Forums/Blitz3D Programming/Unwanted sprite rescale

John Blackledge(Posted 2009) [#1]
I've used someone's camera rescaling code to make my planets always look 'round' no matter what the screen res - works great.
But the sprite 'atmosphere/corona' also rescales as if the sprites are parented to the camera - which they are not.

Remember, I'm only rescaling the camera, not any of the plaets, but the sprite-atmospheres also rescale, even though they are in fact parented to the non-rescaled planets.

Any ideas?


Gabriel(Posted 2009) [#2]
Does it change if you set the SpriteViewMode to Free? I'm thinking that - in order to control the sprites in the other two modes, they may need to be (internally) parented to the camera. There's no need for that in Free mode, so it might be an option.


John Blackledge(Posted 2009) [#3]
Ahhhhh - I get your point! _Internally_ parented to the camera - of course.
Thanks - I'll play with this.


John Blackledge(Posted 2009) [#4]
No, that doesn't work.
I forgot that the sprite was already 'free' (mode 2) in my code.
So obviously 'free' does not quite mean 'free' in Blitz - it's still parented to the camera internally.

So, let me give you an example:
I rescale the camera -> <- to make my planets appear round because my new monitor is wider than the res I originally set.
All 3D objects are then correctly proportioned onscreen, except for the sprite-atmospheres which are <- -> now wider than the planets!
Conclusion: camera(entity) scaling works for all 3D entities except sprites! How weird is that?

I then tried to adjust the sprite's width by (old res)/(new monitor width) but that just made the sprite into a vertically stretched oval, as if Blitz was saying 'No I've already adjusted that image.'


GIB3D(Posted 2009) [#5]
Have you tried using quads, a one-sided polygon?


John Blackledge(Posted 2009) [#6]
Nah - I was trying to finish off a program that's taken way too long anyway. I didn't want to start rewriting whole sections.

Having said that, if no-one can think of a way around the sprite problem then the tidy way forward (now that I have a wide-screen monitor, and finally accept that strange monitor sizes are here to stay) is to detect the user's desktop res or let them choose one, run the program accordingly so that all my entities are the correct dimensions, rather that have Windows 'stretch' a 1024x768 or 800x600 window across the monitor.
Then I just have to scrap my lovely gui, and come up with one that's adaptable to any resolution. Arrgghh!


John Blackledge(Posted 2009) [#7]
Well, I've got a temporary solution (until I can test on other monitors/resolutions):-

Instead of:
new_sprite_scale_width =
(old res) / (new monitor width)

I use:
new_sprite_scale_width =
(old res+ ((new monitor width - old res)/2) ) / (new monitor width)

In other words, a manual tweak to split the difference between what Blitz insists on doing and what I need it to do. Hey ho.