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 / mid point in 3d space

Author
Message
Slayer
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: CA
Posted: 2nd Jan 2004 05:48
how do I get the mid point frome two points in 3d space.
pos1_0------[I need this point]--------0_pos2

Thanks

I dont know how to spell
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 2nd Jan 2004 06:38
Easy... just take the x y and z position of one point and add it to the x y and z position of another point, then devide the result by 2...

MidX=(X1+X2)/2
MidY=(Y1+Y2)/2
MidZ=(Z1+Z2)/2

So the midpoint would be MidX,MidY,MidZ... If you needed to find a point 1/3 of the way between them, devide it by 3... 3/4 of the way, you would devide it by 3/4...
If you need to find the distance between the two points, then its...

sqrt((X1-X2)^2+(Y1-Y2)^2+(Z1-Z2)^2)

well... I hope that helps...

Do not thwart the way of the dragon. For thou tasteth like chicken.
Slayer
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: CA
Posted: 2nd Jan 2004 08:17 Edited at: 2nd Jan 2004 08:18
Yes, that did help... thanks!

I dont know how to spell
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 6th Jan 2004 07:09
Man........just got back from winter break....remembering math class... aah!
You are kind, Game_Creator, I've been looking through all my notebooks for that formula for a while.

Juvenile Industries
Current Project: The First Room (FPS)
Soon to come:An rts, and a snowball fight game
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 6th Jan 2004 16:54
Well slayer, glad it helped... and thanks Juvenile Industries, I thought I wasn't appreciated...

Do not thwart the way of the dragon. For thou tasteth like chicken.

Login to post a reply

Server time is: 2024-11-25 23:48:23
Your offset time is: 2024-11-25 23:48:23