rotate

Discussions about the BBC BASIC language, with particular reference to BB4W and BBCSDL
roy
Posts: 31
Joined: Mon 02 Apr 2018, 15:48

rotate

Post by roy »

Hi all

I would like an image to rotate whist it is moving.

Is there a way to do this

Thanks Roy
guest

Re: rotate

Post by guest »

roy wrote: Mon 16 Apr 2018, 07:07 I would like an image to rotate whist it is moving. Is there a way to do this
Of course you can do it (remember the rotating objects in Xmas Demo II for example, or the old rotating playing cards demos?) but - at least until the 2D graphics library that I suggested gets written - the method is entirely different for BB4W and BBCSDL, and you don't say which you are using! :roll:

Richard.
roy
Posts: 31
Joined: Mon 02 Apr 2018, 15:48

Re: rotate

Post by roy »

Hi Richard

I was hoping to get this demo to run on all platforms.

I will look at the demos above

Thanks Roy
guest

Re: rotate

Post by guest »

roy wrote: Mon 16 Apr 2018, 09:20I was hoping to get this demo to run on all platforms.
OK. In the absence of the proposed 2D library you will have no choice but to use a conditional test, typically of INKEY$(-256), to discover what platform it is (BB4W or BBCSDL) and execute the appropriate platform-specific code.

How important is performance (i.e. speed) to your application? Do you need support for an 'alpha channel' (e.g. a sprite with transparent regions)? Do you need scaling as well as rotation? Depending on the answers I may be able to throw together a quick-and-dirty 2D library which will allow you to make progress. The BBCSDL code is no problem - I have that - but I don't currently have functionally-equivalent BB4W code and it would have to be cobbled-together.

Richard.
roy
Posts: 31
Joined: Mon 02 Apr 2018, 15:48

Re: rotate

Post by roy »

Hi Richard
Do you need scaling as well as rotation?
Yes, I've done the scaling, it's just the rotating to sort.

Regards Roy
guest

Re: rotate

Post by guest »

roy wrote: Mon 16 Apr 2018, 17:58Yes, I've done the scaling, it's just the rotating to sort.
Leaving me to guess whether you need support for an alpha channel. This is crucial, because if you don't you can use the PlgBlt API, but if you do it's going to need a much more complicated solution (such as assembler code). As you haven't answered, there's nothing I can do. Sorry.

Richard.
roy
Posts: 31
Joined: Mon 02 Apr 2018, 15:48

Re: rotate

Post by roy »

Sorry Richard

I do not need support for an alpha channel.

regards Roy
guest

Re: rotate

Post by guest »

roy wrote: Mon 16 Apr 2018, 20:30I do not need support for an alpha channel.
In that case it shouldn't need anything complicated like assembler code: you could use SYS "PlgBlt" in the BB4W case and SYS "SDL_RenderCopyEx" in the BBCSDL case. Both can do rotation and scaling, but PlgBlt has no alpha (transparency) capability. Do you still need me to help with that, or is it within your skillset?

Richard.
roy
Posts: 31
Joined: Mon 02 Apr 2018, 15:48

Re: rotate

Post by roy »

Thanks for all help, Richard

I'll look at the links and see how I go.

Regards Roy
TOLO
Posts: 3
Joined: Wed 31 Oct 2018, 10:02

Re: rotate

Post by TOLO »

Hello!

I have some problems with PlgBlt . Can anybody help me with a sample? What I need is to rotate a BMP 1280 x 1024 bit for 90 deg contra clockwise.

Thank you!

Regards

Lojze