Hello,
I am sure that most of us do know the incredible "rotozoom" created by Simon Jonassen for different computers.
When I saw it, I contacted him and he kindly showed me how it worked, great master!
I wanted to rotate an actual Pmode3 image, so he pointed me to a web where one can find all of the needed maths to do that (it is in french language)
http://www.alrj.org/docs/2D/rotozoom/rotozoom.html
Immediately I began to program something with those equations just to prove the concept.
When it finally worked, it was really slower than a snail
I contacted Simon again and we began a chain of modifications / optimizations in order to make it run faster and faster, since Nov, 8th it has lasted a bit more than a month.
The very first version needed about 5 seconds to draw a single frame, say one step!
Now the time varies upon the machine
for 32k machines ... 19,5 seconds to perform a 360 degrees (full turn in 64 steps)
for 64k machines ... 16,5 seconds (in MAP1)
This means that now a single frame (step) is done in about 0,3 sec or 0,26 sec (64k). The program runs 16-19 times faster than the first version!
This is the result of a lot of really 'mad' changes and lots of optimizations, for instance creating tables to reduce the calculations. Right now only additions and subtractions!
I upload here two VDK and two DSK files for Dragon and CoCo users, so anybody can try it!
The versions for 64k machines won't work on 32k machines (if not expanded), as they
switch to MAP1 and use the full 64k of RAM, no Interpreter, no DOS
In next post, I will add some notes about the program
ROTATING IMAGES PMODE3
Re: ROTATING IMAGES PMODE3
Some notes about the program:
We rotate a viewport of 80x80 pixels (square) and so when it moves 45 degrees, the vertical or horizontal lines are able to show: 80 pix / cos 45º = 114 pixels
You can 'cook' any drawing in Pmode3 ensuring that the image to be rotated remains centered.
As we use an area of 128x128 pixels, this means that we leave out of sight both the first 32 rows and the last 32 rows too, just because 192-32-32 = 128
The image can use the whole width of Pmode3 (128 pixels) remember we'll see 114 only!
Despite the image in Pmode3 is 128x128 pixels, it shows on screen as a rectangle that has exactly double width than height (factor 2:1)
In order to 'show' a rotating square, we use Pmode1 wich compensates size because the resolution in that mode is 128x96, so each Pmode1 row is double height than Pmode3
When working on a drawing to be rotated, keep in mind this detail, it will show double height than seen in Pmode3.
Once you have an image ready and saved to disk, to create the texture, use the program
- GENPIX.BAS for 32k machines. This will create a filename finished in 'X'
- CRT2FIL.BAS for 64k machines. This creates 2 files finished in 1 and 2
Once created the texture file(s), you can verify the resulting files running
- RDPIX.BAS for 32k machines. Reads the texture and recreates the PM3 image
- VERIFIER.BAS for 64k machines. Reads the two files and recreates the PM3 image
Finally, to see the image rotating, you run, in all machines
- EXEROT.BAS
To quit you will have to press the Reset button
In these virtual disk files you will find two images.
- SQUARE.BIN that is an image 128x128 pixels that I used to verify the program in the first steps.
- QBERT.BIN is a screen capture of the Cuthbert character from the loading screen of some Microdeal games. I cut it to center it in the middle, but it is too big and shows partially.
cheers
pere
We rotate a viewport of 80x80 pixels (square) and so when it moves 45 degrees, the vertical or horizontal lines are able to show: 80 pix / cos 45º = 114 pixels
You can 'cook' any drawing in Pmode3 ensuring that the image to be rotated remains centered.
As we use an area of 128x128 pixels, this means that we leave out of sight both the first 32 rows and the last 32 rows too, just because 192-32-32 = 128
The image can use the whole width of Pmode3 (128 pixels) remember we'll see 114 only!
Despite the image in Pmode3 is 128x128 pixels, it shows on screen as a rectangle that has exactly double width than height (factor 2:1)
In order to 'show' a rotating square, we use Pmode1 wich compensates size because the resolution in that mode is 128x96, so each Pmode1 row is double height than Pmode3
When working on a drawing to be rotated, keep in mind this detail, it will show double height than seen in Pmode3.
Once you have an image ready and saved to disk, to create the texture, use the program
- GENPIX.BAS for 32k machines. This will create a filename finished in 'X'
- CRT2FIL.BAS for 64k machines. This creates 2 files finished in 1 and 2
Once created the texture file(s), you can verify the resulting files running
- RDPIX.BAS for 32k machines. Reads the texture and recreates the PM3 image
- VERIFIER.BAS for 64k machines. Reads the two files and recreates the PM3 image
Finally, to see the image rotating, you run, in all machines
- EXEROT.BAS
To quit you will have to press the Reset button
In these virtual disk files you will find two images.
- SQUARE.BIN that is an image 128x128 pixels that I used to verify the program in the first steps.
- QBERT.BIN is a screen capture of the Cuthbert character from the loading screen of some Microdeal games. I cut it to center it in the middle, but it is too big and shows partially.
cheers
pere
Re: ROTATING IMAGES PMODE3
Very clever!
Well done Pere/Simon.
Well done Pere/Simon.
Re: ROTATING IMAGES PMODE3
Hi,
Thanks for your kind words!
It is always fun to try to push these old beasts beyond their limits ...
or what we think their limits are.
cheers
pere
Thanks for your kind words!
It is always fun to try to push these old beasts beyond their limits ...
or what we think their limits are.
cheers
pere
Re: ROTATING IMAGES PMODE3
Hello,
another step I wanted to try before closing the project was performing the needed changes
to make it run in machines with an Hitachi 63x09 instead of the standard MC6809
Just using the faster CPU native mode and using the new registers E and F,
the time is reduced from 16,5 seconds (for a D64 MAP1) down to 13,8 seconds, so about 16% faster
I am adding here the four disks now in v34 that contain both versions.
- RUN"EXEROT " will still execute it for 6809
- RUN"EXEROT3" will execute the new version for 6309 native mode
cheers
pere
another step I wanted to try before closing the project was performing the needed changes
to make it run in machines with an Hitachi 63x09 instead of the standard MC6809
Just using the faster CPU native mode and using the new registers E and F,
the time is reduced from 16,5 seconds (for a D64 MAP1) down to 13,8 seconds, so about 16% faster
I am adding here the four disks now in v34 that contain both versions.
- RUN"EXEROT " will still execute it for 6809
- RUN"EXEROT3" will execute the new version for 6309 native mode
cheers
pere
Re: ROTATING IMAGES PMODE3
Limits....
what limits.... all in your mind
what limits.... all in your mind
Re: ROTATING IMAGES PMODE3
Hi,
this is my first try with an screen capture program ... don't shoot me!
It is an mp4 file that shows two full turns
cheers
pere
this is my first try with an screen capture program ... don't shoot me!
It is an mp4 file that shows two full turns
cheers
pere
Re: ROTATING IMAGES PMODE3
this is the url where I have posted the video of the ROTATOR on a 6309
https://www.facebook.com/10001019490918 ... 669153727/
Is there any way to uplad here a video (might be some 4Mb)?
cheers
pere
https://www.facebook.com/10001019490918 ... 669153727/
Is there any way to uplad here a video (might be some 4Mb)?
cheers
pere
Re: ROTATING IMAGES PMODE3
I think you can upload videos in FLV format, but I'm not sure that you can embed them in forum posts.
Would be a nice feature though.
By the way, nice effect! Would it be possible to do for example a maze game based on rotating the screen itself?
Keep up the good work!
Would be a nice feature though.
By the way, nice effect! Would it be possible to do for example a maze game based on rotating the screen itself?
Keep up the good work!