Exemplo n.º 1
0
        private void Render(object sender, GlControlEventArgs e)
        {
            if (_shader == null)
            {
                return;
            }
            Gl.Clear(ClearBufferMask.DepthBufferBit);

            var v = _cameraHelper.CameraMatrix;

            _shader.M = v;

            _shader.ShadingLevel = 0;
            FiguresHelper.Draw3DCross(10, 1);
            _shader.ShadingLevel = 1;

            var qIntern = Quaternion.Slerp(qStart, qEnd, _t);

            _t += _dt;

            var m = Matrix4x4.CreateFromQuaternion(qIntern) * Matrix4x4.CreateTranslation(_x, 0, 0) * v;

            _shader.M = m;

            _quad.Draw(0.8f, 0.5f, 1.6f, true);

            _x += _dx;
        }
Exemplo n.º 2
0
        private void Render(object sender, GlControlEventArgs e)
        {
            if (_shader == null)
            {
                return;
            }

            Gl.Clear(ClearBufferMask.DepthBufferBit);
            Gl.MatrixMode(MatrixMode.Modelview);

            var v = _cameraHelper.CameraMatrix;
            var u = Matrix4x4.CreateRotationX(Mathf.ToRadian(90));

            var m = u * v;

            _shader.M = m;

            FiguresHelper.Draw3DCross(50f, 1f);

            Figure3DHelper.DrawSphere(15, 20, 20, true, Colors.Yellow);
            Gl.LineWidth(1);
            Figure3DHelper.DrawSphere(15, 20, 20, false, Colors.Red);

            _satelite.Draw();
        }
Exemplo n.º 3
0
        private void Render(object sender, GlControlEventArgs e)
        {
            if (_shader == null)
            {
                return;
            }

            var v = _cameraHelper.CameraMatrix;

            _shader.M = v;

            _shader.ShadingLevel = 0;
            FiguresHelper.Draw3DCross(4, 1);
            _shader.ShadingLevel = 1;

            _shader.LightPos = new Vector3(1f, 1f, 1f);

            var r1     = Matrix4x4.CreateRotationY(Mathf.ToRadian(_phi));
            var t      = Matrix4x4.CreateTranslation(new Vector3(_radius, 2f, 0f));
            var r2     = Matrix4x4.CreateRotationX(Mathf.ToRadian(90)) * Matrix4x4.CreateRotationY(Mathf.ToRadian(90)) * Matrix4x4.CreateRotationZ(Mathf.ToRadian(45));
            var scaleM = Matrix4x4.CreateScale(0.2f);
            var r3     = Matrix4x4.CreateRotationY(Mathf.ToRadian(-_phi * 10));
            var r4     = Matrix4x4.CreateRotationZ(Mathf.ToRadian(25));
            var m      = r3 * r2 * t * r1 * scaleM * r4;

            _shader.M = m * v;

            Figure3DHelper.DrawMesh(_boomerang, Colors.Chocolate);

            _phi += _step;
        }
Exemplo n.º 4
0
 private static void DrawCircle(Vector2 pos, Vector2 v, Vector2 a, Color color)
 {
     FiguresHelper.DrawCircle(0.1f * RE, pos, 20, color);
 }