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 / Selecting objects with cursor or co-ordinates in a window

Author
Message
floccipocci
22
Years of Service
User Offline
Joined: 9th Sep 2003
Location:
Posted: 4th Sep 2004 01:57
Any pseudocode or methods on how I can obtain the current object (or funtion that returns the current object) which is right "under" my mouse cursor or a certain x-y co-ordinate in the viewing window (e.g. targeted)?
dark coder
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 4th Sep 2004 06:18
if your talking about dbp then use the pick object command, if not ignore


floccipocci
22
Years of Service
User Offline
Joined: 9th Sep 2003
Location:
Posted: 6th Sep 2004 01:15
Oh yeah... I did not notice that command. Thanks.

But it's also only half of the problem. I also need to get the world co-ordinates of that particular point in space where the cursor intersects with the object. I don't want the camera to turn and point to the taget, like in FPS games.

For example, I want to create a 3rd person view, where I want the player object to aim at that point, while the camera is still facing the same angle . I need to make the bullets travel from that object to the direction of that co-ordinates.

An example can be a vehicle with a turret gun. (e.g. Microsoft's Freelancer where you can fly straight while you can aim with turrets)
Maleck
22
Years of Service
User Offline
Joined: 12th May 2004
Location: US
Posted: 14th Sep 2004 06:52
You should be able to use the OBJECT POSITION X(ObjNum) and Y and Z functions to find the coordinates of the object returned by Pick Object and use those along with the POINT OBJECT(ObjNum,x,y,z) function to point another object at the remote object.

Just a thought off hte top of my head. Hope it helps.
dark coder
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 14th Sep 2004 07:35
Quote: "You should be able to use the OBJECT POSITION X(ObjNum) and Y and Z functions to find the coordinates of the object returned by Pick Object and use those along with the POINT OBJECT(ObjNum,x,y,z) function to point another object at the remote object.
"


huh?, object position returns the position of the object

to get the cd co-ords of where the pouse is pointing, after your pick object command




Maleck
22
Years of Service
User Offline
Joined: 12th May 2004
Location: US
Posted: 14th Sep 2004 08:22
Wouldn't both ways end up giving you the world coordinates of the object the cursor was over?

Login to post a reply

Server time is: 2026-07-07 22:20:10
Your offset time is: 2026-07-07 22:20:10