Billboard

所属分类:3D图形编程
开发工具:Visual C++
文件大小:237KB
下载次数:15
上传日期:2010-07-07 12:12:18
上 传 者tomase
说明:  D3d教程广告牌源代码,属于渲染技术。适用于VC++平台
(D3d tutorial billboard source code, are rendering. Apply to VC++ platform)

文件列表:
Billboard (0, 2010-07-07)
Billboard\billboard.cpp (22381, 2010-07-07)
Billboard\billboard.dsp (5764, 2010-07-07)
Billboard\billboard.dsw (541, 2010-07-07)
Billboard\Billboard.jpg (18864, 2010-07-07)
Billboard\Billboard.manifest (686, 2010-07-07)
Billboard\Billboard.ncb (625664, 2010-07-07)
Billboard\Billboard.sln (907, 2010-07-07)
Billboard\Billboard.sln.old (918, 2010-07-07)
Billboard\Billboard.suo (8704, 2010-07-07)
Billboard\Billboard.vcproj (5379, 2010-07-07)
Billboard\Billboard.vcproj.old (5022, 2010-07-07)
Billboard\resource.h (1562, 2010-07-07)
Billboard\winmain.rc (7023, 2010-07-07)

//----------------------------------------------------------------------------- // 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

近期下载者

相关文件


收藏者