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.

DarkBASIC Professional Discussion / Object on screen-cursor select

Author
Message
TogaMario
22
Years of Service
User Offline
Joined: 30th Jan 2003
Location:
Posted: 26th Feb 2003 05:51
I'm trying to write a code to check to see if an object is on screen (know that part), and essentially, "highlights" the object selected (highlight for creation purposes only, adds a flag "selected" in code). I need to know how to determine what object the mouse is clicking on, etc ... Thanks guys!
QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 26th Feb 2003 05:54
you could send an object directly out from the camera (going straight) from the mouse position. I dont know how you would determine that however...until it hits something. The object that it hits is your clicked object

Darken the skies, we are God.
TogaMario
22
Years of Service
User Offline
Joined: 30th Jan 2003
Location:
Posted: 26th Feb 2003 05:59
Hmmm, that's a pretty good idea (simple too) ... although i can see some complications arising from the emission of an object. Any more complicated way you can think of?

TogaMario
22
Years of Service
User Offline
Joined: 30th Jan 2003
Location:
Posted: 26th Feb 2003 06:00
P.S. Love your icon...I'm a huge Calvin and Hobbes fan.

Zero
22
Years of Service
User Offline
Joined: 28th Aug 2002
Location: Finland
Posted: 28th Feb 2003 09:51
We can hope that DBS will add an object picking command like B***z have. That would be perfect item for the wish-list.

But there are algorithms able to determine if a vector intersects an object in 3d space. The only problem is how to place the vector according to the position of the mouse..

The evil plan is now even closer!
- - - - - - - - - - - - - - - - - - - -
Specs:- P3 550 Nvidia TNT2M64, 192Mb RAM
andrew11
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 1st Mar 2003 02:52
You might be able to use the object screen x() and y() commands like this:




Don't know if it will work though. Never tried it.

"All programmers are playwrights and all computers are lousy actors."
-Anon.

Login to post a reply

Server time is: 2025-05-20 05:01:01
Your offset time is: 2025-05-20 05:01:01