Sign in to follow this  

orthogonal view

This topic is 3718 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


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
since i cant load my model(.x files). i tried to load my .x files using directx but its laoding with only tris. but i need more than three sided polygons

Share this post


Link to post
Share on other sites
Quote:
Original post by pradee
since i cant load my model(.x files). i tried to load my .x files using directx but its laoding with only tris. but i need more than three sided polygons
That's because 3D graphics APIs all work with triangles, not polygons. Every polygonal shape can be constructed from triangles anyway. It was my understanding that .x models contain triangles rather than polygons anyway...

What exactly is the problem you're having that you can do in D3DRM but not a more recent D3D version?

Share this post


Link to post
Share on other sites
actually i tried with directx there i cant load the model with polygons. i got a code in d3drm which exactly loads my model. tats the problem. how to load the model with polygons

Share this post


Link to post
Share on other sites

This topic is 3718 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this