FIRST 3D Application |
||||||||
After MAGIC101 enter beta, we found developers more care about to make a 3D applications for mobile devices. This paper will introducing basic ideas about to build up your first 3D application on mobile device. In this article, I assume you have experience on 3D application developing and already looked at MAGIC101 2D samples.First of all, you must ensure which type of '3D' you shuold use. Typically, there is two types of '3D' applications: 2.5D and Real 3D.As it's name, 2.5D games not realy a 3D game, but they looks like 3D games. DOOM, DUKE3D, Steel Warrior are all good samples of 2.5D games. They use sprits and other technique to speed up the game. For example there are no declining walls in DOOM, and you can't look up or down.Real 3D game, which is most common in popular PC or Console games today. They use triangle-meshes build-up the whole game world, Camera can place to every where and in any direction. Quake, Zelda64, Need of Speed 5 are all real 3D games.Real 3D games often needs much more device power. For 9210(<50Mhz ARM9), I think 2.5D games are more suitable. But on iPAQ(206Mhz StrongARM) a real 3D game can run smoothly. For 7650? I don't know, it seems 7650's chip still can't compare with iPAQ. But it has a realy small and cute screen(which can save much cycle for raster).MAGIC101 supports both 2.5D and Real 3D games. KXRacer is based on 2.5D technique and Mobile Pool is a real 3D game, they may looks ugly cause our artist haven't join these projects.In 3D games developing you'll meet more math theories. Most of them are float-number based. Unfortunately mobile devices's cpus are very week at that. To speed up, MAGIC101 use Fixed-Point-Number instead of Float-Point-Number. There are a lot of articles discuss on Fixed-Point math, so I'll skip that.In MAGIC101 Fixed-Point-Number type is MAGFIXED, which is a signed-32bit-integer decleared in MAGFixed.h. you can use FixMul(), FixDiv(), and other functions to operate at fixed point number. Many useful functions also can be found in MAGFixed3DTypes.h.Fixed number's arrange is very limited, if you're not very good at fixed-math, I suggest you keep your scens in -100.0~+100.0 and not excat to much( for exmaple, 0.00001), 0.01 shuold be fine.There is a Engine-Class MAGFXRaster take charges of most 3D functions. MAGFXRaster's reference can be found in MGAIC101 SDK Help later. Now let's build up our first 3D application step by step.Step1:Open MS-VC 6 and use MAGIC101 AppWizard to create a new MAGIC101 project for 9210. I assume your MAGIC101 SDK is installed to D:\MAGIC101 and your project located at D:\MAGIC101\Samples\First3D and name is First3D, app-symbol is F3D. Step2: Setup 3D environment
|
||||||||