-1
$\begingroup$

I have this one triangle with arbitrary vertices positioned in a 3D space.

It's also easy to find the normal for it with the plane equation.

There is a very simple method for moving the vertices away from the centroid, but that is too linear. I can only move the vertices back and forth.

What is the formula that I need to be able to freely move the existing vertices (independently) or even new ones in a pseudo X/Y axis that is formed from the projection of the triangle normal?

I'm not a math guy so I ask you kindly to be detailed (specially when it comes to matrices).

$\endgroup$
3
  • $\begingroup$ do you mean to move it rigidly (as a rigid body) in its plane ? $\endgroup$
    – G Cab
    Jul 18, 2018 at 23:03
  • $\begingroup$ Are you basically looking for a way to generate other points in the plane of the triangle? $\endgroup$
    – amd
    Jul 18, 2018 at 23:24
  • $\begingroup$ I want to move the existing points. But being able to generate new ones in the same plane is pretty much the same solution. The only difference is that the former is "delete" from here and "add" there, while the latter is only the "add" part. $\endgroup$ Jul 18, 2018 at 23:27

2 Answers 2

2
$\begingroup$

Label the three vertices $A$, $B$ and $C$. Assuming that they’re not colinear, every point on their common plane can be expressed in the form $A+\lambda(B-A)+\mu(C-A)$ for $\lambda, \mu \in \mathbb R$. Essentially, the vertex $A$ and the direction vectors $B-A$ and $C-A$ define a coordinate system $(\lambda,\mu)$ for the plane. The three points have coordinates $(0,0)$, $(1,0)$ and $(0,1)$, respectively. If you want to move a point parallel to $B-A$, adjust its $\lambda$-coordinate; to move it parallel to $C-A$, adjust its $\mu$-coordinate.

Depending on what you want to do, you might find an orthonormal coordinate system more convenient. A simple choice is to set $\mathbf u$ to $B-A$, normalized, and $\mathbf v$ to $((B-A)\times(C-A))\times(B-A)$, also normalized. Just as above, every point on the plane can then be expressed in the form $A+s\mathbf u+t\mathbf v$, but now the coordinates $s$ and $t$ are equal to the actual distances from $A$ in the $\mathbf u$ and $\mathbf v$ directions.

You can, of course, choose any of the three points to be the origin of these coordinate systems, and use the two resulting direction vectors in either order.

$\endgroup$
2
$\begingroup$

If you mean to move it as a rigid body in the plane where it initially lays, having a unit normal vector $\bf n$, then

  • add to all vertices a same displacement vector $\bf d$, which is normal to $\bf n$;

  • take a rotation center point $\bf c$ on the plane (could be the centroid or one of the vertices, or ..), and take a rotation angle $\alpha$, multiply $\bf n$ by that, and add the cross product $ \alpha \bf n \times (\bf v_k- \bf c)$ to each vertex $\bf v_k$.

If, instead, as you commented, you want to move the vertices freely in the plane, then just add different displacement vectors $\bf d_k$ to each vertex. The vectors $\bf d_k$ shall be parallel to the plane, i.e. normal to $\bf n$.
To do that you will need to construct a new (orthogonal) basis having $n$ as one of the axis (as the new z, for example).
But, since you already have the triangle, you can go with a basis that is constituted, e.g. by $\bf a= (\bf v_2-\bf v_1)$, $\bf b =(\bf v_3-\bf v_1 )$, and $\bf n$.
Then $\bf v_k=\mu_k \bf a + \lambda_k \bf b$.

$\endgroup$
6
  • $\begingroup$ I like that and will use for future reference, but it doesn't answer my question. I want to freely move any vertices, or even add a new vertex to the same plane. I'll edit my question. $\endgroup$ Jul 18, 2018 at 23:21
  • $\begingroup$ Why would I use an arbitrary rotation angle when I want to move the points in a $2$D fashion? I mean... I need to keep the points in a plane that is 90 degrees with the normal vector. $\endgroup$ Jul 18, 2018 at 23:25
  • $\begingroup$ @AlexandreSeverino: added in answer $\endgroup$
    – G Cab
    Jul 19, 2018 at 0:09
  • $\begingroup$ Will try and let you know. $\endgroup$ Jul 19, 2018 at 0:22
  • $\begingroup$ Say I know I want to move this vertex 5 on the pseudo X axis and 3 on the pseudo Y axis, how do I translate that so it's parallel to the plane? $\endgroup$ Jul 19, 2018 at 0:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.