• Advertisement

Archived

This topic is now archived and is closed to further replies.

How can I do that in Direct3D IM?

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

I would like to set the dimensions of the viewport on the front clipping plane, just like the IDirect3DRMViewport2::SetPlane function. How can I do that in Direct3D IM? Thanks...

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Ooo... Thanks...
I have tried a long time but still failed...
Is it that I should use IDirect3DDevice7::SetClipStatus to set the clip status? If yes, how should I set? I have written my code on the following..., please help!!! Thanks...

// Set the clip status (I''m not sure that is it right?)
D3DCLIPSTATUS t;
t.dwFlags = D3DCLIPSTATUS_STATUS;
t.dwStatus= D3DSTATUS_CLIPINTERSECTIONFRONT / D3DCLIP_FRONT;
t.minx = -2;
t.maxx = 2;
t.miny = -2;
t.maxy = 2;
pD3DDev->SetClipStatus(&t);

float cp[4];

// Set max X to 0.5
cp[0] = 1;
cp[1] = 0;
cp[2] = 0;
cp[3] = 0.5;
pD3DDev->SetClipPlane(0, cp);

// Set min X to -0.5
cp[0] = -1;
cp[1] = 0;
cp[2] = 0;
cp[3] = 0.5;
pD3DDev->SetClipPlane(1, cp);
pD3DDev->SetRenderState(D3DRENDERSTATE_CLIPPLANEENABLE, D3DCLIPPLANE0 / D3DCLIPPLANE1);

Thanks!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
IDirect3DRMViewport2::SetPlane is used to set the dimensions of the viewport on the front clipping plane, so that I can scoll the 3D environment without moving the camera, just like FF8. Therefore, I would like to implement this function in Direct3D IM.

I think that the IDirect3DDevice7::SetClipPlane is not used to do that... only I think... Am I wrong?

Thank you for your help.

Share this post


Link to post
Share on other sites
Are you talking about setting the min-z? I do that when I''m creating my projection matrix:

D3DUtil_SetProjectionMatrix( matProj, VP_FOV, fAspect, VP_MINZ, VP_MAXZ );

This function, by the way, is in D3DUtil.cpp, which is part of the D3D Framework thingy that comes with the SDK.

Share this post


Link to post
Share on other sites
I did it!! Thanks you for all your help!!
Set the projection matrix [3][1] and [3][2] to do that!!

Thanks!!

Share this post


Link to post
Share on other sites

  • Advertisement