Sign in to follow this  
dxdotnet1

3D Point to 2D space?

Recommended Posts

Hi there dxdotnet1,
How are you doing?

The Problem
Transform 3d point to 2d space.

The Solution
If it's reverse picking you are talking about. Then the normal transformation pattern you will follow (Do you sense some Yoda speak in there?).

No really. Picking is just transforming your point from screen space to object space through Clip -> View -> World...
To go from 3D space to 2D it would be Object -> World -> View -> Clip space..

1) Set the World transformation matrix
2) Set the View transformation matrix
3) Set the Projection transformation matrix.

I hope this helps buddy. Cheerio

Share this post


Link to post
Share on other sites
i found this function in dx D3DXVec3Project
but what will happen in case the object is not visible in the view/camera? what do these function returned?

Share this post


Link to post
Share on other sites
Hi there dxdotnet1 :)
How are you doing again :)

D3DXVec3Project
"Projects a 3-D vector from object space into screen space."
This means that you can use this method. Even if it's not seen in screen space. The method will still return a 3d vector that has been projected from object space to screen space.

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