Public Group

# Question about projection matrix & textures in D3D

This topic is 4484 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

##### Share on other sites
Use GetLevelDesc() with the level set to 0. This retrieves the description of the top-level surface of the texture (i.e. the normal size; sub-levels contain mip-mapped smaller sized versions of the texture if it is enabled). The description holds the dimensions.

Regarding the projection matrix be sure to check out the SDK documentation -- it has lots of explanations about all basic things you will encounter. Or use google of course.

Greetz,

Illco

##### Share on other sites
Just starting out myself, I will explain what I know so far (also to make sure what I know :)

On most questions I would highly recommend thumbing through the MSDN direct X library online. I find myself constantly referencing it while I’m coding.

MSDN Library My most used Bookmark :)

Multiple Questions

3.Ortho Projection Matrix
4. Right handed/ Left Handed Coordinates
5. View Matrix -vs- World Matrix

1. I see two ways of doing this..
A.)D3DXGetImageInfoFromFile
B.)D3DXGetImageInfoFromResource
These will load a D3DXIMAGE_INFO Structure with the image info like width, height, color depth... stuff like that

3. Ortho Projection Matrix ... [google]... and MSDN
A.)D3DXMatrixOrthoLH
B.)D3DXMatrixOrthoRH
C.)D3DXMatrixOrthoOffCenterLH
D.)D3DXMatrixOrthoOffCenterRH

4. Right handed versus Left Handed I'm not sure on this one :(

5. View Matrix -vs- World Matrix
A.)The world matrix is what you load your individual transform matrices into to move stuff around in the world.
B.)View Matrix controls the Camera Position and angle (you are not always at 0,0,0 looking at -Z.

Hope these help... let me know if there is anything else I can confuse you on :)

hehe took too long to compose sutff :)[/edit]

##### Share on other sites
Ebola0001:
4. Right handed versus Left Handed I'm not sure on this one :(

Here it is...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/Coordinate_Systems.asp

HTH

##### Share on other sites
Illco: Ahah! So there is a function for getting width and height in the LPDIRECT3DTEXTURE9 object (among other info apparently). Thanks =).

Ebola0001: Wow. I can't believe I missed those ortho functions. I checked the DirectX documentation and was typing in things in the index section trying to guess the name of an ortho function but never found it. Thanks =).

EDIT: Ajit: Thanks for site link.

##### Share on other sites
Quote:
 Also, is there any way to create a texture in a similar was as OpenGL? Like by giving it an array of bytes I load in with my own code?

Use LPD3DDEV9->CreateTexture for create a empty texture surface with the dimension and properties you need, then use LPDIRECT3DTEXTURE9->LockRect for lock and get a pointer to the texture surface and then fill it with the texture data loaded from your own, then use LPDIRECT3DTEXTURE9->UnLockRect for unlock the texture surface.

1. 1
2. 2
Rutin
20
3. 3
khawk
17
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633759
• Total Posts
3013720
×