Hi..Point and click game question

Hi…

I write to ask help.
This is my problem:
I want to do a point and click game.When I click on the screen the charater must go in the position where the mouse have clicked.My problem is:i know how to get x and y mouse position,but i don’t know how to trasform this x and y in a 3 coordinates point in 3d space…There is a method to do this??Or in professional game there is a different way??

tnx a lot and sorry for my bad english…

Games like this could use a 3d lopoly version of the walkable areas to do colition detection on, and as you click the program sends out a ray that checks where and on what your clicking…

There is a whole array of methods to choose from, and as long as it looks good and works ok use whatever works for you.

I am not very sure about this, but if think the Unprojectmatrix and ProjectMatrix commands (don’t know the real syntax) are suited for converting 2 coordinatess into 3d space… Although is not as easy as written out the command…

hi…tnx for the very useful hint,u’re great!!

Now i would ask a win32 question:

I’ve noticed that in many lib (like graphics engine for example),the user link the .lib and .dll,call some fuction in a int main() fuction and then open a simple window,withouth calling winmain in the program…how does it possible??how can i do this in my project??

tnx again

Look into GLFW or GLUT (google)

tnx,but i already know glfw and glut,i wanted to do all without any hint,only win32 programming…

Originally posted by jimmythepage:
I’ve noticed that in many lib (like graphics engine for example),the user link the .lib and .dll,call some fuction in a int main() fuction and then open a simple window,withouth calling winmain in the program…how does it possible??how can i do this in my project??
You don’t have to use WinMain() for Windows GUI applications. You can also use main() if you know the module handle, HINSTANCE. You need it in order to create a window.

To get the handle from main(), use GetModuleHandle(NULL).

tnx vvvery much…it work’s greatly!!!
Now I can create a more portable program…
Tnx again…