Billboard
所属分类:3D图形编程
开发工具:Visual C++
文件大小:5883KB
下载次数:62
上传日期:2007-10-04 14:18:40
上 传 者:
hua55
说明: 3D场景中做平面游戏雏形。有中文注释,本人通过dxsdk例程修改而来,hua55@126.com
(3D scenes in the game to do a prototype plane. Notes have Chinese, I came through dxsdk modify routines, hua55@126.com)
文件列表:
Billboard (0, 2007-07-31)
Billboard\winmain.rc (6729, 2007-08-10)
Billboard\resource.h (1469, 2002-11-12)
Billboard\Billboard.vcproj (5789, 2007-08-09)
Billboard\Billboard.sln (882, 2007-08-09)
Billboard\Billboard.manifest (686, 2002-11-12)
Billboard\Billboard.jpg (18864, 2002-11-12)
Billboard\billboard.dsw (541, 2002-11-12)
Billboard\billboard.dsp (5535, 2002-11-12)
Billboard\test.bmp (49208, 2003-08-18)
Billboard\UpgradeLog.XML (3817, 2007-08-09)
Billboard\Billboard.sln.old (918, 2002-11-12)
Billboard\Billboard.vcproj.7.00.old (4592, 2002-11-12)
Billboard\billboard.cpp (25215, 2007-09-11)
Billboard\Billboard.ncb (15543296, 2007-09-20)
Billboard\_UpgradeReport_Files (0, 2007-08-09)
Billboard\_UpgradeReport_Files\UpgradeReport.css (3348, 2007-08-09)
Billboard\_UpgradeReport_Files\UpgradeReport_Minus.gif (69, 2007-08-09)
Billboard\_UpgradeReport_Files\UpgradeReport_Plus.gif (71, 2007-08-09)
Billboard\_UpgradeReport_Files\UpgradeReport.xslt (12276, 2005-09-23)
Billboard\Debug (0, 2007-08-09)
Billboard\Debug\BuildLog.htm (7484, 2007-09-06)
Billboard\Debug\Billboard.exe.embed.manifest (146, 2007-09-05)
Billboard\Debug\vc80.idb (543744, 2007-09-06)
Billboard\Debug\vc80.pdb (241664, 2007-09-06)
Billboard\Debug\billboard.obj (74126, 2007-09-06)
Billboard\Debug\dxutil.obj (63958, 2007-09-05)
Billboard\Debug\d3dutil.obj (82862, 2007-09-05)
Billboard\Debug\d3dsettings.obj (82900, 2007-09-05)
Billboard\Debug\d3dfont.obj (66899, 2007-09-05)
Billboard\Debug\d3dfile.obj (72180, 2007-09-05)
Billboard\Debug\d3denumeration.obj (59220, 2007-09-05)
Billboard\Debug\d3dapp.obj (105085, 2007-09-05)
Billboard\Debug\winmain.res (27500, 2007-09-05)
Billboard\Debug\Billboard.ilk (2767564, 2007-09-06)
Billboard\Debug\Billboard.exe.embed.manifest.res (212, 2007-09-05)
Billboard\Debug\Billboard.exe (1712128, 2007-09-06)
Billboard\Debug\Billboard.pdb (3689472, 2007-09-06)
Billboard\Debug\Billboard.exe.intermediate.manifest (145, 2007-09-06)
... ...
//-----------------------------------------------------------------------------
// Name: Billboard Direct3D Sample
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
Description
===========
The Billboard sample illustrates the billboarding technique. Rather than
rendering complex 3D models (such as a high-polygon tree model),
billboarding renders a 2D image of the model and rotates it to always face
the eyepoint. This technique is commonly used to render trees, clouds,
smoke, explosions, and more. For more information, see
Common Techniques and Special Effects.
The sample has a camera fly around a 3D scene with a tree-covered hill. The
trees look like 3D objects, but they are actually 2-D billboarded images
that are rotated towards the eye point. The hilly terrain and the skybox
(6-sided cube containing sky textures) are just objects loaded from .x
files, used for visual effect, and are unrelated to the billboarding
technique.
Path
====
Source: DXSDK\Samples\C++\Direct3D\Billboard
Executable: DXSDK\Samples\C++\Direct3D\Bin
User's Guide
============
The following keys are implemented. The dropdown menus can be used for the
same controls.
Starts and stops the scene
Advances the scene by a small increment
Shows help or available commands.
Prompts user to select a new rendering device or display mode
Toggles between fullscreen and windowed modes
Exits the app.
Programming Notes
=================
The billboarding technique is the focus of this sample. Each frame, the
camera is moved, so the viewpoint changes accordingly. As the viewpoint
changes, a rotation matrix is generated to rotate the billboards about
the y-axis so that they face the new viewpoint. The computation of the
billboard matrix occurs in the FrameMove() function. The trees are also
sorted in that function, as required for proper alpha blanding, since
billboards typically have some transparent pixels. The trees are
rendered from a vertex buffer in the DrawTrees() function.
Note that the billboards in this sample are constrained to rotate about the
y-axis only, as otherwise the tree trunks would appear to not be fixed to
the ground. In a 3D flight sim or space shooter, for effects like
explosions, billboards are typically not constrained to one axis.
This sample makes use of common DirectX code (consisting of helper functions,
etc.) that is shared with other samples on the DirectX SDK. All common
headers and source code can be found in the following directory:
DXSDK\Samples\C++\Common
近期下载者:
相关文件:
收藏者: