void StartLine()

book_4_sparkGenerated
code_blocksInput

Description

The StartLine method is used to initiate the drawing of a line within a SceneLineObject. This method marks the beginning of a line segment, allowing subsequent points to be added using the AddLinePoint method. Once all desired points have been added, the line can be completed with the EndLine method.

Usage

To use the StartLine method, first create an instance of SceneLineObject. Call StartLine to begin a new line segment. After calling StartLine, use AddLinePoint to specify the points of the line. Finally, call EndLine to complete the line.

Example

// Create a new SceneLineObject
SceneLineObject lineObject = new SceneLineObject();

// Start a new line
lineObject.StartLine();

// Add points to the line
Vector3 point1 = new Vector3(0, 0, 0);
Color color1 = new Color(1, 0, 0); // Red color
float width1 = 0.1f;
lineObject.AddLinePoint(ref point1, color1, width1);

Vector3 point2 = new Vector3(1, 1, 0);
Color color2 = new Color(0, 1, 0); // Green color
float width2 = 0.1f;
lineObject.AddLinePoint(ref point2, color2, width2);

// End the line
lineObject.EndLine();