3D图形技术和术语

来一张搞笑图:                                 

 

                                              

参考:http://www.starstonesoftware.com/

what's the 3D tech

he term three-dimensional, or 3D, means that an object being described or displayed has
three dimensions of measurement: width, height, and depth. An example of a two-dimensional object is a piece of paper on your desk with a drawing or writing on it, having no
perceptible depth. A three-dimensional object is the can of soda next to it. The soft drink
can is round (width and depth) and tall (height). Depending on your perspective, you can
alter which side of the can is the width or height, but the fact remains that the can has
three dimensions. Figure 1.1 shows how we might measure the dimensions of the can and
piece of paper.

                                

FIGURE 1.1 Measuring two- and three-dimensional objects.
 

For centuries, artists have known how to make a painting appear to have real depth. A
painting is inherently a two-dimensional object because it is nothing more than canvas
with paint applied. Similarly, 3D computer graphics are actually two-dimensional images
on a flat computer screen that provide an illusion of depth, or a third dimension.
The first computer graphics no doubt appeared similar to what’s shown in Figure 1.2,
where you can see a simple three-dimensional cube drawn with 12 line segments. What
makes the cube look three-dimensional is perspective, or the angles between the lines that
lend the illusion of depth.
 

                                                               

FIGURE 1.2 A simple wireframe 3D cube.
 

To truly see in 3D, you need to actually view an object with both eyes or supply each eye
with separate and unique images of the object. Look at Figure 1.3. Each eye receives a twodimensional image that is much like a temporary photograph displayed on each retina
(the back part of your eye). These two images are slightly different because they are
received at two different angles. (Your eyes are spaced apart on purpose!) The brain then
combines these slightly different images to produce a single, composite 3D picture in your
head.
 

                                                    

FIGURE 1.3 How you see three dimensions.
In Figure 1.3, the angle between the images becomes smaller as the object goes farther
away. You can amplify this 3D effect by increasing the angle between the two images.
View-Master (those hand-held stereoscopic viewers you probably had as a kid) and 3D
movies capitalize on this effect by placing each of your eyes on a separate lens or by
providing color-filtered glasses that separate two superimposed images. These images are
usually overenhanced for dramatic or cinematic purposes. Of late this effect has become
more popular on the personal computer as well. Shutter glasses that work with your
graphics card and software switch between one eye and the other, with a changing
perspective displayed on-screen to each eye, thus giving a “true” stereo 3D experience.
Unfortunately, many people complain that this effect gives them headaches or makes
them dizzy!
A computer screen is one flat image on a flat surface, not two images from different
perspectives falling on each eye. As it turns out, most of what is considered to be 3D
computer graphics is actually an approximation of true 3D. This approximation is
achieved in the same way that artists have rendered drawings with apparent depth for
years, using the same tricks that nature provides for people with one eye.
You might have noticed at some time in your life that if you cover one eye, the world does
not suddenly fall flat. What happens when you cover one eye? You might think you are
still seeing in 3D, but try this experiment: Place a glass or some other object just out of
arm’s reach, off to your left side. (If it is close, this trick won’t work.) Cover your right eye
with your right hand and reach for the glass. (Maybe you should use an empty plastic
one!) Most people have a more difficult time estimating how much farther they need to
reach (if at all) before touching the glass. Now, uncover your right eye and reach for the
glass, and you can easily discern how far you need to lean to reach the glass. You now
know why people with one eye often have difficulty with distance perception.
Perspective alone is enough to create the appearance of three dimensions. Note the cube
shown previously in Figure 1.2. Even without coloring or shading, the cube still has the
appearance of a three-dimensional object. Stare at the cube for long enough, however, and
the front and back of the cube switch places. Your brain is confused by the lack of any
surface coloration in the drawing. There just isn’t enough information in this image for
your brain to be certain of what it perceives. The reason the world doesn’t suddenly look
flat when you cover one eye is that many of the 3D world’s effects are still present when
viewed two-dimensionally. The effects are just enough to trigger your brain’s ability to
discern depth. One clue is surface shading due to lighting, another is that nearby objects
appear larger than distant objects. This perspective effect is called foreshortening. This effect
and color changes, textures, shading, and variations of color intensities together add up to
our perception of a three-dimensional image.
 

术语 3D Graphics Techniques and Terminology

1、变换和投影  Transformations and Projections

Figure 1.4 shows the initial output of the BLOCK example program, which shows a line
drawing of a cube on a table or platform. By transforming, or moving the points around,
and drawing lines between them we can produce the illusion of a 3D world on a flat 2D
screen. The earliest flight simulators employed technology no more sophisticated than this.       
      

                                   

FIGURE 1.4 A simple wireframe cube and table.

2、光栅化Rasterization

The actual drawing, or filling in of the pixels between each vertex to make the lines is
called rasterization. We can further clarify our 3D intent with transformed and rasterized
lines by employing hidden surface removal. Figure 1.5 shows the output of our BLOCK
program when you press the space for the first time. Although still using just points and
lines, the illusion of a block on a table becomes quite a bit more convincing.         
                      

FIGURE 1.5 Hiding the back sides of solid geometry enhances the 3D illusion.
 

Although drawing with lines, or wireframe rendering as it is often called, has its uses, most
of the time we render not with lines, but with solid triangles. Triangles and polygons are
also rasterized, or filled in just like lines are. The earliest graphics hardware could fill in
triangles using a solid color, but as shown in Figure 1.6, this does not enhance the 3D illusion. Early games and simulation technology would make adjoining polygons different
solid colors, which would help, but fell short of a convincing simulation of reality
                                      

FIGURE 1.6 Filling in geometry with solid colors is hardly effective.
 

3、着色

In Figure 1.7 (press the space bar again if you are running the BLOCK sample program) we
show the effects of shading. By varying the color values across the surface (between
vertices), we can easily create the effect of a light shining on a red cube.
                                       

FIGURE 1.7 Shading the surface creates the illusion of light.
 

Lighting and shading are very large areas of specialty in the field of 3D graphics, and there
are entire books written on this subject alone! Shaders (sounds very similar!) on the other
hand are individual programs that execute on the graphics hardware to process vertices
and perform rasterization tasks.
 

4、纹理贴图

The next hardware advance was texture mapping. A texture is simply a picture that we map
to the surface of a triangle or polygon. As you can see in Figure 1.8, textures add a whole
new level of realism to our rendering.


                                        

 

FIGURE 1.8 A single texture is worth a thousand triangles!
 

Textures are fast and efficient on modern hardware, and a single texture can reproduce a
surface that might take thousands or even millions of triangles to represent otherwise.
 

5、混合效果

Finally, in Figure 1.9 we show the effects of blending. Blending allows us to mix different
colors together. This reflection effect is done simply by drawing the cube upside down
first. Then we draw the floor blended over the top of it, followed by the right side up
cube. You really are seeing “through” the floor to the inverted cube below. Your brain just
says, “Oh… a reflection.” Blending is also how we make things look transparent. In fact,
what you are really seeing in Figure 1.9 is through the wooden floor.

                                         
FIGURE 1.9 Using blending to create a reflection effect.

引用:https://github.com/openglsuperbible/sb7code

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值