原创 實現委託

#include <iostream> using namespace std; template <class T> class A { private: typedef int (T::*delegateFun)(int);

原创 Direct3D頂點座標變換

開始的話:頂點座標變換時Direct3D學習中的入門基礎,在這裏將詳述其原理: Direct3D中渲染三維對象的過程分爲兩個階段:《1》T&L(Transforming and Lighting),即座標變換和光照;           

原创 創建靈活的攝象機

通過鼠標活動改變vLookatPt(x,y,z)中的xyz 從而改變觀察矩陣。 D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec ) 點贊 收藏

原创 The Direct3D Transformation Pipeline

Introduction This white paper provides a technical explanation for Direct3D application developers on how to set the

原创 關於3d旋轉

3d遊戲中涉及到很多旋轉,但是在計算旋轉矩陣時,點的旋轉要轉化爲向量的旋轉來計算,而向量的旋轉要從三維座標轉化爲二維座標來計算。 點贊 收藏 分享 文章舉報 dadalan 發

原创 C++ XML解析之TinyXML篇

 最近使用TinyXML進行C++ XML解析,感覺使用起來比較簡單,很容易上手,本文給出一個使用TinyXML進行XML解析的簡單例子,很多複雜的應用都可以基於本例子的方法來完成。以後的文章裏會講解使用Xerces進行C++ XML解析

原创 Tinyxml使用入門

兩種在Tinyxml中查找元素的方法,對應兩種不同的XML文件格式。 test2.xml文件: view plaincopy to clipboardprint? ---------------------------------

原创 d3d像素霧化

Using Pixel Fog Use the following steps to enable pixel fog in your application. Enable fog blending by setting the D3D

原创 istringstream, ostringstream, stringstream 實現數據類型轉化爲 string

#include <iostream> #include <string> #include <sstream> using namespace std; int main() { int a, b; string St

原创 D3DXPLANE平面的構造

typedef struct D3DXPLANE{#ifdef __cpluspluspublic:D3DXPLANE() {}D3DXPLANE( CONST FLOAT* );D3DXPLANE( CONST D3DXFLOAT16*

原创 浮點數四捨五入最簡潔的辦法。

float x=5.2; int n;   n= int(x+0.5); 點贊 收藏 分享 文章舉報 dadalan 發佈了770 篇原創文章 · 獲贊 23 · 訪問量 18

原创 d3d旋轉分解

D3D是通過Device的SetTransform來設置世界變換矩陣的。物體默認是在D3D的世界座標原點上。如果我們要把它做一些變換再顯示出來,就要計算一個該物體的世界矩陣matWorld,再調用Device的SetTransform(D

原创 C/C++獲取當前系統時間

//方案— 優點:僅使用C標準庫;缺點:只能精確到秒級#include <time.h> #include <stdio.h> int main( void ) {     time_t t = time(0);     char tmp

原创 遍歷文件夾下文件

 #include<iostream> #include<string> #include<io.h> using namespace std; void filesearch(string path,int layer) {

原创 在表中指定位置加上一個字段

ALTER   TABLE   your_table   ADD   photo   VARCHAR(255)   NOT   NULL   AFTER   idcard 點贊 收藏 分享 文章舉報