conversion from 2d cord. to 3d and vice versa

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Guest

conversion from 2d cord. to 3d and vice versa

Post by Guest »

How can we convert a 2d coordinate say mouse pointer coordinates to 3d world coordinates and from world coord to mouse cursor cord.
rincewind
Posts: 35
Joined: Thu Mar 25, 2004 5:28 pm
Location: Germany --> Bonn

Post by rincewind »

Have a look at the API, in particular at the ISceneCollisionManager.
This class (for which a pointer can be received via the ISceneManager)
provides all methods you need for this tasks.
For example, you can use getScreenCoordinatesFrom3DPosition() to
transform 3d coordinats into 2d screen coordinates.
It has long been an axiom of mine that the little things are
infinitely the most important.
-- Sir Arthur Conan Doyle, "A Case of Identity"
Guest

Post by Guest »

i know this but how can i perform vice versa
AshmenGlue
Posts: 29
Joined: Wed Oct 12, 2005 9:09 am

Post by AshmenGlue »

I don't think you can do that(2D to 3D). Why would you want to do anyway. If you're trying select something on the screen there are tutorials for that. I'm not sure where though.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

for 2d to 3d, look at the mouse picking section in the wiki-
http://www.irrforge.org/index.php/Mouse_Input
you don't need to use collision, you could just pick a set distance along the ray given by getRayFromScreenCoordinates
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply