Get plane between 0 and ScreenHeight from Z position

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
saturn1
Posts: 34
Joined: Thu Dec 24, 2009 11:14 pm

Get plane between 0 and ScreenHeight from Z position

Post by saturn1 »

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.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Get plane between 0 and ScreenHeight from Z position

Post by Norbo »

Viewport.Project sounds like it would do the trick. This works on any object-space position though- it's not related to physics.
saturn1
Posts: 34
Joined: Thu Dec 24, 2009 11:14 pm

Re: Get plane between 0 and ScreenHeight from Z position

Post by saturn1 »

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.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Get plane between 0 and ScreenHeight from Z position

Post by Norbo »

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.
saturn1
Posts: 34
Joined: Thu Dec 24, 2009 11:14 pm

Re: Get plane between 0 and ScreenHeight from Z position

Post by saturn1 »

Ok thank you, it's just because it was related to Z Physics position.
Post Reply