Git Product home page Git Product logo

comp30019-project1's Introduction

# COMP30019-Project1

## Camera Control
- All controls were Inplemeted in Update() method, and using Unity Input API
- Mouse: Based on transform.Translate, get the horizontal and vertical axis value and multiply the predefined speed
- Keyboard: Based on transform.eulerAngles, get every frame's mouse position and multiply the the predefined speed

## Water
- Vertex Shader: Simulated the displacement using cosine function and apply speed, strengh and color variables to the vertex.
- Mesh: Created a plane instance and assigned it to water MeshFilter
- Position: Set the water mesh render's Y position equal to half of the terrain's height
- Phong illumination: Applied ambient, diffuse and specular reflections on the water so there is a reflection of the sun.

## Terrain
- DiamondSquare: Starting from initializing heights for four corners and for each diamond and square steps, we calculated the average height from four points and added a random noise in order to make the terrain realistic.
- Color: In order to properly display the rocky or snowy view of the terrain, we used a if-else if conditional statement to assign different colors for each part depending on their heights such as snow, rock, woods, beach and riverbed.
- Phong illumination: Applied ambient and diffuse reflection on the hill in mountain's shader.

## Sun
- Rotation: Used Lab 2 Code XAxisSpin.cs to implement the rotation
- Mesh: Apply a sphere MeshFilter and Sprites/Default shader

## Reference
- Water shader: Following the ideas from the video tutorial (https://www.youtube.com/watch?v=lWCPFwxZpVg)
- Lab 2 Code for Sun Rotation and Lab 5 Code for Phong illumination
- Parts of the diamond-square algorithm are retrieved from website (https://www.youtube.com/watch?v=1HV8GbFnCik), the method to create the landscape using the general idea of the source code from that link, and modified to suit this project.
- Most of the shaders, including the phong shader for the terrain and water shader, are retrieved from the COMP30019 workshop source code materials to complete this project.

comp30019-project1's People

Contributors

cheese0409 avatar chengw4 avatar clapbear avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.