Working to hold controls steady

This commit is contained in:
LarsBrubaker 2021-04-15 07:42:28 -07:00
parent 131873cf1c
commit 40de31d8d7

View file

@ -358,9 +358,12 @@ namespace MatterHackers.Plugins.EditorTools
Vector3 arrowCenter = topPosition;
arrowCenter.Z += arrowSize / 2 * distBetweenPixelsWorldSpace;
var centerMatrix = Matrix4X4.CreateTranslation(arrowCenter);
centerMatrix = Matrix4X4.CreateScale(distBetweenPixelsWorldSpace) * centerMatrix;
TotalTransform = centerMatrix;
var normal = Vector3.UnitZ.Transform(selectedItem.Matrix);
var up = Vector3.UnitX.Transform(selectedItem.Matrix);
var rotation = Matrix4X4.LookAt(Vector3.Zero, normal, up);
rotation = Matrix4X4.Identity;
TotalTransform = rotation * Matrix4X4.CreateScale(distBetweenPixelsWorldSpace) * Matrix4X4.CreateTranslation(arrowCenter);
}
private void Object3DControl_BeforeDraw(object sender, DrawEventArgs drawEvent)