Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17063

Rotating objects vertices with a matrix

$
0
0

I have a problem rotating an objects vertices with a matrix.
At the first few frames it looks okay, but after that it jumps around.
The final rotation is corect, but position is wrong.

 

D3DXVECTOR3& Transform(D3DXVECTOR3& V, D3DXMATRIX& M)
{
	D3DXVECTOR3 Out;
	float x = V.x * M._11 + V.y * M._21 + V.z * M._31 + M._41;
	float y = V.x * M._12 + V.y * M._22 + V.z * M._32 + M._42;
	float z = V.x * M._13 + V.y * M._23 + V.z * M._33 + M._43;
	//float w = V.x * M._14 + V.y * M …

Viewing all articles
Browse latest Browse all 17063

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>