//
//
// File: teapot.cpp
//
// Author: Frank Luna (C) All Rights Reserved
//
// System: AMD Athlon 1800+ XP, 512 DDR, Geforce 3, Windows XP, MSVC++ 7.0
//
// Desc: Renders a teapot in wireframe mode. Shows how to create a teapot
// using the D3DXCreateTeapot function and how to render the teapot
// using the ID3DXMesh::DrawSubset method.
//
//
#include "d3dUtility.h"
//
// Globals
//
IDirect3DDevice9* Device = 0;
const int Width = 640;
const int Height = 480;
// Mesh interface that will store the teapot data and contains
// ma method to render the teapot data.
ID3DXMesh* Teapot = 0;
//
// Framework Functions
//
bool Setup()
{
//
// Create the teapot geometry.
//
D3DXCreateTeapot(Device, &Teapot, 0);
//
// Position and aim the camera.
//
D3DXVECTOR3 position(0.0f, 0.0f, -3.0f);
D3DXVECTOR3 target(0.0f, 0.0f, 0.0f);
D3DXVECTOR3 up(0.0f, 1.0f, 0.0f);
D3DXMATRIX V;
DirectX9 示例:绘制茶壶
最新推荐文章于 2021-03-23 23:04:37 发布
本文档展示了如何使用DirectX9的D3DXCreateTeapot函数创建并渲染茶壶模型,通过ID3DXMesh::DrawSubset方法在 Wireframe 模式下显示。文中包括设置视图矩阵、投影矩阵以及切换到Wireframe模式的步骤。
摘要由CSDN通过智能技术生成