DirectX 8 and Visual Basic Development Keith Sink - The ebook in PDF/DOCX format is ready for download now
DirectX 8 and Visual Basic Development Keith Sink - The ebook in PDF/DOCX format is ready for download now
com
https://ebookname.com/product/directx-8-and-visual-basic-
development-keith-sink/
OR CLICK HERE
DOWLOAD EBOOK
https://ebookname.com/product/visual-basic-game-programming-with-
directx-1st-edition-jonathan-s-harbour/
https://ebookname.com/product/ableton-live-8-and-suite-8-keith-
robinson/
https://ebookname.com/product/clearly-visual-basic-programming-
with-microsoft-visual-basic-2012-3rd-edition-diane-zak/
https://ebookname.com/product/cultural-tourism-research-methods-
first-edition-greg-richards/
Beginning ASP NET 4 5 Databases 3rd Edition Sandeep
Chanda
https://ebookname.com/product/beginning-asp-
net-4-5-databases-3rd-edition-sandeep-chanda/
https://ebookname.com/product/ring-shout-wheel-about-katrina-
dyonne-thompson/
https://ebookname.com/product/traffic-engineering-with-mpls-eric-
osborne/
https://ebookname.com/product/an-introduction-to-relational-
database-theory-4th-edition-hugh-darwen/
https://ebookname.com/product/women-who-love-psychopaths-inside-
the-relationships-of-inevitable-harm-with-psychopaths-sociopaths-
narcissists-2nd-edition-sandra-l-brown/
Ullmann s Fine Chemicals 1st Edition Barbara Elvers
https://ebookname.com/product/ullmann-s-fine-chemicals-1st-
edition-barbara-elvers/
DirectX 8 and Visual Basic
Development
Keith Sink
TECHNICAL EDITORS
Trademarks Andrew Indovina
All terms mentioned in this book that are known to be trademarks or service Joe Johnston
marks have been appropriately capitalized. Sams Publishing cannot attest to William McLoughlin
the accuracy of this information. Use of a term in this book should not be
TEAM COORDINATOR
regarded as affecting the validity of any trademark or service mark.
Lynne Williams
DirectX, DirectDraw, DirectShow, DirectSound, DirectMusic, DirectPlay,
DirectInput, Direct3D, DirectGraphics, Microsoft, Microsoft Visual Basic, and MEDIA DEVELOPER
Windows are registered trademarks of Microsoft Corporation. Dan Scherf
INTERIOR DESIGNER
Warning and Disclaimer Anne Jones
Every effort has been made to make this book as complete and as accurate as COVER DESIGNER
possible, but no warranty or fitness is implied. The information provided is on Gary Adair
an “as is” basis. The author and the publisher shall have neither liability nor
responsibility to any person or entity with respect to any loss or damages aris- PAGE LAYOUT
ing from the information contained in this book or programs accompanying it. Octal Publishing, Inc.
Contents at a Glance
Introduction
Index
Table of Contents
Introduction 1
Who This Book Is For? ..........................................................................1
What You Need to Know ........................................................................1
What Hardware and Software You Need ................................................1
How This Book Is Organized ................................................................2
Conventions Used in This Book ............................................................3
3 Animation Techniques 39
The Basics ............................................................................................40
The Model Sheet ............................................................................40
The Frame ........................................................................................40
The Cycle ........................................................................................41
Storyboards ......................................................................................41
Keyframes ........................................................................................42
Backgrounds ....................................................................................42
DirectX Objects ....................................................................................43
Frame Rates ....................................................................................43
Blits ..................................................................................................43
Sprites ..............................................................................................44
Drawing Surfaces ............................................................................45
Palettes ............................................................................................45
Rectangles ........................................................................................46
Clippers ............................................................................................46
Billboards ........................................................................................47
Techniques ............................................................................................48
Blitting ............................................................................................48
Page Flipping and Back Buffering ..................................................48
Palette Cycling ................................................................................49
Summary ..............................................................................................50
vii
CONTENTS
7 3D Geometry 103
3D Space Coordinate System ............................................................104
3D Objects ..........................................................................................105
Vertices ..........................................................................................106
Polygons ........................................................................................106
Faces ..............................................................................................107
Mesh ..............................................................................................107
Texture ..........................................................................................109
viii
DIRECTX 8 AND VISUAL BASIC DEVELOPMENT
Lights ............................................................................................109
Materials ........................................................................................109
Matrices ..............................................................................................111
Projection Matrix ..........................................................................112
View Matrix ..................................................................................112
World Matrix (World Transformation) ..........................................112
Summary ............................................................................................112
8 Direct3D 115
Direct3D Objects ................................................................................116
The Direct3D8 Class ....................................................................116
The Direct3DBaseTexture8 Class ................................................117
The Direct3DCubeTexture8 Class ................................................118
The Direct3DDevice8 Class ..........................................................119
The Direct3DIndexBuffer8 Class ..................................................123
The Direct3DResource8 Class ......................................................124
The Direct3DSurface8 Class ........................................................125
The Direct3DSwapChain8 Class ..................................................126
The Direct3DTexture8 Class ........................................................126
The Direct3DVertexBuffer8 Class ................................................127
The Direct3DVolume8 Class ........................................................127
The Direct3DVolumeTexture8 Class ............................................128
Creating 3D Applications ..................................................................129
Creating a Direct3D Application ..................................................129
Working with Vertices ..................................................................133
Working with Matrices ..................................................................137
Working with Lights ......................................................................142
Working with Textures ..................................................................146
Working with Meshes ....................................................................149
Summary ............................................................................................153
Lobby ............................................................................................343
GUID ............................................................................................343
Communication Models ......................................................................344
Peer-to-Peer ..................................................................................344
Client/Server ..................................................................................344
DirectPlay Events ..............................................................................346
A DirectPlay Peer-to-Peer Client ......................................................346
Assigning a GUID ........................................................................346
Initializing the DirectPlay Peer-to-Peer Client ............................346
Finding the Available Service Providers ......................................347
Finding the Game Host ................................................................347
Connecting to the Session ............................................................347
Managing the Session ....................................................................348
Sending Messages ........................................................................348
Closing the Session ......................................................................348
A DirectPlay Client/Server Connection ............................................349
Assigning a GUID ........................................................................349
Initializing the DirectPlay Client/Server Client ............................349
Finding the Available Service Providers ......................................349
Finding the Game Host ................................................................350
Connecting to the Session ............................................................350
Managing the Session ....................................................................350
Sending Messages ........................................................................351
Closing the Session ......................................................................351
Summary ............................................................................................351
Index 405
Another Random Document on
Scribd Without Any Related Topics
laughter and occasional jests came from the nobles and their women
clustered on the steps, but as Larry looked out over the crowd in the
Plaza he saw faces that were grim and intent. The threat of the
electronic rifles of the guards would keep the unarmed mob from
trying to aid the prisoners, but there was no doubt where their
sympathies lay.
Glancing up at the tyrants grouped on the temple steps, Larry
suddenly saw Colton. The former second officer of the Sky Maid now
wore the white and gold robes of a noble of Gral-Thala. Xylon kept
his promises! Colton flushed uncomfortably when his glance met
Larry's grim stare, quickly turning his eyes away. He looked
uncomfortable and ill-at-ease. Larry glanced at him again a few
minutes later and saw Colton staring at Diana's bound and
motionless form with definite misery in his eyes.
One of the nobles stepped to the front and began to address the
crowd. Shrill yells and catcalls drowned his words. The guards raged,
but the men in the front ranks of the mob were discreetly silent and
they could not reach or identify the culprits in the ranks behind.
Many of the nobles were muttering nervously among themselves,
showing definite signs of fear.
"There was never a scene like this in Pandonaria before!" Pyatt of
Kagan exulted from where he was bound beside Larry. "We may die,
but our death is likely to stir the people to such a pitch that the
revolt will soon come!"
Xylon, for all his faults, was made of sterner stuff than most of his
fellow nobles. He sneered down at the muttering crowd, then signed
to the officer commanding the guards.
"Pay no attention to the dogs," he commanded sharply. "Give these
three a taste of the whip before the flayers rip the skins from their
bodies. Begin with the girl."
A heavy-featured man in a black tunic stepped up to Diana, pulling
the lash of a heavy whip through his hands to test its suppleness.
Before he could strike there came a sudden interruption. A small car
had been speeding down the incline from the tunnel entrance and
now a gilded officer of the invaders leaped out and came running
across the Plaza.
"Great news, oh Xylon and nobles of Gral-Thala!" he shouted. "One
of our patrols has captured a great force of outlaw warriors and their
insect allies, who were moving in to raid our nearer caves. Some
more Earthlings are with them!"
"Good, by Gorton!" exulted Xylon. "We will delay the execution of
these three till the others are here to see it."
Larry's last hope was gone. He had remembered Ripon's promise to
come after them if they had not returned quickly, and in the back of
his mind had been the thought that the doughty scientist might yet
accomplish a rescue in some way. Now that hope had vanished. He
sighed, and beside him Diana sagged visibly in her bonds.
"Guess it's the end," she said. "Good bye, Larry!"
XVI
From where he stood on the scaffold, Larry could see a number of
the big transport cars coming down the incline. They were crowded
with prisoners and guards, and he caught the gleam of the hard
brown shells of Insect-men. Once unloaded from the cars, they all
formed up in columns and came quickly across the Plaza. Behind the
front rank of guards Larry saw Ripon, and some of the men from the
Sky Maid, and many whom he recognized as leaders among the
Lunarians of the Lost Caverns.
It was all over now. The prisoners trudged along like beaten men,
utterly disheartened although they were but thinly guarded. The
nobles grouped on the temple steps were laughing loudly, all their
nervousness of a moment ago gone before the reassurance of this
victory. Then, as the prisoners were halted in the Plaza directly
before the double line of soldiers that guarded the temple, an officer
beside Xylon leaned forward to point down at the commander of the
patrol that was bringing in the prisoners.
"That man wears the insignia of an Ensign of the first rank," he
shouted, "but there is no such man in the ranks of our officers!
There is treachery here!"
Before the man's words had died away, Crispin Gillingwater Ripon
had whipped a ray-gun out from under his cloak and smashed the
officer's chest into a charred pulp with the deadly blast of the rays.
In an instant the Plaza was a wild turmoil. The pretended prisoners
drew their hidden weapons. Those who had been masquerading as
guards, using the armor they had taken from the soldiers they
surprised and overwhelmed when they stormed the tunnel entrance,
threw the uniforms aside and charged into the fight. The rippling
crashes of the electronic guns rang out again and again, the murky
flashes of the Earth-men's death rays stabbed into the fray, and a
clicking horde of Insect-men charged home with their spiked clubs
swinging.
In an instant the Plaza was in a wild turmoil.... The rippling
crashes of the electronic guns rang out again and again. The
murky flashes of Earth-men's death rays stabbed into the
fray, and a clicking horde of Insect-men charged home with
spiked clubs swinging.
For the first few moments the fighting centered around the scaffold.
Xylon led a charge of picked men down to seize and keep the three
prisoners bound there, Ripon came storming through to effect a
rescue. When the mélee was over, Larry and Pyatt were free and
Xylon had retreated back to the temple steps, but Diana had
disappeared.
"We got the rest of the crew from the Sky Maid and all the men we
could collect at Chotan and crept up to the tunnel mouth," Ripon
panted as he thrust a ray-gun into Larry's hand. "We took the guards
by surprise and killed them before they could warn the valley
behind."
It had been a daring raid, and at first its sheer audacity had carried
it near to complete victory. Now the superior numbers of the guards
were beginning to tell, and more of the troops of Gral-Thala came
pounding up at the double. The crash of the electronic guns became
a steady roar, and bodies were thickly strewn about the blood-
smeared surface of the Plaza of the Four Virgins. Then, with a long-
drawn and sullen shout, the mass of watching Lunarians flung
themselves on the soldiery. Hundreds died, but the others tore the
guards to pieces with their naked hands and then snatched up their
weapons. The people of Gral-Thala had risen against their
oppressors at last!
With the uprising of the people, the battle ceased to be a fight and
became a massacre. The troops were selling their lives, as dearly as
they could, but thousands more citizens carrying improvised
weapons were pouring in from every street and the thing was only a
matter of time. Then, in the rear of the panic stricken mass of
nobles who were fleeing into the temple to make a last stand, while
the vengeful pack bayed at their heels, Larry suddenly saw Xylon!
The tyrant was standing beside one of the great stone columns that
supported the portico of the temple. He held the half naked body of
Diana before him as a shield. The girl's hands were still tied and she
could not pull away. A swarm of Insect-men, who were bounding up
the temple steps, halted as they saw Xylon hold an electronic pistol
to the head of their goddess.
"Keep back or she dies!" he shouted. "She is hostage for our safety!"
Larry lifted his ray-gun, and then lowered it again with a groan. He
dared not shoot with Diana's struggling body in the way. Nor had he
any doubt that Xylon would kill the girl without compunction if
attacked. Xylon began to edge back toward the temple door. Larry
still stood indecisive, the others seemed frozen in their places. Then
another white-and-gold figure darted out from the temple behind
Xylon. The renegade Colton twisted the gun from Xylon's hand!
The thing was over in an instant. Xylon released Diana and turned
on Colton with an oath, and the girl instantly dropped to the ground.
Steel flickered in the sunlight. Xylon drove a long knife home
between Colton's ribs, but before he could dart away Larry's ready
ray-gun struck him down with its blast. His quivering body rolled
slowly down the steps till the Insect-men reached it and literally tore
it into bloody bits.
XVII
The dying Colton was sinking fast. His face was gray as he looked up
with a faint smile at the others who were grouped around him.
"I never was much good," he said faintly. "Guess it just wasn't in the
blood. Gold always led me into twisted paths, and I couldn't resist
Xylon's offer. But it did something to me when I saw the way those
devils were going to torture the girl. Well—I guess I paid my debt at
the end."
"You've paid it—and you'll live to go back to Earth with us," Larry
said. Colton shook his head, his eyes glazing.
"Don't try to kid me. I'm cashing in my checks," he said—and died.
Now that it was all over, Larry felt very tired. He put one arm around
Diana, and leaned back against the base of the column. There was
still some intermittent fighting going on where mobs of vengeful
Lunarians had cornered some of their oppressors, but the victory
was won. Ripon looked about at the carnage with a satisfied smile
and them sheathed his ray-gun.
"It was a good fight!" he said. "I haven't had as much fun since the
time I wrecked a saloon in Port Mahon. Now, young feller, you just
take care of the lady here while I take a squad and get the radium
salts from the store-house."
"And the Sky Maid?" Larry asked.
"That sour-puss Masterson has been standing over the men with a
ray-gun in one hand and my last jug of rum in the other ever since
you left. All the repairs are finished. We start back to Earth as soon
as we can get our cargo aboard."
"Then the people of your planet will be saved?" Diana asked.
"They will be saved. And as soon as the Gray Death is checked I'll
come back for you. Then the Moon will have to get along without its
Goddess for a while."
"I'll be waiting," she said.
*** END OF THE PROJECT GUTENBERG EBOOK GODDESS OF THE
MOON ***
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com