KozhaAkhmet / parametric-3d-rotation-model

An interactive User interface that can display 3d rotation of different symmetric gemetrical shapes by using only line segment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

parametric-3d-rotation-model

An interactive User interface that can display 3d rotation of different symmetric gemetrical shapes by using only line segment.

ezgif-4-06035d0b69

Code

   foreach (var point in points)
        {

            currentPos = new Vector2(radiusX * Mathf.Cos((float)(Time.timeSinceLevelLoad * speed + iteration)) + transposeX,
                                     radiusY * Mathf.Sin((float)(Time.timeSinceLevelLoad * speed + iteration)) + transposeY
                                                   );

            lineRenderer.SetPosition(index++, temp);
            lineRenderer.SetPosition(index++, currentPos);

            temp = currentPos;

            shiftedPos = currentPos + new Vector2(0, height);

            lineRenderer.SetPosition(index++, tempShift);
            lineRenderer.SetPosition(index++, shiftedPos);


            tempShift = shiftedPos;
            point.transform.position = currentPos;

            
            lineRenderer.SetPosition(index++, currentPos);
            lineRenderer.SetPosition(index++, shiftedPos);
            

            point.transform.position = shiftedPos;

            iteration += ((360 / points.Length) * Mathf.PI) / 180;

            Debug.Log(index);
            if(index >= 24) index = 0;
            

            //You can add an delay here to improve performance.
        }

About

An interactive User interface that can display 3d rotation of different symmetric gemetrical shapes by using only line segment.

License:MIT License


Languages

Language:C# 68.0%Language:ShaderLab 27.2%Language:HLSL 4.7%