Esempio n. 1
0
    private void drawLine(Vector2 Start, Vector2 Finish)
    {
        Vector2 start = Start, finish = Finish;

        if (LineClip.lineClip(ref start, ref finish))
        {
            Draw(LineClip.Breshenhams(convertToScreen(start), convertToScreen(finish)));
        }
    }
    // Use this for initialization
    void Start()
    {
        LineClip      LC            = new LineClip();
        Rasterisation rasterisation = new Rasterisation();
        Vector2       start         = new Vector2(0.5f, 0.3f);
        Vector2       end           = new Vector2(-0.5f, -0.3f);

        if (LC.Line_Clip(ref start, ref end))
        {
            List <Vector2> vectorsRasterised = new List <Vector2>();
            vectorsRasterised = rasterisation.Rasterise(start, end);
            print("Rasterise");
        }
    }