Preface

I originally was a user of graphics systems. My formal education was as a chemical enginee, specializing in the simulation of chemical plants. However, when I graduated—in the early 1980s—there was no real interface other than a dump of numbers. As a user of such systems I always found that I could learn a lot more about a system if I could plot the results. If there was no plotting system, I wrote a routine to plot out data, using a line printer. The first company I worked for hired me to write the visual front end for its chemical plant simulation system. I was going to write a line-graphic interface using the built-in line characters found on the video adapter of most IBM-compatible PCs. This was practically state-of-the-art back then! Luckily for me that was just before oil prices dropped, which meant that oil companies (our major customers) soon halted new construction of chemical plants. The ripple effect soon had me out of work, since no one was buying my company’s expensive software.

This was actually a godsend (after I got over the shock of being laid off). I made a career choice to pursue computer graphics rather than get a job in a chemical plant somewhere. I was soon working as a computer consultant, happily helping clients solve their data analysis problems. After a while I ended up working for what was then the hottest company in PCs, Lotus Development Corporation. Remember, this was in the mid-1980s, and Lotus was much larger than Microsoft! Working at Lotus was an epiphany. People working there tested the code that the programmers wrote! Such an environment! When I was later asked whether I wanted a full-time job as a programmer, I jumped at the chance. I happily spent the next nine years working on various projects, usually on the graphics side of things. When I worked on Lotus 1-2-3, I decided that I had to try to force the product to have a better charting system. I was familiar with UNIX workstations and the software that ran on them. Even though there wasn’t yet a PC that could run in 24-bit color in 1024 ˘ 768 resolution, I could clearly see that this was the direction things were heading. It wouldn’t be long before PCs would be able to perform 95 percent of the work of a then current $40,000 workstation. I set my sites on better color support, higher-resolution display support, and 3D graphics. None of the other competing products at the time had support for these items.

About this time Lotus was getting beaten up for lack of a Windows spreadsheet. Windows was getting pretty widely accepted. It had an API that supported graphics at any resolution (so long as it wasn’t too high), and it had better color support, but it didn’t have 3D graphics. Almost, but not quite there yet. I played around with writing my own dynamic 3D graphics routines, but when you tacked on the Windows overhead, they ran unacceptably slowly. I soon read that Microsoft had contracted with Silicon Graphics, Inc., to write a portable 3D graphics interface that would work on a Windows platform. SGI had pretty much the entire UNIX 3D graphics market and was an engineering company. This meant that it built the solution, then went looking for problems to solve. The problems solved were all manner of visualization problems. All I had to do was wait a few years to see what developed. What happened was Windows NT, a 32-bit operating system. This was the first requirement for a portable graphics language. Next came the 3D graphics API itself. SGI had migrated its native API into something called OpenGL, a portable, open-architectured, extensible 3D graphics API. I had experienced OpenGL on workstations, but now that power was going to the PC! This was the moment I had been waiting for. With Windows NT 3.51 with its native OpenGL support, I quickly wrote a collection of 3D demos that far outsurpassed anything that was running on a PC. Armed with the demos and with projections about how 3D was going to be important to everybody in the next few years, I went before the VP of Desktop Products and stated my case. It was probably the terrain map connected to a SpaceBall that lost my case. Somehow using this weird ball-like thing on my desk to control the flyover of a landscape made me seem more like a computer graphics zealot than a spreadsheet programmer. I made my pitch to a few product managers who actually could see that in a few years, interactive 3D graphics would be important. I contented myself with writing a few magazine articles about virtual reality and 3D graphics, while wasting my time implementing more 2D business graphs using an inherited architecture from a long-defunct product, and waiting for a chance.

My chance came when Microsoft announced Windows 95. Buried in the product specs were OpenGL support and the reworkings of Windows to be a successful games platform. OpenGL was good. Being a gaming platform was better! This meant that there would be not only support for animated graphics but also better sound support and a new input system for things other than a mouse. I tried one last time at Lotus to get buyin, but at that time it was fighting a losing battle for market share, and there was little enthusiasm to make a radical leap and architect a new stellar graphics system. So I decided that I needed to devote more time to working on visualization tools and 3D graphics systems. It was time to quit and form my own consulting company.

About this time Addison-Wesley contacted me about writing a book about OpenGL programming for Windows. The results of that conversation are in your hands. It’s been a rocky path getting here. I’m very glad that some of my clients were patient when I disappeared for a few weeks before a writing deadline, even though I did mention beforehand that it probably would happen.

Microsoft has been twiddling with the OpenGL/Windows interface, so I continually had to make changes in chapters to keep the information current. The final thing to happen was the imminent release of OpenGL 1.1, which is an order of magnitude better in terms of rendering speed and support for writing faster applications. But since I wanted to write a book about fast 3D graphics, it was important to take a look at version 1.1 to see what it offered. And it does offer a lot! I’ve included most of the features that were added to version 1.1, so you should be all set when you’re ready to try it out.

Not all of the features of OpenGL are covered in this book. I didn’t want to rewrite the OpenGL Programming Guide, which already covers OpenGL’s features. This is a book about how to program OpenGL in a Windows environment, how to program it to be fast, and how you can make it easy to use OpenGL in your programs. I cover all the aspects of creating, viewing, and animating a scene. Specific tips along the way give you specific information about how to make your code as fast as possible. All the source code is included on the CD, so you can experiment with the examples on your own. The examples build on one another; by the end of the book you have most of the important features of OpenGL in one place and with a convenient wrapper about them that makes them easy to use. Feel free to pull ‘em apart and reuse whatever you like. I’ve tried to avoid letting any mistakes into the code, but that’s impossible, so watch out. If you find a problem with the code or the text or just want me to expand on some topic, drop me a line. Check out the README.TXT file on the CD for all the latest information.

I wrote this book because I believe that 3D graphics will be one of the most important features in computers in the next decade. It’s indescribable what you can demonstrate to people when you have a fast, interactive 3D environment. I’m doing my best to promote this conviction, and the book you hold in your hands is the best way that I know of to prove it to you as well. Now go and do something with it!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset