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.

3 Dimensional Chat / generating a 3d mouse over event problems

Author
Message
Laserus
22
Years of Service
User Offline
Joined: 26th Nov 2003
Location:
Posted: 3rd Dec 2003 08:05
hi, i have a bunch a of cubes i want to determine when the mouse is over the top of one ,as in not over the one in back of the one you are over, even though you are over it, technically. yeh it gets sorta confusing.
here is the code.

thanks
las
arras
23
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Slovakia
Posted: 3rd Dec 2003 15:23
I think that if you want to have it realy exact then you have to use colision check.

my sugestion: on mouse click create or position simple object -can be just one triangle wery thin and long, place triangle with its two wertices at your camera position and last verticle pointing far direction of your mouse.
Check colision of other objects with triangle. If its giving you more than one result, compare distances from camera to those objects and one closest to you is the one you looking for.

you can may be even place firsth two vertices at the same location so triangle will look like one line.

Also placing start of rtiangle exactly at camera position will prob. not work, you have to find out way hove to place it so its pointing strait away from your cursor location.
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 3rd Dec 2003 15:45
That is what PICK OBJECT was invented for! It is a new command in U5 for telling you what object is at a screen coordinate (usually the mouse). It even tells you how far it is away.

See here for my snippets:

http://www.thegamecreators.com/?m=forum_view&t=15701&b=7


Boo!
Laserus
22
Years of Service
User Offline
Joined: 26th Nov 2003
Location:
Posted: 3rd Dec 2003 19:22
ok thanks arras i see what you are saying.
and spooky i cant quite get pick object to work
here is the actual code. the pick object command only seems to work with one object on the screen, the plain over box one,you will see what i mean. am i useing it wrong, or what do the "object end" and "object start" arguements actually signify, distance or size?

thanks for the feed back
las
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 3rd Dec 2003 20:24
You are so close! The object start and object end specify the range of objects you want to test. So if you only want to detect from 1001 to 1101 which is the 100 cubes on your level, use that and all is well.

The idea being you can exclude detecting objects outside this range, like your plain object 30


Boo!
Laserus
22
Years of Service
User Offline
Joined: 26th Nov 2003
Location:
Posted: 4th Dec 2003 00:08
thanks spooky
that worked like a charm

Login to post a reply

Server time is: 2026-07-23 02:36:57
Your offset time is: 2026-07-23 02:36:57