Hi Thorsten, I had the idea for this project after designing a gimbal for an antenna on a satellite at work. I had to work with 3D transformation matrices for the beam pointing, especially rotation matrices. Having this renewed knowledge of all the mathematics involved in 3D transformation I felt ready for a 3D program, something I always wanted to do since I first put my hands on a zx81 a long time ago.
I started with implementing a few basic 3D routines in Superbasic. When everything was working, I switch to "C" programming for more speed. I wrote the complete 3D engine without even compiling my code once. Then I wrote the point and line algorithm also in C. After correcting all the bugs that pop out during compiling, I tried the speed of my new line drawing capabilities by drawing a few hundred lines on screen. I told myself "Basic is slow, my C version will be much faster!" To my surprise, my version was 2X slower than basic. This was a bad news. Line drawing must be much faster than basic for this to work. My next version was in assembler. I was hopping to get a 10X speedup compare to the C version, I got 12X. Good. I also wrote the line removal routines in assembler. This was last Friday. I was ready to test the engine. Took me half a day to remove the bugs. It worked but the speed was terrible, but I was expecting this. The reason this time was the speed of the double precision floating point calculations in C. Again, Superbasic is faster than C (But C has more precision). In a 3D engine, there is a lot of trigonometric functions involved and these are quite slow. So again, I recoded everything using integer arithmetics with new machine code trigonometric function. That is when I got 30 frame per second... BTW when I am done with this, I will put the 3D engine in the public domaine, if anyone wants to play with it. Sorry for the long mail. François On 2012-09-24, at 09:05, thorsten herbert wrote: > > Hi Francois, > > compliments and please keep on going your project. Any more details you can > let us know about? May about the 3D engine .. how did you achieve it? > > Very curious and keen to find out more ... > cheers, > th > _______________________________________________ > QL-Users Mailing List > http://www.q-v-d.demon.co.uk/smsqe.htm > _______________________________________________ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm
