Exemple #1
0
        // RenderAFrame is called once a frame
        public override void RenderAFrame()
        {
            // Clear the backbuffer
            RC.Clear(ClearFlags.Color | ClearFlags.Depth);

            // Mouse and keyboard movement
            if (Input.Keyboard.LeftRightAxis != 0 || Input.Keyboard.UpDownAxis != 0)
            {
                _keys = true;
            }

            if (Input.Mouse.LeftButton)
            {
                _keys         = false;
                _angleVelHorz = -RotationSpeed * Input.Mouse.XVel * Time.DeltaTime * 0.0005f;
                _angleVelVert = -RotationSpeed * Input.Mouse.YVel * Time.DeltaTime * 0.0005f;
            }
            else if (Input.Touch.GetTouchActive(TouchPoints.Touchpoint_0))
            {
                _keys = false;
                var touchVel = Input.Touch.GetVelocity(TouchPoints.Touchpoint_0);
                _angleVelHorz = -RotationSpeed * touchVel.x * Time.DeltaTime * 0.0005f;
                _angleVelVert = -RotationSpeed * touchVel.y * Time.DeltaTime * 0.0005f;
            }
            else
            {
                if (_keys)
                {
                    _angleVelHorz = -RotationSpeed * Input.Keyboard.LeftRightAxis * Time.DeltaTime;
                    _angleVelVert = -RotationSpeed * Input.Keyboard.UpDownAxis * Time.DeltaTime;
                }
                else
                {
                    var curDamp = (float)System.Math.Exp(-Damping * Time.DeltaTime);
                    _angleVelHorz *= curDamp;
                    _angleVelVert *= curDamp;
                }
            }


            _angleHorz += _angleVelHorz;
            _angleVert += _angleVelVert;

            // Create the camera matrix and set it as the current ModelView transformation
            var mtxRot = float4x4.CreateRotationX(_angleVert) * float4x4.CreateRotationY(_angleHorz);
            var mtxCam = float4x4.LookAt(0, 20, -600, 0, 150, 0, 0, 1, 0);

            RC.ModelView = mtxCam * mtxRot;

            // Render the scene loaded in Init()
            _sceneRenderer.Render(RC);

            #if GUI_SIMPLE
            _guiHandler.RenderGUI();
            #endif

            // Swap buffers: Show the contents of the backbuffer (containing the currently rerndered farame) on the front buffer.
            Present();
        }
Exemple #2
0
        public override void RenderAFrame()
        {
            RC.Clear(ClearFlags.Color | ClearFlags.Depth);

            _guiHandler.RenderGUI();

            Present();
        }
Exemple #3
0
        public override void RenderAFrame()
        {
            // is called once a frame
            RC.Clear(ClearFlags.Color | ClearFlags.Depth);

            _guiHandler.RenderGUI();
            HandleMouseRotations();
            SetShaderValues(_currentShader);

            Present();
        }
Exemple #4
0
        // is called once a frame
        public override void RenderAFrame()
        {
            RC.Clear(ClearFlags.Color | ClearFlags.Depth);

            // First render 3d elements
            RC.SetShader(Shaders.GetDiffuseColorShader(RC));
            RC.SetShaderParam(_colorParam, new float4(0.8f, 0.5f, 0, 1));
            RC.Render(_cube);

            // Projection stuff.
            var mtxCam = float4x4.LookAt(6, 3, 3, 0, 0, 0, 0, 1, 0);

            RC.ModelView = mtxCam;

            // Pull user input.
            if (Input.Instance.IsKey(KeyCodes.Escape))
            {
                CloseGameWindow(); // Call to opentk to close the application. TODO: Figure out how to prevent problems with existing projects. Perhaps a boolean to overwrite or so?
            }
            // Second render gui
            _guiHandler.RenderGUI();

            Present();
        }
        // RenderAFrame is called once a frame
        public override void RenderAFrame()
        {
            // _guiSubText.Text = $"dt: {DeltaTime} ms, W: {Width}, H: {Height}, PS: {_maxPinchSpeed}";
            // Clear the backbuffer
            RC.Clear(ClearFlags.Color | ClearFlags.Depth);

            // Mouse and keyboard movement
            if (Keyboard.LeftRightAxis != 0 || Keyboard.UpDownAxis != 0)
            {
                _keys = true;
            }

            var curDamp = (float)System.Math.Exp(-Damping * DeltaTime);

            // Zoom & Roll
            if (Touch.TwoPoint)
            {
                if (!_twoTouchRepeated)
                {
                    _twoTouchRepeated = true;
                    _angleRollInit    = Touch.TwoPointAngle - _angleRoll;
                    _offsetInit       = Touch.TwoPointMidPoint - _offset;
                    _maxPinchSpeed    = 0;
                }
                _zoomVel   = Touch.TwoPointDistanceVel * -0.01f;
                _angleRoll = Touch.TwoPointAngle - _angleRollInit;
                _offset    = Touch.TwoPointMidPoint - _offsetInit;
                float pinchSpeed = Touch.TwoPointDistanceVel;
                if (pinchSpeed > _maxPinchSpeed)
                {
                    _maxPinchSpeed = pinchSpeed;                              // _maxPinchSpeed is used for debugging only.
                }
            }
            else
            {
                _twoTouchRepeated = false;
                _zoomVel          = Mouse.WheelVel * -0.5f;
                _angleRoll       *= curDamp * 0.8f;
                _offset          *= curDamp * 0.8f;
            }

            // UpDown / LeftRight rotation
            if (Mouse.LeftButton)
            {
                _keys         = false;
                _angleVelHorz = -RotationSpeed * Mouse.XVel * 0.000002f;
                _angleVelVert = -RotationSpeed * Mouse.YVel * 0.000002f;
            }
            else if (Touch.GetTouchActive(TouchPoints.Touchpoint_0) && !Touch.TwoPoint)
            {
                _keys = false;
                float2 touchVel;
                touchVel      = Touch.GetVelocity(TouchPoints.Touchpoint_0);
                _angleVelHorz = -RotationSpeed * touchVel.x * 0.000002f;
                _angleVelVert = -RotationSpeed * touchVel.y * 0.000002f;
            }
            else
            {
                if (_keys)
                {
                    _angleVelHorz = -RotationSpeed * Keyboard.LeftRightAxis * 0.002f;
                    _angleVelVert = -RotationSpeed * Keyboard.UpDownAxis * 0.002f;
                }
                else
                {
                    _angleVelHorz *= curDamp;
                    _angleVelVert *= curDamp;
                }
            }

            _zoom += _zoomVel;
            // Limit zoom
            if (_zoom < 80)
            {
                _zoom = 80;
            }
            if (_zoom > 2000)
            {
                _zoom = 2000;
            }

            _angleHorz += _angleVelHorz;
            // Wrap-around to keep _angleHorz between -PI and + PI
            _angleHorz = M.MinAngle(_angleHorz);

            _angleVert += _angleVelVert;
            // Limit pitch to the range between [-PI/2, + PI/2]
            _angleVert = M.Clamp(_angleVert, -M.PiOver2, M.PiOver2);

            // Wrap-around to keep _angleRoll between -PI and + PI
            _angleRoll = M.MinAngle(_angleRoll);


            // Create the camera matrix and set it as the current ModelView transformation
            var mtxRot = float4x4.CreateRotationZ(_angleRoll) * float4x4.CreateRotationX(_angleVert) * float4x4.CreateRotationY(_angleHorz);
            var mtxCam = float4x4.LookAt(0, 20, -_zoom, 0, 0, 0, 0, 1, 0);

            RC.ModelView = mtxCam * mtxRot * _sceneScale * _sceneCenter;
            var mtxOffset = float4x4.CreateTranslation(2 * _offset.x / Width, -2 * _offset.y / Height, 0);

            RC.Projection = mtxOffset * _projection;

            // Tick any animations and Render the scene loaded in Init()
            _sceneRenderer.Animate();
            _sceneRenderer.Render(RC);



            _sinceLastTick += DeltaTime;
            if (_sinceLastTick >= 0.1f)
            {
                _sinceLastTick = 0;
                Ticker.Tick();
                StringBuilder sb = new StringBuilder(Ticker.Size);
                foreach (char c in Ticker.CurrentText)
                {
                    if (_guiLatoBlack.Alphabet.Contains(new string(c, 1)))
                    {
                        sb.Append(c);
                    }
                    else
                    {
                        sb.Append(' ');
                    }
                }
                _guiSubText.Text = sb.ToString();
                _subtextWidth    = GUIText.GetTextWidth(_guiSubText.Text, _guiLatoBlack);
                _subtextHeight   = GUIText.GetTextHeight(_guiSubText.Text, _guiLatoBlack);
                _guiSubText.PosX = (int)((Width - _subtextWidth) / 2);
                _guiSubText.PosY = (int)((Height - _subtextHeight) * 4.0f / 5.0f);

                _guiHandler.Refresh();
            }

            _guiHandler.RenderGUI();

            // Swap buffers: Show the contents of the backbuffer (containing the currently rerndered frame) on the front buffer.
            Present();
        }
Exemple #6
0
        // RenderAFrame is called once a frame
        public override void RenderAFrame()
        {
            // Clear the backbuffer
            RC.Clear(ClearFlags.Color | ClearFlags.Depth);

            UpdateVideos();

            // Mouse and keyboard movement
            if (Keyboard.LeftRightAxis != 0 || Keyboard.UpDownAxis != 0)
            {
                _keys = true;
            }

            if (Mouse.LeftButton)
            {
                _keys         = false;
                _angleVelHorz = -RotationSpeed * Mouse.XVel * DeltaTime * 0.0005f;
                _angleVelVert = -RotationSpeed * Mouse.YVel * DeltaTime * 0.0005f;
            }
            else if (Touch.GetTouchActive(TouchPoints.Touchpoint_0))
            {
                _keys = false;
                var touchVel = Touch.GetVelocity(TouchPoints.Touchpoint_0);
                _angleVelHorz = -RotationSpeed * touchVel.x * DeltaTime * 0.0005f;
                _angleVelVert = -RotationSpeed * touchVel.y * DeltaTime * 0.0005f;
            }
            else
            {
                if (_keys)
                {
                    _angleVelHorz = -RotationSpeed * Keyboard.LeftRightAxis * DeltaTime;
                    _angleVelVert = -RotationSpeed * Keyboard.UpDownAxis * DeltaTime;
                }
                else
                {
                    var curDamp = (float)System.Math.Exp(-Damping * DeltaTime);
                    _angleVelHorz *= curDamp;
                    _angleVelVert *= curDamp;
                }
            }
            if (Input.Keyboard.IsKeyDown(KeyCodes.PageUp) == true)
            {
                _screen.SetHit(10);
            }
            if (Input.Keyboard.IsKeyDown(KeyCodes.PageDown) == true)
            {
                _screen.SetHit(-10);
            }

            _angleHorz += _angleVelHorz;
            _angleVert += _angleVelVert;

            // Create the camera matrix and set it as the current ModelView transformation
            var mtxRot = float4x4.CreateRotationX(_angleVert) * float4x4.CreateRotationY(_angleHorz);

            // 3d mode
            var eyeF    = new float3(0, 110, -1000);
            var targetF = new float3(0, 110, 0);
            var upF     = new float3(0, 1, 0);

            _stereoCam.Prepare(Stereo3DEye.Left);
            for (var x = 0; x < 2; x++)
            {
                var lookAt = _stereoCam.LookAt3D(_stereoCam.CurrentEye, eyeF, targetF, upF);
                var mtx    = lookAt * mtxRot;
                //  var mtxCam = float4x4.LookAt(0, 20, -600, 0, 150, 0, 0, 1, 0);
                RC.ModelView = mtx * float4x4.CreateTranslation(new float3(0, 0, 0));

                // Render the scene loaded in Init()
                //Render FUSEE Rocket
                _sceneRenderer.Render(RC);
                //Render ScreenS3D object
                _screen.Render(_stereoCam, lookAt * mtx);

                _stereoCam.Save();
                if (x == 0)
                {
                    _stereoCam.Prepare(Stereo3DEye.Right);
                }
            }
            _stereoCam.Display();


            #if GUI_SIMPLE
            _guiHandler.RenderGUI();
            #endif

            // Swap buffers: Show the contents of the backbuffer (containing the currently rerndered farame) on the front buffer.
            Present();
        }
 public void Render()
 {
     _guiHandler.RenderGUI();
 }
Exemple #8
0
        // is called once a frame
        public override void RenderAFrame()
        {
            RC.Clear(ClearFlags.Color | ClearFlags.Depth);
            // move per mouse
            if (Input.Instance.IsButton(MouseButtons.Left))
            {
                _angleVelHorz = RotationSpeed * 30 * (float)Time.Instance.DeltaTime * Input.Instance.GetAxis(InputAxis.MouseX);
                _angleVelVert = RotationSpeed * 30 * (float)Time.Instance.DeltaTime * Input.Instance.GetAxis(InputAxis.MouseY);
            }
            else
            {
                var curDamp = (float)Math.Exp(-Damping * Time.Instance.DeltaTime);

                _angleVelHorz *= curDamp;
                _angleVelVert *= curDamp;
            }

            if (Input.Instance.GetAxis(InputAxis.MouseWheel) == 0)
            {
                var curDamp = (float)Math.Exp(-Damping * Time.Instance.DeltaTime);
                _zVel *= (curDamp * curDamp * curDamp);
            }
            else
            {
                _zVel = -100000 * Input.Instance.GetAxis(InputAxis.MouseWheel) * (float)Time.Instance.DeltaTime;
            }

            _angleHorz -= _angleVelHorz;
            _angleVert -= _angleVelVert;
            _zVal       = Math.Max(100, Math.Min(_zVal + _zVel, 1000));

            // move per keyboard
            if (Input.Instance.IsKey(KeyCodes.Left))
            {
                _angleHorz -= RotationSpeed * (float)Time.Instance.DeltaTime;
            }

            if (Input.Instance.IsKey(KeyCodes.Right))
            {
                _angleHorz += RotationSpeed * (float)Time.Instance.DeltaTime;
            }

            if (Input.Instance.IsKey(KeyCodes.Up))
            {
                _angleVert -= RotationSpeed * (float)Time.Instance.DeltaTime;
            }

            if (Input.Instance.IsKey(KeyCodes.Down))
            {
                _angleVert += RotationSpeed * (float)Time.Instance.DeltaTime;
            }

            var mtxRot = float4x4.CreateRotationX(_angleVert) * float4x4.CreateRotationY(_angleHorz);
            var mtxCam = float4x4.LookAt(0, 200, -_zVal, 0, 0, 0, 0, 1, 0);


            // first mesh
            //RC.Model = mtxCam * mtxRot /* float4x4.CreateScale(100) * */;
            //RC.SetShader(_spColor);
            //RC.SetShaderParam(_colorParam, new float4(0.5f, 0.8f, 0, 1));
            //RC.Render(_meshTea);


            RC.ModelView = mtxCam * mtxRot * _modelScaleOffset;
            _sr.Render(RC);
            _sr.Animate();
            _guiHandler.RenderGUI();

            // swap buffers
            Present();
        }
        // RenderAFrame is called once a frame
        public override void RenderAFrame()
        {
            // Clear the backbuffer
            RC.Clear(ClearFlags.Color | ClearFlags.Depth);

            // Mouse and keyboard movement
            if (Keyboard.LeftRightAxis != 0 || Keyboard.UpDownAxis != 0)
            {
                _keys = true;
            }

            var curDamp = (float)System.Math.Exp(-Damping * DeltaTime);

            // Zoom & Roll
            if (Touch.TwoPoint)
            {
                if (!_twoTouchRepeated)
                {
                    _twoTouchRepeated = true;
                    _angleRollInit    = Touch.TwoPointAngle - _angleRoll;
                    _offsetInit       = Touch.TwoPointMidPoint - _offset;
                }
                _zoomVel   = Touch.TwoPointDistanceVel * -0.01f;
                _angleRoll = Touch.TwoPointAngle - _angleRollInit;
                _offset    = Touch.TwoPointMidPoint - _offsetInit;
            }
            else
            {
                _twoTouchRepeated = false;
                _zoomVel          = Mouse.WheelVel * -0.5f;
                _angleRoll       *= curDamp * 0.8f;
                _offset          *= curDamp * 0.8f;
            }

            // UpDown / LeftRight rotation
            if (Mouse.LeftButton)
            {
                _keys         = false;
                _angleVelHorz = -RotationSpeed * Mouse.XVel * 0.000002f;
                _angleVelVert = -RotationSpeed * Mouse.YVel * 0.000002f;
            }
            else if (Touch.GetTouchActive(TouchPoints.Touchpoint_0) && !Touch.TwoPoint)
            {
                _keys = false;
                float2 touchVel;
                touchVel      = Touch.GetVelocity(TouchPoints.Touchpoint_0);
                _angleVelHorz = -RotationSpeed * touchVel.x * 0.000002f;
                _angleVelVert = -RotationSpeed * touchVel.y * 0.000002f;
            }
            else
            {
                if (_keys)
                {
                    _angleVelHorz = -RotationSpeed * Keyboard.LeftRightAxis * 0.002f;
                    _angleVelVert = -RotationSpeed * Keyboard.UpDownAxis * 0.002f;
                }
                else
                {
                    _angleVelHorz *= curDamp;
                    _angleVelVert *= curDamp;
                }
            }

            _zoom += _zoomVel;
            // Limit zoom
            if (_zoom < 80)
            {
                _zoom = 80;
            }
            if (_zoom > 2000)
            {
                _zoom = 2000;
            }

            _angleHorz += _angleVelHorz;
            // Wrap-around to keep _angleHorz between -PI and + PI
            _angleHorz = M.MinAngle(_angleHorz);

            _angleVert += _angleVelVert;
            // Limit pitch to the range between [-PI/2, + PI/2]
            _angleVert = M.Clamp(_angleVert, -M.PiOver2, M.PiOver2);

            // Wrap-around to keep _angleRoll between -PI and + PI
            _angleRoll = M.MinAngle(_angleRoll);

            //GUI
            //RC.Projection = float4x4.CreateOrthographic(0, 0, 1280, 720);
            RC.Viewport(0, 0, 1280, 720);


#if GUI_SIMPLE
            if (isTowerSelected == true)
            {
                if (isUgradeMode == true)
                {
                    guiHandlerTowersUpgrade.RenderGUI();
                }
                else
                {
                    guiHandlerTowers.RenderGUI();
                }
            }
#endif

#if GUI_SIMPLE
            guiHandler.RenderGUI();
#endif

            RC.SetRenderState(new RenderStateSet
            {
                AlphaBlendEnable = false,
                ZEnable          = true
            });

            // Create the camera matrix and set it as the current ModelView transformation
            var mtxRot = float4x4.CreateRotationZ(_angleRoll) * float4x4.CreateRotationX(_angleVert) * float4x4.CreateRotationY(_angleHorz);
            var mtxCam = float4x4.LookAt(0, 20, -_zoom, 0, 0, 0, 0, 1, 0);
            _renderer.View = mtxCam * mtxRot * _sceneScale;
            var mtxOffset = float4x4.CreateTranslation(2 * _offset.x / Width, -2 * _offset.y / Height, 0);
            RC.Projection = mtxOffset * _projection;
            RC.Viewport(0, 0, 880, 720);

            RC.SetShader(_renderer.shader);
            _renderer.Traverse(_scene.Children);

            foreach (Tower t in listTowers.Values)
            {
                _renderer.Traverse(t.Model.Children);
            }

            foreach (Wuggy w in listWuggys)
            {
                _renderer.Traverse(w.Model.Children);
            }

            // Setup Minimap
            RC.Projection  = float4x4.CreateOrthographic(12750, 6955, -1000000.00f, 50000);
            _renderer.View = float4x4.CreateRotationX(-3.141592f / 2) * float4x4.CreateTranslation(0, 0, -300);

            RC.Viewport(885, 355, 390, 240);

            RC.SetShader(_renderer.shader);
            _renderer.Traverse(_scene.Children);


            foreach (Tower t in listTowers.Values)
            {
                _renderer.Traverse(t.Model.Children);
            }

            foreach (Wuggy w in listWuggys)
            {
                _renderer.Traverse(w.Model.Children);
            }

            updateStatusPanel();
Exemple #10
0
 public void Render(float fps)
 {
     _fps.Text = "FPS: " + fps;
     _guiHandler.RenderGUI();
 }
Exemple #11
0
        // RenderAFrame is called once a frame
        public override void RenderAFrame()
        {
            // Clear the backbuffer
            RC.Clear(ClearFlags.Color | ClearFlags.Depth);

            // Mouse and keyboard movement
            if (Keyboard.LeftRightAxis != 0 || Keyboard.UpDownAxis != 0)
            {
                _keys = true;
            }

            if (Mouse.LeftButton)
            {
                _keys         = false;
                _angleVelHorz = -RotationSpeed * Mouse.XVel * DeltaTime * 0.0005f;
                _angleVelVert = -RotationSpeed * Mouse.YVel * DeltaTime * 0.0005f;
            }
            else if (Touch.GetTouchActive(TouchPoints.Touchpoint_0))
            {
                //Reset view on touch
                ResetView();
            }
            else
            {
                if (_keys)
                {
                    _angleVelHorz = -RotationSpeed * Keyboard.LeftRightAxis * DeltaTime;
                    _angleVelVert = -RotationSpeed * Keyboard.UpDownAxis * DeltaTime;
                }
                else
                {
                    var curDamp = (float)System.Math.Exp(-Damping * DeltaTime);
                    _angleVelHorz *= curDamp;
                    _angleVelVert *= curDamp;
                }
            }

            //Rotate Scene with Mouse
            _angleHorz -= _angleVelHorz / 3;
            _angleVert -= _angleVelVert / 3;


            //Calculate view (DeviceTracking)
            float4x4 headsetRotationX = float4x4.CreateRotationX(-gameRotationVector[2] + _angleVert);
            float4x4 headsetRotationY = float4x4.CreateRotationY(-gameRotationVector[0] + _angleHorz);
            float4x4 headsetRotationZ = float4x4.CreateRotationZ(-gameRotationVector[1] + _angleRoll);

            //StereoRendering
            if (_renderStereo)
            {
                //Render Left Eye
                var camTrans = float4x4.CreateTranslation(_eyeDistance / 2, -200, 0);
                var mtxCam   = float4x4.LookAt(_eyeDistance / 2, 0, 0, 0, 0, 400, 0, 1, 0);
                RC.ModelView = headsetRotationZ * headsetRotationX * headsetRotationY * mtxCam * camTrans;
                _stereo3d.Prepare(Stereo3DEye.Left);
                _sceneRenderer.Render(RC);
                _stereo3d.Save();

                //Render Right Eye
                camTrans     = float4x4.CreateTranslation(-_eyeDistance / 2, -200, 0);
                mtxCam       = float4x4.LookAt(-_eyeDistance / 2, 0, 0, 0, 0, 400, 0, 1, 0);
                RC.ModelView = headsetRotationZ * headsetRotationX * headsetRotationY * mtxCam * camTrans;
                _stereo3d.Prepare(Stereo3DEye.Right);
                _sceneRenderer.Render(RC);
                _stereo3d.Save();

                //We do nothing here in Cardboard-Mode. Used in Oculus and Anaglyph
                _stereo3d.Display();
            }
            //no StereoRendering
            else
            {
                // Render the scene loaded in Init()
                var camTrans = float4x4.CreateTranslation(0, -200, 0);
                RC.ModelView = headsetRotationZ * headsetRotationX * headsetRotationY * camTrans;
                _sceneRenderer.Render(RC);
            }

             #if GUI_SIMPLE
            _guiHandler.RenderGUI();     //GUI is overlayed, but can also be rendered for each eye
             #endif


            // Swap buffers: Show the contents of the backbuffer (containing the currently rerndered farame) on the front buffer.
            Present();
        }
        // is called once a frame
        public override void RenderAFrame()
        {
            RC.Clear(ClearFlags.Color | ClearFlags.Depth);
            // move per mouse
            if (Input.Instance.IsButton(MouseButtons.Left))
            {
                _angleVelHorz = RotationSpeed * Input.Instance.GetAxis(InputAxis.MouseX);
                _angleVelVert = RotationSpeed * Input.Instance.GetAxis(InputAxis.MouseY);
            }
            else
            {
                var curDamp = (float)Math.Exp(-Damping * Time.Instance.DeltaTime);
                _angleVelHorz *= curDamp;
                _angleVelVert *= curDamp;
            }

            _angleHorz += _angleVelHorz;
            _angleVert += _angleVelVert;

            // move per keyboard
            if (Input.Instance.IsKey(KeyCodes.Left))
            {
                _angleHorz -= RotationSpeed * (float)Time.Instance.DeltaTime;
            }

            if (Input.Instance.IsKey(KeyCodes.Right))
            {
                _angleHorz += RotationSpeed * (float)Time.Instance.DeltaTime;
            }

            if (Input.Instance.IsKey(KeyCodes.Up))
            {
                _angleVert -= RotationSpeed * (float)Time.Instance.DeltaTime;
            }

            if (Input.Instance.IsKey(KeyCodes.Down))
            {
                _angleVert += RotationSpeed * (float)Time.Instance.DeltaTime;
            }

            var mtxRot = float4x4.CreateRotationY(_angleHorz) * float4x4.CreateRotationX(_angleVert);
            var mtxCam = float4x4.LookAt(0, 200, 500, 0, 0, 0, 0, 1, 0);


            // mesh
            RC.ModelView = float4x4.CreateTranslation(0, -50, 0) * mtxRot * float4x4.CreateTranslation(-150, 0, 0) * mtxCam;
            RC.ModelView = new float4x4(15, 0, 0, 0, 0, 15, 0, 0, 0, 0, 15, 0, 0, 0, 0, 1) * mtxRot *
                           float4x4.CreateTranslation(0, 20, 0) * mtxCam;

            //smoke
            if (_smokeEmitter != null)
            {
                RC.SetShader(_smokeTexture);
                RC.SetShaderParamTexture(_smokeParam, _iSmoke);
                _smokeEmitter.Tick(Time.Instance.DeltaTime);
                RC.Render(_smokeEmitter.ParticleMesh);
            }

            //fireRed
            if (_fireRedEmitter != null)
            {
                RC.SetShader(_fireRedTexture);
                RC.SetShaderParamTexture(_fireRedParam, _iFireRed);
                _fireRedEmitter.Tick(Time.Instance.DeltaTime);
                RC.Render(_fireRedEmitter.ParticleMesh);
            }
            // mesh
            RC.ModelView = float4x4.CreateTranslation(0, -50, 0) * mtxRot * float4x4.CreateTranslation(-150, 0, 0) * mtxCam;
            RC.ModelView = new float4x4(15, 0, 0, 0, 0, 15, 0, 0, 0, 0, 15, 0, 0, 0, 0, 1) * mtxRot *
                           float4x4.CreateTranslation(0, 0, 0) * mtxCam;

            //star
            if (_starEmitter != null)
            {
                RC.SetShader(_starTexture);
                RC.SetShaderParamTexture(_starParam, _iStar);
                _starEmitter.Tick(Time.Instance.DeltaTime);
                RC.Render(_starEmitter.ParticleMesh);
            }


            //fireYellow
            if (_fireYellowEmitter != null)
            {
                RC.SetShader(_fireYellowTexture);
                RC.SetShaderParamTexture(_fireYellowParam, _iFireYellow);
                _fireYellowEmitter.Tick(Time.Instance.DeltaTime);
                RC.Render(_fireYellowEmitter.ParticleMesh);
            }


            _guiHandler.RenderGUI();

            // swap buffers
            Present();
        }