orthogonal view

Started by
11 comments, last by pradee 16 years, 6 months ago
how to display top view , side view, front view and back view of a 3d model using directx pls help me. its urgent
Advertisement
Use an orthogonal projection matrix: D3DXMatrixOrthoLH().
hi sorry i could not do that. i dont know how to use the orthogonal matrix for the views. can u explain. thanx in advance
D3DXMATRIX matProj;D3DXMatrixOrthoLH(&matProj, w, h, 0.1f, 1000.0f);pDevice->SetTransform(D3DTS_PROJECTION, &matProj);D3DXMATRIX matView;D3DXVECTOR3 vEye(0.0f, 0.0f, -1.0f);D3DXVECTOR3 vAt(0.0f, 0.0f, 0.0f);D3DXVECTOR3 vUp(0.0f, 1.0f, 0.0f);D3DXMatrixLookAtLH(&matView, &vEye, &vAt, &vUp);pDevice->SetTransform(D3DTS_VIEW, &matView);// Render side viewvEye = D3DXVECTOR3(0.0f, 1.0f, 0.0f);vAt = D3DXVECTOR3(0.0f, 0.0f, 0.0f);vUp = D3DXVECTOR3(0.0f, 0.0f, 1.0f);D3DXMatrixLookAtLH(&matView, &vEye, &vAt, &vUp);pDevice->SetTransform(D3DTS_VIEW, &matView);// Render topviewvEye = D3DXVECTOR3(1.0f, 0.0f, 0.0f);vAt = D3DXVECTOR3(0.0f, 0.0f, 0.0f);vUp = D3DXVECTOR3(0.0f, 1.0f, 0.0f);D3DXMatrixLookAtLH(&matView, &vEye, &vAt, &vUp);pDevice->SetTransform(D3DTS_VIEW, &matView);// Render front view

Basically, you use an orthogonal projection matrix to prevent objects further away seeming smaller, then use the view matrix to move the camera around to get the 3 views you want.
how to use this in d3drm?
Quote:Original post by pradee
how to use this in d3drm?
...

You don't unless you're from the year 1992.

EDIT: Ok, that sounds a little harsh [smile] What I mean is, D3DRM was dropped in DX6 (AFAIK). There's absolutely no reason you should be using it at all. It's a terrible, slow, brain dead API which is no longer supported. What's wrong with DX9? Even DX9 works on Windows 95 if that's your concern.
It is also worth baring in mind that D3DRM was dropped from Windows Vista. Any software you write against the library will not work post-XP.

Oh, Steve - I thought D3DRM was last updated as part of DX3 and dropped as of DX8 (when RM/IM were replaced with 'DirectXGraphics'). Not that it really matters, just being picky [razz]

Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Quote:Original post by jollyjeffers
Oh, Steve - I thought D3DRM was last updated as part of DX3 and dropped as of DX8 (when RM/IM were replaced with 'DirectXGraphics'). Not that it really matters, just being picky [razz]
Hmm, I thought it didn't exist in DX7 either? Oh well, it's gone away now anyway [smile]
im just asking to know how to display the views using d3drm. if u know pls let me know
Quote:Original post by pradee
im just asking to know how to display the views using d3drm. if u know pls let me know
It should be similar, although I don't think D3DX was around when D3DRM was about (I could be wrong though, it was over a decade since I used it). The DX docs are on the MSDN, and they have the matrix layout for orthogonal views, so you can make your own function pretty easily.

However, I've no idea if D3DRM is low level enough to let you set the projection matrix directly...

Why are you using D3DRM?

This topic is closed to new replies.

Advertisement