Archived

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

Removing vanishing point.

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

Hi all-- I have a projection matrix that I set like this: void SetPerspectiveMatrix(LPD3DMATRIX mat) { double dTmp1; double dTmp2; double dHalfHeight; double dFrontClipping; double dBackClipping; #define HALF_HEIGHT D3DVAL(0.5) #define FRONT_CLIP D3DVAL(1.0) #define BACK_CLIP D3DVAL(5000.0) dHalfHeight=HALF_HEIGHT; dFrontClipping=FRONT_CLIP; dBackClipping=BACK_CLIP; dTmp1=dHalfHeight/dFrontClipping; dTmp2=dBackClipping/(dBackClipping-dFrontClipping); mat->_11=D3DVAL(2.0); mat->_12=D3DVAL(0.0); mat->_13=D3DVAL(0.0); mat->_14=D3DVAL(0.0); mat->_21=D3DVAL(0.0); mat->_22=D3DVAL(2.66); mat->_23=D3DVAL(0.0); mat->_24=D3DVAL(0.0); mat->_31=D3DVAL(0.0); mat->_32=D3DVAL(0.0); mat->_33=D3DVAL(dTmp1*dTmp2); mat->_34=D3DVAL(dTmp1); mat->_41=D3DVAL(0.0); mat->_42=D3DVAL(0.0); mat->_43=D3DVAL(-dHalfHeight*(dTmp2)); mat->_44=D3DVAL(0.0); } I essentially have copied it out of the DirectX sdk. But, I''m now writing a small editor to let me fine-tune my 3d-graphics, and I want a perspective projection without a vanishing point, so that I can look at things from the side without having more distant vertices approach the horizon. Does anyone know what changes I have to make to remove the vanishing point from my perspective? Thanks! -- Goodlife ----------------------------- Think of your mind as a door on a house. Leave the door always closed, and it's not a house, it's a prison. Leave the door always open, and it's not a house, it's a wilderness-- all the vermin creep in.

Share this post


Link to post
Share on other sites
Sorry if I''m confused, but do you mean an orthographic projection?

This is the only way I''m aware of not getting a vanishing point (unless you project everything outwards )

If your question went entirely over my head and I come across as a naive twat, please don''t hurt me.

Laters.

ps - If you want to know how to do a 2d projection, I''ll post the matrix here if you ask nicely.

Share this post


Link to post
Share on other sites
I think you mean the far clippingplane.
Increase the far clippingplane or use this function like I do:
D3DXMatrixPerspectiveFov(&matProj, fovy, aspect, zn, zf)
Hope it helped...

Share this post


Link to post
Share on other sites
Poontardis: Pleaaaase?

What I mean is this: With the matrix I have, things that are more distant from the camera tend to curve inward toward the origin, when projected in 2d.

I would like it so that if I have a vertex (xyz) at 1,1,1 and a vertex at 1,1,1000, they occupy the same pixel when projected in 2d, if I''m looking right down the Z plane.

Please?




-- Goodlife

-----------------------------
Think of your mind as a door on a house. Leave the door always closed, and it's not a house, it's a prison. Leave the door always open, and it's not a house, it's a wilderness-- all the vermin creep in.

Share this post


Link to post
Share on other sites