Popular contentToday's:All time:NavigationUser login |
Building a realtime Flash 3D animation (Part One)I posted last month, a new game I had just completed. One of the primary reasons for building this game was to try and get to grips with the new work-flows required in a 3D project. Over the next couple of posts, i'm going to take a look at how I achieved this, focusing on the end of game moon animation. I'm a beginner with all these 3d technologies, and it was very much a learning process, but one which was immensely satisfying also. I'll be taking a look, at Preparing models and textures, Collada file format, Loading into AS3/Flex, rendering with Papervision3D, and animating with Tweener. First up models... (read on) The first software i wanted to understand was 3D Modeling. Ive tried before to get to grips with these packages, and just struggled with the complexity of the menus. This time, I bought a training DVD from Gnomon Workshop, and settled in for a couple of evenings following through how the basic UI is structured, and the purposes of the main Panels. I would really recommend these DVD's its a great format to be able to follow along on your own computer while they talk you thorough each section. I had previously done few small experiments with Papervisions cube primitives, and really liked the feel of these 8bit sprites transported into a 3d world. In my experiments, though I had taken an existing sprite and generated the 3d cubes per pixel. This time i wanted to produce an actual model in a modeler, sticking with the Space Invader sprites as a guide ensured I had a relatively simple task for my first attempt. My first two attempts where disasters. Firstly I tried placing individual cube primitives in the same as i had done in code in my experiments. When i tried to render this though I got an effect like this It was about this time, that i also realized my approach to modeling was wrong. Really i was building over complex models by using so many primitives. What I really needed to do was to get to grips with extrude, scale and move tools. Next up I tried the following the advice but ended up with something like this Finally after many false starts I had my models - certainly not the most complex or inspiring of models - but simple enough to know when they are finished, something i think is vital when your trying to understand new areas. Keep it very simple.
The final stage was to texture these models. Again, i wanted i simple effect. Id decided as Papervison did not yet support lighting to 'bake' a simple texture, so it would appear to be shaded. This was fine for my needs with a (relatively) static camera. Baking refers to the process of producing a bitmap which can be applied to a model, which contains the lighting and shadows already applied. I think its used in modeling to speed up rendering, and producing things such as skin textures which can be manipulated via Photoshop to produce better results. To be honest my understanding is less than 100%, and its an area ive mentaly marked to revisit in greater depth next time. However for Papervison3d baking textures is useful, as it produces a nice PNG which you can apply directly to your model. And this is exactly what i did. In Maya the process is, Open Hypershade, select your model at object level, hold shift and select a material in hypershade. Finally go to the hyper shade menu and file->export as File texture. Your texture will then be directly in your project folder. I few times i had to manually adjust the texture placing to get correct results. I found using a check board texture really useful for this process, as you can see instantly how a texture is mapped across your model. The final stage of this process is exporting to the COLLADA XML format which papervison supports. In Maya you must obtain an exporter from feeling software as the inbuilt one does not work. When exporting I had a couple of false starts as i was choosing export selected - it should of been export all, as all my models are in the same scene on different layers. Other than that its a painless step, simply chose triangulate and include UV's. Following all this I have Two sets of files. One Collada xml file containing my models. And a folder of texture PNG's. Next up I'll look at how i brought these into Flex. |