Calculate point in 3D space



Guys, help me please calculate position of point D.
I know position of A, B, C and DE length.

In 2D space it’s quite simple, but I cant do it in 3D.

Do you know the position of E?

No, only positions of triangle.

A is my camera, B is ground, and C is point on ground from raycast.

Do you have link to do it in 2D?

tg(CBA) = AB/BC = (A.y-B.y)/(C.x-B.x);

Then ED is 2;

EC = (C.x-B.x) * ED ) / (A.y - B.y)

BE = BC - EC;
D = (B + BC, ED);

Or this way

Okay, thanks buddy from Discord, the formula is:

F/AB * (A-C) +C

Where F is your factor. 2 in my case.

1 Like