Jump to content
  • Advertisement


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


Finding 2d position

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

im trying to find the screen position of a vertex im using the following code D3DXMATRIX matView; D3DXMATRIX matProj; D3DXMATRIX matRes; D3DXMatrixLookAtLH(&matView,&camera.from,&camera.to,&camera.up); D3DXMatrixPerspectiveFovLH(&matProj,1.0f, 1.0f,0.10f, 100.0f); D3DXMatrixMultiply(&matRes,&matView,&matProj); D3DXVec3TransformCoord(&result,&VVerts.pos,&matRes); posx=(int)result.x; posy=(int)result.y; dosnt seem to work. if the vert is on the screen it returns 0,0 any help would be cool

Share this post

Link to post
Share on other sites
Ive now figured out that im using the wrong function here''s what im doing now

D3DXVec3Project(&result, &VVerts.pos, &vpScreen,&matProjection,&matView,&matWorld);

but it give screwed up results any one know ho o do this properly

Share this post

Link to post
Share on other sites

  • 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!