Finding points on a segment representing a 3D angle

241 Views Asked by At

I'm trying to calculate multiple points on an angle (circle segment) so that I can store it as a VBO of Vector3 and render it in OpenGL.

3D angle

Imagine each of those points on the dotted line as a coordinate I want to calculate

I know I can find the magnitude of the angle using the dot product, and in 2 dimensions I would be able to calculate the points on the angle just using sin and cos of this angle. But how do I apply this in 3 dimensions?

I thought maybe I should split the angle down into components, but then wasn't sure how to calculate magnitudes in that situation.

So what is the best method for calculating those points, and how do I do it?

I'm working in C# but of course pseudo code or just methods would do.

1

There are 1 best solutions below

2
On

If you know the vertices of the cuboid then its easy. Generally the line segment between two points is the convex combination of the two end points, i.e.

say $A = (a_1, a_2, b_3)$ and $B = (b_1, b_2, b_3)$ then the line segment between these two is the set :

$$ AB \mbox{ segment } = \{ \lambda (a_1,a_2,a_3) + (1-\lambda) (b_1,b_2,b_3) \mbox{ such that } 0 \leq \lambda \leq 1 \}$$

That is all you needed. ( It is true for any $\mathbb{R}^d$, $d = 0, 1, 2, 3, \dots $ )