3D perspective animation
-
- Aurora
- Posts: 890
- Joined: Mon Nov 24, 2014 2:03 pm
3D perspective animation
Hi Folks,
Following on from the QL tumbling program, I have developped a 3D QLander program, where you fly back and forth in a helicopter, looking out over fixed ground, and have to remotely control a drone 'pod' and land it on a moving iceberg. There are various inoffensive flying objects, but you must avoid an orbiting aerial mine!
To speed up animation, the program first calculates ALL the animated object's x,y,z coordinates and stores them in an array, so memory usage is heavy. This avoids the need to store dozens of sbyted screen images (even heavier)! But the need to draw the animation still produces some flicker on slower systems, but is fine on QPC2. My next project will be to dig out my first (1986) perspective scenery program which ran ok on 128ko, and improve the user interface.
The many variables and parameters in the QLander program have been carefully chosen to keep within acceptable bounds, as I have not yet finished working around all the weaknesses in trigonometrcial operators. For example, going 'off window' can cause graphical chaos, so be careful with any changes you might make to the code...
Tested OK on QPC2, SGC (QDOS or SMSQ/E). Should be ok on emulators ? Instructions are on screen. UNZIP and LRUN, and let me know if there are any problems.
Steve.
Following on from the QL tumbling program, I have developped a 3D QLander program, where you fly back and forth in a helicopter, looking out over fixed ground, and have to remotely control a drone 'pod' and land it on a moving iceberg. There are various inoffensive flying objects, but you must avoid an orbiting aerial mine!
To speed up animation, the program first calculates ALL the animated object's x,y,z coordinates and stores them in an array, so memory usage is heavy. This avoids the need to store dozens of sbyted screen images (even heavier)! But the need to draw the animation still produces some flicker on slower systems, but is fine on QPC2. My next project will be to dig out my first (1986) perspective scenery program which ran ok on 128ko, and improve the user interface.
The many variables and parameters in the QLander program have been carefully chosen to keep within acceptable bounds, as I have not yet finished working around all the weaknesses in trigonometrcial operators. For example, going 'off window' can cause graphical chaos, so be careful with any changes you might make to the code...
Tested OK on QPC2, SGC (QDOS or SMSQ/E). Should be ok on emulators ? Instructions are on screen. UNZIP and LRUN, and let me know if there are any problems.
Steve.
Re: 3D perspective animation
I downloaded Orbiter3D and I found that it would compile and execute perfectly with my setup, and without modification. I mention this because most BASIC programs I have downloaded will not compile on my QPC2 configuration. Given that animation is difficult in SBASIC, Orbiter is interesting. I am not actually able to play the game but I enjoyed watching the animated shapes. I have been trying to write some animated programs for a while and have not been very successful.
-
- Aurora
- Posts: 890
- Joined: Mon Nov 24, 2014 2:03 pm
Re: 3D perspective animation
Hi Tiny,
Glad you liked the graphics.... But I wonder why you say you are not able to play the game ?
Is it too hard to get to grips with, or is there some technical reason preventing say KEYROW commands from working on your setup ?
If you use the insrument panel x, y & z key readouts, you should get to dock on the iceberg ok, after some practice.
( One of my professional qualifications was surveying, which helped me construct scenes and move about in them.... It's all just simple trigonometry ! )
As I mentioned though, QL trigonometry functions are quirky, meaning you have to adapt many workarounds to get the output you want.
When I have located my old 128ko JM perspective scenery program, I will try to make the animation 'motor' routines simple enough for users to adapt to.
Don't give up on your projects, as QPC2 is certainly fast enough to allow 3D animations in perspective..... Steve.
Glad you liked the graphics.... But I wonder why you say you are not able to play the game ?
Is it too hard to get to grips with, or is there some technical reason preventing say KEYROW commands from working on your setup ?
If you use the insrument panel x, y & z key readouts, you should get to dock on the iceberg ok, after some practice.
( One of my professional qualifications was surveying, which helped me construct scenes and move about in them.... It's all just simple trigonometry ! )
As I mentioned though, QL trigonometry functions are quirky, meaning you have to adapt many workarounds to get the output you want.
When I have located my old 128ko JM perspective scenery program, I will try to make the animation 'motor' routines simple enough for users to adapt to.
Don't give up on your projects, as QPC2 is certainly fast enough to allow 3D animations in perspective..... Steve.
-
- Aurora
- Posts: 890
- Joined: Mon Nov 24, 2014 2:03 pm
Re: 3D perspective animation
Hi again Tiny,
I think I know why you had problems with the playability....
There is a typo on line 4870 which should read ' INK 5: Print mi ' etc...
The white coordinates are for the drone pod, and the pale blue ones correspond to the iceberg ! Sorry I forgot to mention that in the banner page....
No wonder you had problems using the instrument panel, so thanks for the report !
Good luck landing...
Steve.
_______________
I think I know why you had problems with the playability....
There is a typo on line 4870 which should read ' INK 5: Print mi ' etc...
The white coordinates are for the drone pod, and the pale blue ones correspond to the iceberg ! Sorry I forgot to mention that in the banner page....
No wonder you had problems using the instrument panel, so thanks for the report !
Good luck landing...
Steve.
_______________
-
- Aurora
- Posts: 890
- Joined: Mon Nov 24, 2014 2:03 pm
Re: 3D perspective animation
Hi Folks,
Here is the program modified for 'Tiny's comments, also amended to compile OK using Turbo sms code, (data_area 138ko).
Steve.
_________________________________________________
Here is the program modified for 'Tiny's comments, also amended to compile OK using Turbo sms code, (data_area 138ko).
Steve.
_________________________________________________
Re: 3D perspective animation
Hi Steve
I had a tinker with your program to run with QPC11 emulator on my fast Platform.
Took awhile to get used to but hey!
Thanks for this diversion Steve… my Tinkering with your code.
1003 WINDOW 512,256,40,40: CLS : REMark BBQL Window 512,256,0,0
1026 CSIZE 3,1: AT 2,5: PRINT '3D QLander setup...': CSIZE 0,0
1027 AT 8,10 : PRINT 'Line 150... LET PC=0 for emulators... or 1 for QL systems'
1028 AT 10,10 : PRINT 'Tested on QPC2(fast) & SGC under QDOS(!) or SMSQ/E(slow)'
1029 AT 12,10 : PRINT "Easier to play on QL systems: (Less 'precise' for speed!)"
1030 AT 14,16 : PRINT '8 colours, so Not for monochrome monitors..'
1031 AT 16,20 : PRINT 'HIT any key...or (ESCape to quit).': PAUSE
1186 DEFine PROCedure draw_animation
1187 LOCal loop,kt,ktc,kth,ktb,f
1188 INK 7: CSIZE 3,1: AT 9,10: PRINT'...Go...': CSIZE 0,0 : OVER 1
1189 AT 1,20: PRINT 'You patrol back & forth in a helicopter.'
1190 AT 2,20: PRINT "Fly the white 'pod' onto the blue iceberg"
1191 AT 3,24: PRINT 'Avoid the green explosive mine...'
1192 AT 4,20: PRINT 'Use Left/Right keys for x coordinates'
1193 AT 5,20: PRINT 'Use Up/Down keys for y coordinates'
1194 AT 6,24: PRINT 'Use < > keys for z coordinates'
1195 AT 8,24: PRINT 'Try to improve your timings...'
1196 AT 9,20: PRINT 'Try using NO instruments if you Dare..': OVER 0: PAUSE -1
1426 DEFine PROCedure crosswires(qi)
1434 FOR loop3=0 TO 1*start
1435 :
1436 IF KEYROW(1)= 2:px=px-p
1437 IF KEYROW(1)= 16:px=px+p
1438 IF KEYROW(1)= 4:py=py+p
1439 IF KEYROW(1)=128:py=py-p
1440 IF KEYROW(2)= 4:pz=pz+.1
1441 IF KEYROW(7)=128:pz=pz-.1
Note: Conventional Graphic Keys - use Left Right cursors for x, use Up Down cursors for y, use Less & Greater than signs for z.
QBITS
I had a tinker with your program to run with QPC11 emulator on my fast Platform.
Took awhile to get used to but hey!
Thanks for this diversion Steve… my Tinkering with your code.
1003 WINDOW 512,256,40,40: CLS : REMark BBQL Window 512,256,0,0
1026 CSIZE 3,1: AT 2,5: PRINT '3D QLander setup...': CSIZE 0,0
1027 AT 8,10 : PRINT 'Line 150... LET PC=0 for emulators... or 1 for QL systems'
1028 AT 10,10 : PRINT 'Tested on QPC2(fast) & SGC under QDOS(!) or SMSQ/E(slow)'
1029 AT 12,10 : PRINT "Easier to play on QL systems: (Less 'precise' for speed!)"
1030 AT 14,16 : PRINT '8 colours, so Not for monochrome monitors..'
1031 AT 16,20 : PRINT 'HIT any key...or (ESCape to quit).': PAUSE
1186 DEFine PROCedure draw_animation
1187 LOCal loop,kt,ktc,kth,ktb,f
1188 INK 7: CSIZE 3,1: AT 9,10: PRINT'...Go...': CSIZE 0,0 : OVER 1
1189 AT 1,20: PRINT 'You patrol back & forth in a helicopter.'
1190 AT 2,20: PRINT "Fly the white 'pod' onto the blue iceberg"
1191 AT 3,24: PRINT 'Avoid the green explosive mine...'
1192 AT 4,20: PRINT 'Use Left/Right keys for x coordinates'
1193 AT 5,20: PRINT 'Use Up/Down keys for y coordinates'
1194 AT 6,24: PRINT 'Use < > keys for z coordinates'
1195 AT 8,24: PRINT 'Try to improve your timings...'
1196 AT 9,20: PRINT 'Try using NO instruments if you Dare..': OVER 0: PAUSE -1
1426 DEFine PROCedure crosswires(qi)
1434 FOR loop3=0 TO 1*start
1435 :
1436 IF KEYROW(1)= 2:px=px-p
1437 IF KEYROW(1)= 16:px=px+p
1438 IF KEYROW(1)= 4:py=py+p
1439 IF KEYROW(1)=128:py=py-p
1440 IF KEYROW(2)= 4:pz=pz+.1
1441 IF KEYROW(7)=128:pz=pz-.1
Note: Conventional Graphic Keys - use Left Right cursors for x, use Up Down cursors for y, use Less & Greater than signs for z.
QBITS
- Attachments
-
- 3DLander.jpg (18.27 KiB) Viewed 2012 times
-
- Aurora
- Posts: 890
- Joined: Mon Nov 24, 2014 2:03 pm
Re: 3D perspective animation
Hi Qbits,
Yes, your suggestion is certainly conventional for QWERTY keyboards.
But some of us use foreign keyboards, such as AZERTY, where the '<' and '>' keys are on the same 'shifted' location !
So, after coming unstuck on my french QPC2, for compatibility reasons, I chose the setup I did.
But azerty users may wish to adopt your suggested keyings, especially as other programs habitually use those keys...
Thanks for including the extra explanatory text too ! For the moment I will wait before posting a new version, in case other changes are necessary.
(3D QLander is mainly an experimental 'demo', rather than a fully fledged 'game'. I will try out several new developments soon, such as 'articulating' objects ....)
Steve.
______________
Yes, your suggestion is certainly conventional for QWERTY keyboards.
But some of us use foreign keyboards, such as AZERTY, where the '<' and '>' keys are on the same 'shifted' location !
So, after coming unstuck on my french QPC2, for compatibility reasons, I chose the setup I did.
But azerty users may wish to adopt your suggested keyings, especially as other programs habitually use those keys...
Thanks for including the extra explanatory text too ! For the moment I will wait before posting a new version, in case other changes are necessary.
(3D QLander is mainly an experimental 'demo', rather than a fully fledged 'game'. I will try out several new developments soon, such as 'articulating' objects ....)
Steve.
______________
Re: 3D perspective animation
Like you I use a "foreign" keyboard. Mine is a Swiss layout, which is a QWERTZ mixture of German and French (Does this work for Italian and Romansch typists?). It also has the >< symbols on the same key.by stevepoole » Thu Jan 06, 2022 2:37 pm
But some of us use foreign keyboards
I like the idea that Britain's imperial past dictates that keyboards that are not English are, in some way, sort of foreign.
What reinforces that view, I suppose, is that the majority of popular programming languages are in English.
Looking up non-English programming languages led me to a webpage titled "Top 10 dying programming languages". I was not surprised to see that the language I am trying to learn (BASIC) is in that list, at no 1, which is rather sad.
Years ago Tony Tebby wrote a proposal to develop a "self documenting" language that he named Metalog. It is a pity he never actually produced it.
Despite the apparent uselessness of learning BASIC, I am going to carry on studying "Liberated SMSQE BASIC".To that end I wish to ask forum members a number of questions on Qliberated BASIC. I will be creating a new topic to do this.
I finally managed to land (I am not sure how I did it), and prompted by qbits' post, I wrote a short program to test the instruction KEYROW, because it is not an instruction I have used yet. On my system KEYROW behaves in an odd way (ie not as described in various manuals) but it does seem to be a more responsive way of reading a keyboard.
Last edited by Tinyfpga on Fri Jan 07, 2022 4:12 pm, edited 1 time in total.
- NormanDunbar
- Forum Moderator
- Posts: 2477
- Joined: Tue Dec 14, 2010 9:04 am
- Location: Buckie, Scotland
- Contact:
Re: 3D perspective animation
Tinyfpga wrote:I like the idea that Britain's imperial past dictates that keyboards that are not English are in some way, sort of foreign.
What reinforces that view, I suppose, is that the majority of popular programming languages are in English.

I learned BASIC back in the early 1980s on a Cromemco in college. Mind you, I had taught myself BASIC by reading Personal Computer World magazine when I didn't even have a computer! Then I eventually boaught a ZX-81, and it used a different version, but I know enough to get me going. Then I went to college to do IT.Tinyfpga wrote:Looking up non-English programming languages led me to a webpage titled "Top 10 dying programming languages". I was not surprised to see that the language I am trying to learn (BASIC) is in that list, at no 1, which is rather sad.
Alongside BASIC, I learned COBOL on a Systime 11-750 (VAX 11-750 clone) mini computer. That stood me in good stead in various placements and for 11 years in my first job out of college. COBOL on an ICL 1966 mainframe under George 2, then on an ICL 2945 under VME. COBOL has been dying for decades, and yet, there are still more COBOL transactions every day than there are Google searches. (Apparently!)
BASIC isn't going anywhere either.
By the way:
Q. What do you call someone who speaks three languages?
A. Trilingual.
Q. What do you call someone who speaks two languages?
A. Bilingual.
Q. What do you call someone who speaks one language?
A. British.
(Dilwyn excepted, he speaks at least two!)
Cheers,
Norm.
Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Author of Arduino Software Internals
Author of Arduino Interrupts
No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Re: 3D perspective animation
No, three! When I was there he made "Labskaus" for me, and pronounced it perfectly. So, add (a bit) GermanNormanDunbar wrote:(Dilwyn excepted, he speaks at least two!)

7000 4E75