|
|
rt
我把dx9的教程3:Matrices,修改了一下。出现了如题的问题,失真情况我附加了一个图片
修改的代码:
一:
// Set up the rotation matrix to generate 1 full rotation (2*PI radians)
// every 1000 ms. To avoid the loss of precision inherent in very high
// floating point numbers, the system time is modulated by the rotation
// period before conversion to a radian angle.
//UINT iTime = timeGetTime() % 1000;
UINT iTime=0;
作用:固定世界
二:
// a point to lookat, and a direction for which way is up. Here, we set the
// eye five units back along the z-axis and up three units, look at the
// origin, and define "up" to be in the y-direction.
dMyTime+=1e-2;
if (dMyTime>2) dMyTime=0.5f;
D3DXVECTOR3 vEyePt( 0.0f, 3.0f*dMyTime,-5.0f );
本意:让eye的坐标在y轴上(1.5,6.0)之间移动
教程中的三角形是以原点为三心的正三角形
dMyTime是我定义的全局double(为了省事……嘿嘿),初始化为1.0f;
但是出现了失真的问题:eye移动后三角形不是正三角形了………… |
|