3D Point to 2D space?

Started by
2 comments, last by Armadon 18 years, 7 months ago
how to transform 3D point to 2D space in DX (reverse to picking)?
Advertisement
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
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?
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.

This topic is closed to new replies.

Advertisement