View Full Version : Hi..Point and click game question
08-19-2006, 05:17 AM
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..
08-19-2006, 06:05 AM
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.
08-19-2006, 10:47 PM
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...
08-23-2006, 09:24 AM
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??
08-23-2006, 09:37 AM
Look into GLFW or GLUT (google)
08-23-2006, 09:42 AM
tnx,but i already know glfw and glut,i wanted to do all without any hint,only win32 programming..
08-23-2006, 09:49 AM
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).
08-23-2006, 10:00 AM
tnx vvvery much..it work's greatly!!!
Now I can create a more portable program...
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.