📄 ch4.htm
字号:
to transfer over a modem connection.
<P>
<I>Interlaced images</I> are images that can be displayed in incremental
stages as they are being loaded. You've no doubt witnessed this
effect in Web pages when images go from blurry to clear as they
are being loaded.
<P>
More advanced features of the GIf89a format include hidden text
comments, multiple animation frame sub-images, and animation frame
rate, among others.
<P>
<I>Hidden text comments</I> are comments you can insert into an
image that aren't displayed. These comments are sometimes useful
for making notes about an image.
<P>
Java doesn't currently support all these features, namely animation,
but it supports enough of them to still make GIFs a very viable
format for image representation in Java games.
<P>
<CENTER><TABLE BORDERCOLOR=#000000 BORDER=1 WIDTH=80%>
<TR><TD><B>Note</B></TD></TR>
<TR><TD>
<BLOCKQUOTE>
The animation support in the GIf89a format consists of the capability to specify a sequence of images (frames) that are displayed in succession to give the illusion of movement. You can specify a frame rate, which determines how fast the frames are
displayed or animated.</BLOCKQUOTE>
</TD></TR>
</TABLE></CENTER>
<P>
<P>
I mentioned that the GIf89a format supports up to 256 colors,
which means that there can be less than 256 colors in an image.
GIF images can contain anywhere from 2 to 256 colors; the number
of colors impacts the size of the image greatly.
<P>
A <I>color palette</I> is a group of colors available to an image.
All 256-color GIF images have an associated color palette defining
the colors that the image can contain.
<P>
You can reduce the colors used in a GIF image by using a graphics
utility that supports the GIF format. You find out about some
of the popular shareware graphics utilities that support the GIf89a
format in the next section.
<P>
<CENTER><TABLE BORDERCOLOR=#000000 BORDER=1 WIDTH=80%>
<TR><TD><B>Note</B></TD></TR>
<TR><TD>
<BLOCKQUOTE>
When working with GIF images you have the ability to specify which colors make up the 256 color palette. Tweaking the color palette to fit the particular color needs of an image is referred to as palette optimization. Using palette optimization you can
usually get pretty good results with 256 colors.</BLOCKQUOTE>
</TD></TR>
</TABLE></CENTER>
<P>
<P>
If you want more detailed information about the GIF image format,
check out the All About GIf89a image format Web site at <TT><A HREF="http://members.aol.com/royalef/gifabout.htm">http://members.aol.com/royalef/gifabout.htm</A></TT>.
This site also contains a link to the original CompuServe GIF
image format specification, for inquiring minds that have to know!
Figure 4.1 shows what the All About GIf89a image format Web site
looks like.
<P>
<A HREF="f4-1.gif" ><B>Figure 4.1 : </B><I>The All About GIf89a image format Web site.</I></A>
<H2><A NAME="CreatingandEditingGraphics"><B><FONT SIZE=5 COLOR=#FF0000>Creating
and Editing Graphics</FONT></B></A></H2>
<P>
You've learned how to assess the graphical requirements for games
and the different types of game graphics, but you still haven't
really covered the specifics of how to create graphics. Unfortunately,
there is no simple explanation of how to create graphics. As in
all art forms, there is much about the subject that must be grafted
out of experience. However, I want to cover the basic techniques
of creating graphics for games, and then you can chart your own
course. Before getting into these techniques, however, let's take
a quick look at some of the shareware graphics utilities that
are available on the Web.
<H3><A NAME="GraphicsUtilities"><B>Graphics Utilities</B></A>
</H3>
<P>
Whether you create your own graphics or hire an artist, you will
need a graphics utility at some point in the graphics development
process. Even if you don't need to change the content of the graphics,
you often will need to resize or change the transparency color
of the images. A nice graphics editor is the most important tool
for developing and maintaining game graphics. Although you might
end up wanting to invest in a professional graphics editor with
a wider range of features, such as Adobe Photoshop, you can't
go wrong by starting out with a good shareware editor.
<P>
The rest of this section focuses on some popular shareware graphics
editors you can use to create and edit GIF images for Java games.
They all support the GIf89a graphics format and provide varying
degrees of image processing features.
<H4><B>Image Alchemy</B></H4>
<P>
Image Alchemy, by Handmade Software, is a very extensive graphics
editor and conversion utility with versions available on a wide
range of platforms. Image Alchemy reads and writes over 70 different
image formats. Although it is geared more toward image conversion
than editing, its strong conversion features and incredibly wide
support for multiple platforms make it a very useful graphics
utility to have.
<P>
Handmade Software has versions of Image Alchemy for almost every
major computer platform. It even has an online version that enables
you to convert images over the Web via a connection to its Image
Alchemy server. Very cool!
<P>
You can get information about Image Alchemy and download the latest
version from the Image Alchemy Web site, which is located at <TT><A HREF="http://www.handmadesw.com/hsi/alchemy.html">http://www.handmadesw.com/hsi/alchemy.html</A></TT>.
Figure 4.2 shows the Image Alchemy Web site.
<P>
<A HREF="f4-2.gif" ><B>Figure 4.2 : </B><I>The Image Alchemy Web site.</I></A>
<H4><B>Paint Shop Pro</B></H4>
<P>
Paint Shop Pro, by JASC Software, is a graphics editor for Windows
95 with a full suite of editing, conversion, and image processing
tools. Paint Shop Pro contains a wide variety of paint tools,
as well as image filters and conversion features for most of the
popular image formats. Paint Shop Pro is arguably the best shareware
graphics editor for Windows 95.
<P>
You can get information about Paint Shop Pro and download the
latest version from the Paint Shop Pro Web site, which is located
at <TT><A HREF="http://www.jasc.com/psp.html">http://www.jasc.com/psp.html</A></TT>.
Figure 4.3 shows the Paint Shop Pro Web site.
<P>
<A HREF="f4-3.gif" ><B>Figure 4.3 : </B><I>The Paint Shop Pro Web site.</I></A>
<H4><B>Graphics Workshop</B></H4>
<P>
Graphics Workshop, by Alchemy Mindworks, is another graphics editor
for Windows 95 that is comparable to Paintshop Pro. Graphics Workshop
is geared more toward image conversion rather than editing. However,
you might find some useful features in it that complement Paintshop
Pro, so definitely take a look at them both.
<P>
You can get information about Graphics Workshop and download the
latest version from the Graphics Workshop Web site, which is located
at <TT><A HREF="http://www.mindworkshop.com/alchemy/gww.html">http://www.mindworkshop.com/alchemy/gww.html</A></TT>.
Figure 4.4 shows the Graphics Workshop Web site.
<P>
<A HREF="f4-4.gif" ><B>Figure 4.4 : </B><I>The Graphics Workshop Web site.</I></A>
<H4><B>Imaging Machine</B></H4>
<P>
Imaging Machine, by E. I. du Pont de Nemours and Company, puts
an interesting twist on the concept of image manipulation. The
entire graphics utility is online and consists of a variety of
image processing tools that are accessible from the Imaging Machine
Web site. The goal of Imaging Machine is to free users from the
unwanted hassles of downloading, installing, and configuring complex
imaging software. There is also a stand-alone non-network version
called ImageMagick that runs on most UNIX systems. The ANSI C++
source code is available for ImageMagick, so you can rebuild it
for your platform if you desire.
<P>
You can find information about Imaging Machine and try it out
for yourself at the Imaging Machine Web site, which is located
at <TT><A HREF="http://www.vrl.com/Imaging">http://www.vrl.com/Imaging</A></TT>.
Figure 4.5 shows the Imaging Machine Web site.
<P>
<A HREF="f4-5.gif" ><B>Figure 4.5 : </B><I>The Imaging Machine Web site.</I></A>
<H3><A NAME="LineArtGraphics"><B>Line-Art Graphics</B></A></H3>
<P>
Getting back to graphics creation, the first method of creating
graphics is called <I>line-art</I> graphics. I call this method
line art because it encompasses practically all hand-drawn graphics,
whether drawn and scanned from paper or drawn in a software paint
program. Either way, you have total control over the colors used
and the resulting image. Cartoon-type graphics fall in this category.
<P>
You usually draw line-art graphics by hand on paper and scan them
with a digitizing scanner, or you use a graphics editor to draw
and modify the image. The freehand technique is useful if you
have some traditional art experience. The graphics editor approach
usually is better if you don't have any art experience, because
you can "cheat" to a certain extent by using software
image processing tools. An in-between solution is to draw rough
outlines of what you want on paper, scan them as digitized images,
and color and clean them up in a graphics editor. This is a really
nice way to create graphics because you get to draw freehand and
still benefit from software tools, while ultimately maintaining
complete control over the image.
<H3><A NAME="DRenderedGraphics"><B>3-D Rendered Graphics</B></A>
</H3>
<P>
You don't have to look far these days to see how popular 3-D rendered
graphics have become in the game world. There is a reason for
this; rendering provides the capability to create incredibly complex
and realistic 3-D graphics that sometimes aren't even possible
with freehand drawing, especially when it comes to animation.
Before I get into that, you should quickly learn how modeling
and rendering works.
<P>
Using 3-D modeling software such as Caligari's trueSpace or AutoDesk's
3D Studio, you create mathematical wireframe 3-D objects. Of course,
the majority of the math is hidden, so all you really have to
worry about is learning how to model 3-D objects using the software
tools. These modeling programs provide all kinds of methods for
creating and manipulating the wireframe objects into just about
any shape you can imagine. After you come up with a shape with
which you're happy, you specify the surface of the object along
with any sources of light. You even can place cameras to get different
views of the object. After specifying all these attributes, you
tell the application to render the image of the object.
<P>
<I>Rendering</I> is the process of composing a graphical image
of a purely mathematical object.
<P>
Rendering can yield incredible results for game graphics, and
I highly suggest looking into it. However, it usually takes a
fair amount of practice to get good at creating and working with
wireframe objects to a point where you can create complex models.
On the other hand, it might come easy to you. Either way, rendering
can be a lot of fun and can yield results far beyond the artistic
grasp of most game programmers.
<P>
Generally speaking, rendered objects have a certain graphical
style that is hard to shake. Remember that rendering is a computer
process, so it's hard to make rendered objects show emotion like
you can with hand-drawn images. Keep in mind that a delicate balance
of tools usually generates the most effective results. You might
find that rendering is great for producing backgrounds, whereas
hand-drawn images are better for individual characters. If you
do decide on a mixture of graphics-creation techniques, be sure
to blend their respective styles with each other as best you can.
<P>
One final note about rendering: I mentioned that rendering can
make creating animations much easier. Most modeling/rendering
software packages come with tools that enable you to place and
move a camera. You usually have the option of moving individual
objects, as well as the camera, over time to generate animations.
You can generate amazing animations with very little work using
these types of tools.
<H3><A NAME="ScannedPhotographyandVideoCapturedG"><B>Scanned Photography
and Video-Captured Graphics</B></A></H3>
<P>
Another interesting way to create graphics for games is by using
scanned photography and video-captured graphics. <I>Scanned photography</I>
basically consists of scanned photographic images captured with
a digitizing scanner. These can be useful, but because of the
two-phase photographic development/image scan process, they aren't
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -