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 Discussion / converting 3d point to screen coordinates

Author
Message
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 7th Apr 2009 03:30
hey im tryin to find a way to take four 3d points, convert them into screen coordinates for use with a function checking if your mouse is over the area

here my example, im workin towards a halo wars-ish base system where you mouse over the base section, it highlights much as i have set up for if you use space here, then if u click u can build something there

ignore the first huge block of limb code, this basically makes two meshes, which i then use to make two more meshes that are the highlighted and unhighlighted outlines of my "base section"

use space to highlight



back to the question: ne1 got ne ideas?

There are only 10 kinds of people in the world, those who understand binary and those who dont
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 7th Apr 2009 04:01
Search the code base someone uploaded a thing that does that. that should give some ideas. wait it might be the forums. just look around for it

New Site! Check it out \/
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 7th Apr 2009 04:07
You could place a sphere of radius 1 at all 4 points (by the way, for a box you only need 3) and use the OBJECT SCREEN X() and OBJECT SCREEN Y() commands.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 7th Apr 2009 04:16
thats cool, nevr seen that command b4

There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 7th Apr 2009 04:22 Edited at: 7th Apr 2009 04:28
sorry for dp, will these commands work with hidden objects?

edit:
nvm, went ahead and tried it both with hidden and non-hidden objects and it works great

here it is, remove the `s b4 the hide objects to turn them on or off



There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 7th Apr 2009 04:40
really sorry for the triple post, i dont usually but since this is unrelated to the last 2, is there an command where you input a 3d coordinate and it outputs an object number of the object at that point?

There are only 10 kinds of people in the world, those who understand binary and those who dont
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 7th Apr 2009 05:52
You could make one. but not that i know of

New Site! Check it out \/
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 7th Apr 2009 07:29
You could position a small object and then check for collision, but you would have to anticipate multiple collisions.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Gosub
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 15th Apr 2009 17:15
The up and down keys can move it, or atleast that's my interpretation...
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 15th Apr 2009 17:56
reason im asking is i want to be able to make a lot of these "bases" then be able to tell which sensor objects correspond to that base. Im thinking im gona make another object with two more sensor spheres offset the correct amount from the center. Then check for limb collision with those 2 limbs and if you mouseover between the object screen x and y of the collided objects then "select" that object and cycle the mesh.

There are only 10 kinds of people in the world, those who understand binary and those who dont
Gosub
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location:
Posted: 15th Apr 2009 23:16 Edited at: 15th Apr 2009 23:18
Quote: "reason im asking is i want to be able to make a lot of these "bases" then be able to tell which sensor objects correspond to that base. Im thinking im gona make another object with two more sensor spheres offset the correct amount from the center. Then check for limb collision with those 2 limbs and if you mouseover between the object screen x and y of the collided objects then "select" that object and cycle the mesh.
"


you could like put an invisible box to collide with over an area where you wanted to like select some stuff.

Login to post a reply

Server time is: 2025-06-08 05:37:56
Your offset time is: 2025-06-08 05:37:56