Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Match Cards game: mouseclick detection won't work properly

Author
Message
Gyrich
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: Here, obviously.
Posted: 6th Jan 2006 01:49
2 problems:

1.) when i click to flip a card over, nothing happens. I commented out the mousey() detecting line of my MouseClick() function (to try and figure out where the problem was) and the cards will flip over, so something must be wrong with that line of the code I think, but I can't figure out what it is.

2.) When i comment out the mousey() detecting line of my MouseClick function as stated above, either nothing happens, or the wrong cards will flip over. Thought maybe it had something to do with either the camera angle in reference to mouse x y and z positions, or the Shuffle() function messing up the predetermined x and y positions of the cards...I'm not sure.

Here's the code:


DBPro User
PC: WinXP, AthlonXP 2100+ 1.7ghz, 80gb HD, Nvidia GeForce FX 5200 (128mb onboard RAM), 512mb DDR400 system RAM. Thank you for your help.
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 6th Jan 2006 02:49
this is probably due to the fact that mouse coordinates are in x and y while 3d coordinates ar in x y and z so you have to convert the mouse coordinates into 3d coordinates

Zedane
20
Years of Service
User Offline
Joined: 3rd Nov 2004
Location: Milky Way, Earth
Posted: 6th Jan 2006 03:41
Yep,

The cards are in 3d, while the mouse operates in 2d. Do you see the problem?

The easiest way to fix this is to use the pick object command. This will do all the vector math for you, and find the closest object to you mouse.


around here.. normal's just a setting on a hair dryer
Seth TheDeth
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 6th Jan 2006 03:46
How do you go about converting x and y into x,y,z?

Age Before Beauty.........
Gyrich
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: Here, obviously.
Posted: 6th Jan 2006 07:39
Sigh, perhaps I don't have an up-to-date help file for my dbpro or something but, the list of the commands in the help index does not have an entry for pick object, so I don't have an explanation of what pick object is and how to use it, altho the editor does recognize the command and show me the parameters at the bottom of the screen thank goodness.

If anyone would care to elaborate on the proper usage of Pick Object, i'd appreciate it. In the meantime i'm gonna fiddle with it and see if i can fig out how to use it to make my mouseclick detection functional. Thanks for your help everyone.

DBPro User
PC: WinXP, AthlonXP 2100+ 1.7ghz, 80gb HD, Nvidia GeForce FX 5200 (128mb onboard RAM), 512mb DDR400 system RAM. Thank you for your help.
Gyrich
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: Here, obviously.
Posted: 6th Jan 2006 07:55
YESSSSS!! I actually figged it out on my own! My mouseclick function works!!!!!

...now if anyone has any ideas on why my help file doesn't have a full list of the commands, or knows where I can update the file, i'd greatly appreciate it...

Thank you

DBPro User
PC: WinXP, AthlonXP 2100+ 1.7ghz, 80gb HD, Nvidia GeForce FX 5200 (128mb onboard RAM), 512mb DDR400 system RAM. Thank you for your help.

Login to post a reply

Server time is: 2024-11-27 07:47:40
Your offset time is: 2024-11-27 07:47:40