Jump to content
  • Advertisement
Sign in to follow this  
pradee

orthogonal view

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

how to display top view , side view, front view and back view of a 3d model using directx pls help me. its urgent

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites

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 view

vEye = 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 topview

vEye = 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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!