3Д БУМ

3Д принтеры и всё что с ними связано

Going flBQVE AND Beyond

W

ell, you made it. By now you should have a greater understanding of one of the most important parts in a 3D game, the 3D model.

Using the information in this book, you can now load, display, and animate several different types. No longer will you be stuck with a substandard model format or even be stuck coding in vertices and texture coordinates by hand!

Now that you know how to use these 3D models, you can recruit artists to begin making the content for your new game, freeing you to work on the programming aspects. You can fix those weird intermittent crashes every game seems to have, or maybe you can work on some cool new features to blow your audience out of their seat.

Even if you want to use a format that is not covered in this book, the information that you have just learned about will still prove valuable. The basic parts of a 3D model file—vertices, texture coordinates, and bones or keyframes—are found in nearly every format. AH you need to do is search around for a format spec sheet to find out how the file is organized and set to work.

Good starting places to find papers detailing different formats include Wotsit’s Format (http://wotsit. org), the Graphics File Format Page (3Dhttp://www. dcs. ed. ac. uk/home/mxr/gfx/3d-hi. html), and the “For Programmers” section of ziron. com (http://www. ziron. com/links/ forprog. htm). Other good places to start looking include the Web site of the manufacturer of the accompanying program, and even your favorite search engine such as Google (http://www. google. com).

Best of all, you can use your new-found skills to develop a file format that fits your needs exactly. Never again be stuck wishing that your format supported embedded textures, or that it used skeletal anima­tion instead of keyframes; now you can design your own file type, with just what you need.

This book is by no means the limit of your 3D adventures. New 3D model innovations are popping up each day, making games more realistic and more fun to play. Start taking a closer look at your favorite

games; chances are you will see something that makes you say, “I wish my game could do that.” Now, starting with the knowledge you have gained from this book, you can make it happen. Using the basic principles of skeletal animation, you can create realistic “ragdoll” systems. Ragdoll characters and other models move more realistically around the envi­ronment than traditional. From players sliding down hills, to the dead bodies of your defeated foes tumbling end over end into the bottomless pit, your ragdoll system can generate an unlimited supply of realistic animations on the fly. All without requiring any special animations or efforts from your poor, overworked, underpaid, stressed out artists.

Are your artists too busy to create variations for each animation such as walking or jumping? Perhaps you need many animations that are very similar to each other? Sounds like its time for a procedural animation system. A procedural animation system will allow you to vary anima­tions on the fly. Your characters can finally reach toward different spots on a table, without requiring your artists to create a different anima­tion for every reach; instead, the artist creates a generic animation.

This animation is then modified by your program to go in the direc­tion, or perform the exact move you want. Another application of a procedural animation system is to create more realistic and varied animations to break the monotony seen in most games. Everyone knows that a real person does not always walk at exactly the same speed in exactly the same way, so why should game characters? Using a procedural animation system, you can modify the speed, and even the appearance of the walk slightly to give it some variation.

Although these applications may seem subtle, they can greatly enhance a gamer’s experience.

This is only the tip of the iceberg. There are many other cool and useful things you can do with your models and their associated code, even without enlisting the help of a talented artist. The sky’s the limit.

One last thing before you run off to start work on your new game. Don’t forget to check out the book’s Web site at http:// books. codershq. com. Here you can find additional supplemental code, errata, even spec sheets and code for loading model formats not discussed here. Also available on the site are ways to contact people if you get stuck, or need help flushing out that elusive bug in your code as well as links to papers and information that can help you create some of the extra things talked about briefly in this ending chapter.

There are even links to free 3D models and data that you can use in your games and programs.

Okay, let’s get cracking, the game world is waiting for your new innova­tions, have fun.

For More Information

If you want to go above and beyond the call of duty and implement features beyond what is detailed here, there are a few sites you should check out as well as a few books to look into. First the links:

■ http://www. opengl. com: At this official site, you can find out anything that deals with OpenGL. From a detailed description of each and every function, to news on OpenGL related topics, to updated drivers and information on new versions of OpenGL, this site contains it all.

■ http://nehe. gamedev. net: The place to go to learn the basics of OpenGL. Jeff (NeHe) Molofee has created a wonderful site filled with tutorials, demos, and news pertaining to OpenGL. Many new programmers cut their teeth on OpenGL program­ming at this very site.

■ http://developer. nvidia. com: At nVidia’s developer’s site, you can find information to help you optimize your 3D model rendering and other graphics code. At this site, you can find white papers on everything from new API features, to special effects, to card specific optimizations. Definitely a site every graphics program­mer should visit regularly.

■ http://www. ati. com/developer/index. html: Like nVidia, ATI also has a section of their site tailored to developers. Here you can find information related to the ATI card and its features, as well as how to use it within your programs.

■ http://www. gamedev. net: One of the premier game development sites on the Internet. Gamedev. net contains many articles and references for programmers of all skill levels. The forums at Gamedev. net are also very active and are full of knowledgeable people who can help you out if you come across a problem you cannot solve.

■ http://www. flipcode. com: Another great game development site, Flipcode caters more to the intermediate and advanced crowd.

Also with a myriad of tutorial and articles, as well as a fairly active forum, Flipcode should definitely have a space in your bookmarks.

■ http://www. gamasutra. com: This site contains many types of ar­ticles, from technical articles on very specific subjects to game post-mortems that detail what went right and wrong within the development process of a certain game. This is another must — visit site for intermediate and advanced game developers.

■ http://www. gametutorials. com: Game tutorials is an excellent place to learn about specific topics in game development and pro­gramming in general. Although mostly aimed at the beginning game developer, there is something for nearly everyone. Tutori­als are in the form of source code with very extensive comments to explain what is going on and how it works.

Here are my favorite books on the topic:

■ OpenGL Game Programming (Premier Press, ISBN 0761533303):

A good intro to OpenGL game programming created by some of the staff of Gamedev. net. If you need to brush up on your OpenGL skills, this is the book to get. It even creates a small engine and game that you can expand on.

■ OpenGL Programming Guide, aka The Red Book (Addison-Wesley Publishing, ISBN: 0201604582). The Red Book is a must for any serious OpenGL programmer. It goes through the features of OpenGL in an easy-to-understand manner complete with ex­ample code and demos.

■ OpenGL Reference Manual, aka The Blue Book (Addison-Wesley Publishing, ISBN: 0201657651). Another essential book for when you are dealing with OpenGL. The OpenGL Reference Manual contains everything there is to know about the standard­ized OpenGL library. This book is aimed more at the intermedi­ate and advanced folks, rather than beginners.

■ Game Programming Gems Series (Charles River Media). This excel­lent series of books is aimed at the advanced crowd. These books contain everything from language tips and tricks to articles on AI. They also contain many articles dealing with 3D models and worlds, including topics such as mesh optimization, cell shading, shadowing, and progressive meshes.

What’s on the CD

The CD contains many programs that will help you as you build your next 3D game. First and foremost are the code and example demos that show you how to load and use every format in this book, as well as mini­demos showing off some of the concepts such as skeletal animation and linear interpolation. All of the code and demos that go with the text are found in the /Code/Chapter/ directory, where X is the chapter number.

Next comes a tool that will make sure you can run all of these demos. glSetup is a tool that will ensure that your computer contains the correct OpenGL drivers for your specific video card. This program will make sure you have the latest drivers for your card, even if your card is a bit outdated by industry standards. glSetup can be found in the /Programs/glSetup directory on the CD.

In order to use 3D models, someone must create them, either you or another artist. To help you or your artist along various modeling programs, both shareware and freeware are included:

■ MilkShape 3D is one of the most popular shareware 3D model­ers available. With its capability to import and export many game specific formats, MilkShape3D (http://www. milkshape3d. com) is a must-have for any independent game developer. Get a taste of it by installing the 30-day trial included on the CD, which can be found in the /Programs/MS3DTrial directory.

■ Another useful modeler is GMax. GMax is a free version of Discreet’s (http://www. discreet. com) popular 3D Studio Max modeling package that is specifically tailored to games. Many new games even ship directly with GMax and the needed plug-ins for the specific games. It is found in the /Programs/Gmax directory.

■ Recently open-sourced, Blender (http://www. blender. nl) is a powerful and free modeling package that will export in several useful formats. It can be used to create amazing 3D models and scenes. The installer can be found in the /Programs/Blender directory and the source code can be found in the /Programs/ Blender/Source directory.

■ 3D Canvas (http://www. amabilis. com) is created and sold by Amabilis Software. 3D Canvas uses an intuitive drag-and-drop method for creating and editing models. There are several

versions of 3D Canvas with prices starting at free. The free version is what you will find on the CD at /Programs/3DCanvas.

■ Anim8or (http://www. anim8or. com) is another small 3D package.

It can be used to create low-poly models for games and other applications. It is free and can be found in /Programs/Anim8or/ directory on the CD.

Sometimes you need to convert between different file formats in order to use specific models in your programs. Deep Exploration is the program you need here. Created by Right Hemisphere, Deep Explora­tion offers a drag-and-drop interface and can convert between many file formats, both 2D and 3D. Deep Exploration can be found in the /Programs/DeepExploration/ directory.

To make your models less boring, you need to create textures to put on them. PaintShop Pro (www. jasc. com) and the gimp (www. gimp. org) are two of the best programs for doing just that. The demo version of PaintShop Pro can be found in the /Programs/PSP/ directory and the full, free version of gimp is located in the /Programs/Gimp/ directory.

Because you learned about using Half-Life (http://www. valvesoftware. com) models in association with the MDL library released with the Half-Life SDK, it is only reasonable that you can find the rest of the Half-Life SDK on the CD. Using this SDK you can create your very own Half-Life modification and try to attract some of the thousands of players that fire up the game every day to play their favorite modifications.

The /Extras/HLSDK/ is where you want to look for this.

Last, there’s the DirectX SDK (http://www. microsoft. com). Although none of the demos included actually use DirectX, many game engines do. You may want to port some of the demos included here over to DirectX in order to use them in your own engines and games. To do so, you will need this SDK. It’s a big file, so if you are stuck without broadband, grabbing the SDK from /Extras/DirectXSDK/ will save you a lot of download time.

Для любых предложений по сайту: [email protected]