Ejemplo n.º 1
0
        public static void DrawSmallWheel(OpenGL gl)
        {
            gl.Repeat(() =>
            {
                // внешняя часть
                gl.DrawCylinder(SmallWheelOuterRadius, WheelPartWidth, partsCount: Roundness);
                gl.DrawCylinder(SmallWheelInnerRadius, WheelPartWidth, partsCount: Roundness);
                // задняя стенка
                gl.DrawCircle(SmallWheelOuterRadius, Roundness);
                // крышка внешней части
                gl.DoTranslate(Vector3.UnitZ * WheelPartWidth, true);
                gl.DrawDisk(SmallWheelInnerRadius, SmallWheelOuterRadius, Roundness);

                gl.UndoTranslation();
                // кольцо в середине
                gl.DrawCylinder(SmallWheelRingRadius1, SmallWheelRingWidth, partsCount: Roundness);
                gl.DrawCylinder(SmallWheelRingRadius2, SmallWheelRingWidth, partsCount: Roundness);
                gl.DoTranslate(Vector3.UnitZ * SmallWheelRingWidth, true);
                gl.DrawDisk(SmallWheelRingRadius1, SmallWheelRingRadius2, Roundness);
                gl.UndoTranslation();
            }, 2, Vector3.UnitZ * -WheelConnectorWidth, Vector3.UnitY * 180);

            // соединитель
            gl.DrawCylinder(BigWheelConnectorRadius, -WheelConnectorWidth, partsCount: Roundness);
        }
Ejemplo n.º 2
0
        private static void DrawBigWheel(OpenGL gl)
        {
            // половинки колеса
            gl.Repeat(() =>
            {
                // внешняя часть
                gl.DrawCylinder(BigWheelOuterRadius, WheelPartWidth, partsCount: Roundness);
                gl.DrawCylinder(BigWheelInnerRadius, WheelPartWidth, partsCount: Roundness);

                // задняя стенка
                gl.Color(.24f, .25f, .22f);
                gl.DrawCircle(BigWheelOuterRadius, Roundness);

                // шайбы в середине
                gl.DrawCylinder(BigWheelInnerPartRadius1, BigWheelInnerPartWidth, partsCount: Roundness);
                gl.DoTranslate(Vector3.UnitZ * BigWheelInnerPartWidth, true);
                gl.DrawCircle(BigWheelInnerPartRadius1, Roundness);
                gl.DrawCylinder(BigWheelInnerPartRadius2, BigWheelInnerPartWidth, partsCount: Roundness);
                gl.DoTranslate(Vector3.UnitZ * BigWheelInnerPartWidth, true);
                gl.DrawCircle(BigWheelInnerPartRadius2, Roundness);

                // закрывашка внешненей части (между цилиндрами)
                gl.UndoTranslation(2);
                gl.DoTranslate(Vector3.UnitZ * WheelPartWidth, true);
                gl.DrawDisk(BigWheelInnerRadius, BigWheelOuterRadius, Roundness);

                gl.UndoTranslation();
            }, 2, Vector3.UnitZ * -WheelConnectorWidth, Vector3.UnitY * 180);

            // соединитель
            gl.DrawCylinder(BigWheelConnectorRadius, -WheelConnectorWidth, partsCount: Roundness);
        }