赞
踩
下面这段代码利用了变形矩阵:
//
// spin the object:
//
D3DXMATRIX Rx, Ry;
// rotate 45 degrees on x-axis
D3DXMatrixRotationX(&Rx, 3.14f / 4.0f);
// incremement y-rotation angle each frame
static float y = 0.0f;
D3DXMatrixRotationY(&Ry, y);
y += timeDelta;
// reset angle to zero when angle reaches 2*PI
if( y >= 6.28f )
y = 0.0f;
// combine x- and y-axis rotation transformations.
D3DXMATRIX p = Rx * Ry;
Device->SetTransform(D3DTS_WORLD, &p);
记下了~
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。