Physics Golf

Updated: Nov 9, 2019

GitHub Repo: https://github.com/DanielW093/Physics-Golf

This project was built as a showcase of various physics simulations within a game. As with previous projects, it uses C++ in a simple rendering engine. It simulates wind, gravity, bouncing and friction in a fairly simplistic way. There is also a parallax effect being applied to the scenery, which is working in conjunction with the physics simulation.


A major problem I had to solve with this project is that unlike in a game engine like Unity where the camera just follows the player around the scene, a simple rendering engine doesn't have a physical (or figurative) camera - there is only the viewport. As a result, my physics simulation is actually calculating the movement of the ball and then applying the reverse effect to the scenery - in effect moving the scenery around the ball - to make it appear as though the ball is moving through the scenery. In the case of the parallax effect, this inverse number is simply multiplied by a decimal value to make them move more slowly.


The clouds are an interesting case, as they are moving to illustrate the wind velocity. When the ball is moving through the air, they are actually moving at the wind velocity relative to the ball velocity, something which is not necessarily obvious in the video.


This was a solo project.

Recent Posts

See All

Unity Physics Sound

A utility for creating dictionaries of sounds that correspond to physics materials in Unity, for uses such as surface dependent footsteps.

 

©2020 Daniel Williams

  • LinkedIn
  • Twitter