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 / How do you send a ray from point A to point B???

Author
Message
Omikronian
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 13th Feb 2003 07:51
How can someone send out a ray from say, the cameras position
straight out in front of it? My idea is to use this "ray" to detect other objects within a level and highlight it whenever users press the left mouse button. I just do not know how to implement the ray itself.

Thanks in advance
Shadow
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 13th Feb 2003 11:28
you could just use a long invisible cylinder positioned at the camera's current position
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 13th Feb 2003 12:46
Look at the "static line of sight" commands - that is what they're designed for.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Omikronian
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 14th Feb 2003 00:40
Ok, where are those "static line of sight" commands listed in darkbasic pro? :\

Omikronian
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 14th Feb 2003 01:35
Never mind, I found where the commands are. Alright, I don't see how the static line of sight commands can help me. I want to be able to select an object using left mouse button and then need to return the selected objects position(xyz). Could someone please help me with this?

Thanks in advance

Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 14th Feb 2003 02:20
Erm, you didn't ask how to select an object in your original post - you asked how to cast a ray into the scene and detect if it had hit anything! That's why I suggested what I did and it will work with a little application.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
kfoong
21
Years of Service
User Offline
Joined: 28th Jan 2003
Location: Australia
Posted: 16th Feb 2003 05:20
well rich he did say something about left mouse clicking and the target highlighting

--------
I HAVE SOME IDEA HOW TO PROGRAM DARK BASIC!
Dmitry K
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Russia
Posted: 16th Feb 2003 16:05
Try it.
NOTE: Works only with Patch 3.1



Login to post a reply

Server time is: 2024-11-24 02:01:31
Your offset time is: 2024-11-24 02:01:31