Jump to content

Question

Posted

Hello everyone, let's say we want to calculate 10 positions between 2 3D points. Example

1 Point (x=3250, y=5821, z=300)

2 Point (x=5230, y=8500, z=300)

 

Now we want generate 10 positions between those 2 coords as the image shows below:

iIGhb0F.png

 

I've checked stackoverflow to get the idea, i ended up with a code like this:

insideroot= Math.sqrt(x - a) + Math.sqrt(y - b);
distance = Math.sqrt(insideroot);

Which doesn't really help me a lot. Is there any idea on how to use it and generate positions base on an Integer (spots between those points)?

Thanks a lot. 

 

6EETSPs.png

Recommended Posts

  • 0
Posted (edited)

You can simply check isInsideRadius, checkIfInRange, calculateDistance and whatever distance-like checkers for the simple distance formula.

 

Regarding points, you can check debug system of zones, which spawn adena using a specific interval following zone shape.

Edited by Tryskell
  • 0
Posted

You can simply check isInsideRadius, checkIfInRange, calculateDistance and whatever distance-like checkers for the simple distance formula.

 

Regarding points, you can check debug system of zones, which spawn adena using a specific interval following zone shape.

I did check it before little dwaf. 

 

 

final double dx = (double) x1 - x2;

final double dy = (double) y1 - y2;
 
if (includeZAxis)
{
final double dz = z1 - z2;
return Math.sqrt(dx * dx + dy * dy + dz * dz);
}
else 
return Math.sqrt(dx * dx + dy * dy);

But i did the maths this return something like 4686.613382817063 in double 

with some values. how it can give us 2 points to add a middle position for a player? or even worst 10 ?

  • 0
  • 0
Posted (edited)

You really think translation even give a 5% understandable text :D ? u need try google translation. ;)

But other than ill check it.

Edited by Afou To Patisa
  • 0
Posted (edited)

I did this: 

 

 

private double getMiddlePosition(int x1, int x2, int y1, int y2)

{
         return Math.sqrt(Math.pow(x1, x2)+Math.pow(y1, y2));
}
 
But still i dont get how i can get 2 points cause we need X and Y to teleport player.. also i dont get how to generate 10 of this.. Right now i get i guess a middle point of two X1-X2 and Y1-X2
but how we get 10?
Edited by Afou To Patisa
  • 0
Posted (edited)

pythagorean x2

1)Google "distance between 2 points in 3d"

2)Stackoverflow 1st topic

3)Click it

4)Copy paste answer.

 

Dont be a clown.

 

He asked if he can actually find the equation of a line of 2 points in 3d.

Most answers are stupid coz if u people dont know,then dont answer.

 

 

 

OP,dont try any advanced maths.

Try something like this maybe.Its simple and correct i guess.

Edited by bravetobe
  • 0
Posted

1)Google "distance between 2 points in 3d"

2)Stackoverflow 1st topic

3)Click it

4)Copy paste answer.

 

Dont be a clown.

 

He asked if he can actually find the equation of a line of 2 points in 3d.

Most answers are stupid coz if u people dont know,then dont answer.

 

Dis. None has really answer to my question. The question is not how to find the middle between 2 points, it's to generate 10 positions between 2 points and Math.pow or distance doesnt help 

  • 0
Posted (edited)

Check the post above(i editted a minute before u quote).Its an answer w/o advanced maths*.U can actually generate the points with values using the equations.

Looks decent and easy to do.U should try to check the results and find if they actually fit with the correct ones(if the points are actually in between)

 

*U should avoid searching for the equation itself,and focusing on the coordinates themselves.

Edited by bravetobe
  • 0
Posted (edited)

Dis. None has really answer to my question. The question is not how to find the middle between 2 points, it's to generate 10 positions between 2 points and Math.pow or distance doesnt help 

 

If only you would know to read.

 

mini_167523Shot00041.jpg

 

Geopath debug does the exact same thing too.

Edited by Tryskell
  • 0
Posted

 

If only you would know to read.

 

mini_167523Shot00041.jpg

 

Geopath debug does the exact same thing too.

 

Lol, not hating, but fuck me sideways, you do not know how to calculate direction between 2 points and scale it by 1/10? :X

 

You can easily give infos to someone even if he is not familar with the thing doesnt mean is always helpful. 

+ i didnt even see the thing with zones u said cause u edited ur post after i've read it.

  • 0
Posted (edited)

The 3D part makes it scary but if he actually spends some time thinking,he can figure out more than 1 ways to solve this.

 

Imo asking is OK.

Pretend to know the answer when u actually dont isnt.

Just read the posts in first page of these clowns talking about distance and how to calculate it.

The other dude just wrote "pythagorean x2" when the question was "how to find points in between 2 points in 3d".

That dude cant even google in 2k17 + he copy pasted wrong answer + he doesnt know eng

Edited by bravetobe

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...