I am looking to make the two legs of a right angle triangle-part face the direction of two points which are 90 degrees apart, and would be centered on each triangle legs’ surface normal. Where the points are represented by Vector3 values, and the points can have any 2d-plane orientation.
I understand the process of pointing objects in the direction of another given object, yet I am unsure on how to point two surfaces in a specific direction as mentioned above.
Simply setting one face to a given point and altering the parts of the rotation matrix by 90 degree increments to get the other face pointing correctly will not suffice, since I am looking to have this work in all orientations.
If I understand this correctly the normal vectors are given and you want to rotate a wedge.
If so then just do this:
local NV1= --your code here, stands for normal vector 1
local NV2= --your code here, stands for normal vector 2
local NV3= NV1:Cross(NV2)
local pos= --your code here, stands for position