how to initialize D3DMAXTRIX?

Started by
1 comment, last by Armadon 18 years, 10 months ago
I do D3DXMatrixIdentity instead of ZeroMemory so Am I right?
Advertisement
depends on what you want to do with it.

a zero transform/rotation matrix (ie. the identity matrix), then you'd use the IdentityMatrix function which will make the matrix look like:
1000
0100
0010
0001
Hi there Derek7, first you have to look at what each function does...


ZeroMemory: the ZeroMemory macro fills a block of memory with zeros.
D3DXMatrixIdentity : Creates an identity matrix.
The identity matrix is a matrix in which all coefficients are 0 except the [1,1][2,2][3,3][4,4] coefficients, which are set to 1.

So now you can derive from each of these what you need.
I would suggest following the norm which is:
The identity matrix is used as the starting point for matrices that will modify vertex values to create rotations, translations, and any other transformations that can be represented by a 4 ×4 matrix.

So the IdentityMatrix is what you seek.

This topic is closed to new replies.

Advertisement