rotate

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

rotate

Post by roy » Mon 16 Apr 2018, 07:07

Hi all

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

Is there a way to do this

Thanks Roy

guest
Site Admin
Posts: 103
Joined: Mon 02 Apr 2018, 09:12

Re: rotate

Post by guest » Mon 16 Apr 2018, 08:29

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 » Mon 16 Apr 2018, 09:20

Hi Richard

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

I will look at the demos above

Thanks Roy

guest
Site Admin
Posts: 103
Joined: Mon 02 Apr 2018, 09:12

Re: rotate

Post by guest » Mon 16 Apr 2018, 09:45

roy wrote:
Mon 16 Apr 2018, 09:20
I 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 » Mon 16 Apr 2018, 17:58

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
Site Admin
Posts: 103
Joined: Mon 02 Apr 2018, 09:12

Re: rotate

Post by guest » Mon 16 Apr 2018, 18:54

roy wrote:
Mon 16 Apr 2018, 17:58
Yes, 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 » Mon 16 Apr 2018, 20:30

Sorry Richard

I do not need support for an alpha channel.

regards Roy

guest
Site Admin
Posts: 103
Joined: Mon 02 Apr 2018, 09:12

Re: rotate

Post by guest » Mon 16 Apr 2018, 20:45

roy wrote:
Mon 16 Apr 2018, 20:30
I 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 » Mon 16 Apr 2018, 20:56

Thanks for all help, Richard

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

Regards Roy

Post Reply