# How can I rotate a triangle around its center?

**URL:** <https://forums.unrealengine.com/t/how-can-i-rotate-a-triangle-around-its-center/326326>\
**Category:** Community & Industry Discussion\
**Tags:** rotation, matrix, unreal-engine, transform, vector, question\
**Created:** [July 23, 2015, 8:22pm UTC](https://forums.unrealengine.com/t/how-can-i-rotate-a-triangle-around-its-center/326326 "2015-07-23T20:22:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thumper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thumper](https://forums.unrealengine.com/u/Thumper)\
**Post date:** [July 23, 2015, 8:22pm UTC](https://forums.unrealengine.com/t/how-can-i-rotate-a-triangle-around-its-center/326326/1 "2015-07-23T20:22:38Z")

</div>

I’m having trouble getting an isosceles triangle to orient itself to a vector that is aligned with an axis. It doesn’t matter which axis it’s normal faces, and it doesn’t matter which perpendicular axis the up vertex faces. I need it to be flat to one and point along another. Currently when I use

```
FRotationMatrix orientationRot = FRotationMatrix(cellRotation);
FVector changedVec = orientationRot.TransformVector(tempVerts[i].cellCornerToFVec());

```

The triangle only swivels around the world center. I imagined this rotating the triangle from it’s center toward the given rotation vectors. How would I go about doing that? As a bonus! I would like to transform this triangles location to be dead center of the world (after it is rotated).

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Thumper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thumper](https://forums.unrealengine.com/u/Thumper)\
**Post date:** [July 24, 2015, 3:31pm UTC](https://forums.unrealengine.com/t/how-can-i-rotate-a-triangle-around-its-center/326326/2 "2015-07-24T15:31:02Z")

</div>

I tried getting the middle of the triangle (M) , then subtracting P[0] from M, then P[1] from M, and finally P[2] from M. I figured this would moved the triangle to the center. Then getting the rotation needed to face an axis, this did not work.
