GARIN R. K. RICHARDS
  • HOME
  • linkedin

DEV-LOG

Assignment 8: Let There be Meshes

10/25/2017

0 Comments

 
Picture
At Game Start
Picture
After pressing the 'right' key

Updating the Simulation

As per the function GetSimulationUpdatePeriod_inSeconds(), The simulation is set to update every 15th of a second. For fun I set the update rate to be twice as often, at every 30th of a second. This resulted in a higher frame rate, which had my objects moving on screen much faster than prior. Due to the fact that the velocity of the moving mesh is dependent on it's update frequency, which is tied to frame rate.

Concerning UpdateSimulationBasedOnInput()

In this function we had the task of detecting when a given keypress is registered by the game. For simplicity's sake, we've designated the arrow keys to be the controls for moving the movable mesh in a given direction. When a given direction/arrow key press is detected, we manipulate the velocity of the object by adding a small delta to its internal velocity. Later, this velocity will be applied to the position to properly do the position manipulation.

Concerning UpdateSimulationBasedOnTime()

Like discussed prior, there needed to be a place for the position of the object to be properly updated. This is where this occurs, by modifying the position of the object by applying the stored velocity. This velocity was of modified in the appropriate function that listened for key press events.

Updating the PerDrawCall Constant Buffer!

The final step to make sure that our object is properly displayed on the screen according to its current position is the perDrawCall buffer. This is needed because prior to drawing the mesh, we set the global position of the mesh to the current position of the mesh. Of which, will (hopefully) be updated in the future to only specifically manipulate a mesh's specific location.

As the name suggests, it needs to be updated every draw call. Of which we do, prior to drawing the actual mesh in the binding and drawing step of rendering the frame.

Downloads

You can try out these games via the below links. The only difference is that Direct3D will be used in the x64 version, with OpenGL in the other. They have been built and verified to work on Windows. For this post, the space bar is used to swap the textures on screen.
assign8_garinrk_x86.zip
File Size: 553 kb
File Type: zip
Download File

assign8_garinrk_x64.zip
File Size: 561 kb
File Type: zip
Download File

- Garin
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Categories

    All
    Engines
    Programming

    RSS Feed

Powered by Create your own unique website with customizable templates.
  • HOME
  • linkedin