Object-Oriented Graphics Programming in C++ (eBook)
510 Seiten
Elsevier Science (Verlag)
978-1-4832-6843-9 (ISBN)
Object-Oriented Graphics Programming in C++ provides programmers with the information needed to produce realistic pictures on a PC monitor screen. The book is comprised of 20 chapters that discuss the aspects of graphics programming in C++. The book starts with a short introduction discussing the purpose of the book. It also includes the basic concepts of programming in C++ and the basic hardware requirement. Subsequent chapters cover related topics in C++ programming such as the various display modes; displaying TGA files, and the vector class. The text also tackles subjects on the processing of objects; how the ray tracing process works; how to put the program together and compile and run it; and animation. Computer programmers will find the book very useful.
Front Cover 1
Object-Oriented Graphics Programming in C++ 4
Copyright Page 5
Table of Contents 8
Dedication 6
Acknowledgements 7
Chapter 1. Introduction 14
Hardware Considerations 15
Graphics Techniques 17
Object-Oriented Mathematics 19
Ray Tracing 19
Animation 22
Pictures from Kodak CD-ROMs 23
Chapter 2. Display Modes: VGA, VESA, Super VGA and Undocumented 24
A Little History 25
Standard VGA Modes 28
BIOS Function for Writing Pixels 31
Undocumented VGA Display Modes 32
More History 36
VESA Super VGA Display Modes 37
Proprietary Super VGA Display Modes 42
Programming without Sufficient Information 42
Chapter 3. Selecting Colors with
50
Using an Octree 52
Structure of an Octree Node 53
Creating the Octree 53
Inserting Color Data in a Node 55
Reducing the Size of an Octree 57
Setting the VGA Palette 58
Displaying Pixels on the Screen 60
Chapter 4. Displaying TGA
62
The Targa File Format 62
The DISTGAC.C Program 64
Selecting á File for Display 80
Processing the Picture File 82
Gamma Correction 83
Setting the Display Mode 84
Displaying the Picture 85
Using Object-Oriented Programming 86
Classes and Constructors 87
Derived Classes, Inheritance and Virtual Functions 111
Chapter 5. Displaying Four Pictures
116
Selecting Files for Display 116
Displaying the Selected Files with the STB Powergraph X-24 125
Displaying the Selected Files with the Diamond Speedstar 24X 127
Chapter 6. Saving and Restoring
134
The .PCX Header 135
Run Length Limited Encoding 141
Displaying a 24-Bit Color .PCX File with the STB PowerGraph X-24 142
Displaying a 24-Bit Color .PCXFile with the Diamond Speedstar 24X 151
Converting á Targa File to
151
Chapter 7. The Vector Class 162
Coordinate Systems 163
Vectors 163
Vector Header File 164
Using Templates 166
Vector Constructors 167
Vector Addition and Subtraction 178
Vector Products 181
Vector Relationships 183
Normalizing a Vector 184
Maximum and Minimum of Two Vectors 185
Length of
185
Vector Rotation 186
Displaying Vector Data: Friends to a Class 187
Chapter 8. Ray Tracing Language
190
Philosophy of the Scene Description Language 191
The get_string Function 193
The get_float_vector and
196
Basic Input File Structure 197
Textures and Colors 201
Additional Predefined Textures 206
Scene Basics 207
The Observer 208
The LAMP Command 209
Primitive Objects 210
Clipping Commands 219
Bounding Boxes 222
Use of Instances 222
Chapter 9. Processing Objects with Object-Oriented
224
Object Data Definition 224
Constructors and Destructors 226
Virtual Functions, Overloading, and Overriding Functions 227
Chapter 10. Ray Tracing 232
Ray Tracing Geometry 232
The trace Function 233
Specular Reflection 238
Transparent and Semi-transparent Objects 240
The Intersect Function 241
Chapter 11. Spheres 246
Intersecting á Ray with a Sphere 247
Normal to a Sphere 249
Practical Application 250
Chapter 12. Planes and Polygons 254
Intersection of á Ray with a
254
Polygons 256
Chapter 13. Boxes 268
Intersection of á Ray and a Box 268
Chapter 14. Rings and Circles 274
Intersection of á Ray with a Ring or Circle 274
Chapter 15. Quadric Shapes, Cones,and Cylinders 276
Intersecting a Ray with a
277
Normal to a Quadric 279
Practical Application 279
Cones 285
Cylinders 288
Chapter 16. Constructive Solid
292
Problems with Ray Tracing CSG 292
The Clipping Technique 293
Getting Clipping Data 293
Testing Whether or Not an Object Location Is Clipped 297
Chapter 17. Textures and Surfaces 300
The Texture File 302
Three-Dimensional Noise 316
One-Dimensional Noise 317
Cycloidal and Spherical Functions 318
Turbulence Functions 319
Triangle Wave Function 320
Ripples 320
Interpolating Between Colors 320
Special Textures 322
Chapter 18. The Ray Tracing Program 324
Compiling and Running 324
Ray Tracing Program Details 326
Linked Lists 327
Further Details of the Data Collection Process 328
Getting Object Data 328
Getting Color Data 329
Getting Vectors 329
Intersections 329
Making Bounding Boxes 329
Moving Instances 330
Finding a
330
Moving an Instance 331
Mode Setting and Plotting 331
Obtaining the Display of Available Data Files 331
Viewing Object Information 331
Tracing a Ray 332
The main Program 332
Chapter 19. Animation 334
A Demonstration 335
Doing Better with What We've
354
Using Sprites 354
Using the Computer to Generate Animation Frames 355
Converting to Television 355
Chapter 20. Using Pictures from
358
Using Tempra Access 359
What to Do with Your New Targa Files 361
Appendix A: RAYTRACE.H Header File 364
Appendix B: RAYTRA CE. CPP File 378
Appendix C: Color Definitions 452
Appendix D: Ray Tracing Data Files 468
Index 508
Erscheint lt. Verlag | 10.5.2014 |
---|---|
Sprache | englisch |
Themenwelt | Mathematik / Informatik ► Informatik |
Mathematik / Informatik ► Mathematik ► Angewandte Mathematik | |
ISBN-10 | 1-4832-6843-8 / 1483268438 |
ISBN-13 | 978-1-4832-6843-9 / 9781483268439 |
Haben Sie eine Frage zum Produkt? |
Größe: 36,8 MB
Kopierschutz: Adobe-DRM
Adobe-DRM ist ein Kopierschutz, der das eBook vor Mißbrauch schützen soll. Dabei wird das eBook bereits beim Download auf Ihre persönliche Adobe-ID autorisiert. Lesen können Sie das eBook dann nur auf den Geräten, welche ebenfalls auf Ihre Adobe-ID registriert sind.
Details zum Adobe-DRM
Dateiformat: PDF (Portable Document Format)
Mit einem festen Seitenlayout eignet sich die PDF besonders für Fachbücher mit Spalten, Tabellen und Abbildungen. Eine PDF kann auf fast allen Geräten angezeigt werden, ist aber für kleine Displays (Smartphone, eReader) nur eingeschränkt geeignet.
Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen eine
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen eine
Geräteliste und zusätzliche Hinweise
Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.
aus dem Bereich