Sign in to follow this  
RealMarkP

OpenGL gluProject in DX

Recommended Posts

there are some nice function in OpenGL that do Unprojection and projection to and from the 3D world. I was wondering if anyone know the math required to project a point form 3D space to screen space in DirectX much like gluProject does? Much thanks.

Share this post


Link to post
Share on other sites
Well, if your matrices are the same format as D3D, which I would hope they are, then you could simply reinterpret cast them to D3DX matrices and use those functions. But if you insist on doing it yourself...multiply through by ModelViewProjection concatenated matrix, divide by w, and then multiply component-wise by the viewport dimensions.

Share this post


Link to post
Share on other sites

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