Hello i need to know the calculation to get the value between 0 and screenheight where is my entity from it's Z component.
For example if my entity is first plane (near from camera) get 0.
And if my entity is far from camera and on the top of my screenheight get ScreenHeight.
I have my entity Z position and my view and proj matrix.
Some helps are welcome.
Thank you.
Get plane between 0 and ScreenHeight from Z position
Re: Get plane between 0 and ScreenHeight from Z position
Viewport.Project sounds like it would do the trick. This works on any object-space position though- it's not related to physics.
Re: Get plane between 0 and ScreenHeight from Z position
Yep, i already try it.
However, i want to get the first plane(in z) which is display to my screen into worldposition and the last plane (in z) which is display to screen.
After that i can compute my z plane into screen coordinate for my entity.
Thank you.
However, i want to get the first plane(in z) which is display to my screen into worldposition and the last plane (in z) which is display to screen.
After that i can compute my z plane into screen coordinate for my entity.
Thank you.
Re: Get plane between 0 and ScreenHeight from Z position
Sorry, I'm not understanding something. Since this is purely graphics related, you'd probably have better luck searching the XNA forums or posting over there instead.
Re: Get plane between 0 and ScreenHeight from Z position
Ok thank you, it's just because it was related to Z Physics position.