Ejemplo n.º 1
0
        private void DrawTangents(Vector3[] segment, float t)
        {
            float   tangentLength = HandleUtility.GetHandleSize(_SplineDataObject[_SplineBranchCreator.SelectedPointIndex]);
            Vector3 startPoint    = Bezier3DUtility.CubicCurveVector3(segment[0], segment[1], segment[2], segment[3], t + 0.1f);
            Vector3 tangent       = Bezier3DUtility.GetTangent(startPoint, Bezier3DUtility.CubicCurveVector3(segment[0], segment[1], segment[2], segment[3], t));

            Handles.color = Color.green;
            Handles.DrawLine(startPoint, startPoint + tangent * tangentLength);
        }
Ejemplo n.º 2
0
        private void DrawBiNormals(Vector3[] segment, float t)
        {
            float   biNormalLength = HandleUtility.GetHandleSize(_SplineDataObject[_SplineBranchCreator.SelectedPointIndex]);
            Vector3 startPoint     = Bezier3DUtility.CubicCurveVector3(segment[0], segment[1], segment[2], segment[3], t + 0.1f);
            Vector3 tangent        = Bezier3DUtility.GetTangent(startPoint, Bezier3DUtility.CubicCurveVector3(segment[0], segment[1], segment[2], segment[3], t));
            Vector3 biNormal       = Vector3.Cross(Vector3.up, tangent).normalized;

            Handles.color = Color.red;
            Handles.DrawLine(startPoint, startPoint + biNormal * biNormalLength);
        }