CMPM-147-01
Assignment 2: Terrain Generation with Perlin Noise
Skip To Content
Dashboard
  • Login
  • Dashboard
  • Calendar
  • Inbox
  • History
  • Help
  • Resources
Close
  • My Dashboard
  • CMPM-147-01
  • Assignments
  • Assignment 2: Terrain Generation with Perlin Noise
2019 Summer Quarter
  • Home
  • Assignments
  • Files
  • Syllabus
  • Quizzes
  • Collaborations
  • Google Drive
  • NameCoach
  • Zoom
  • YuJa
  • Gradescope
  • SETS

Assignment 2: Terrain Generation with Perlin Noise

  • Due Jul 11, 2019 by 12:30pm
  • Points 10
  • Submitting a file upload
  • Available Jul 2, 2019 at 1pm - Jul 18, 2019 at 11:59pm
This assignment was locked Jul 18, 2019 at 11:59pm.

Objectives

Implement a voxel-based terrain generator (similar to Minecraft) using Perlin Noise.

Description

Noise produces a naturally ordered (“smooth”) sequence of pseudo-random numbers. It can be used to generate various effects with natural qualities, such as clouds, landscapes, and patterned textures like marble. In this assignment, you will use Perlin Noise to generate voxel-based worlds similar to Minecraft. The animation below shows an example of how the output of your assignment should look like.

 

Jul-10-2019 14-45-10.gif

Example of how a 128x32x128 world with cube size equal to 32 should look like if you use only one type of cube (grass). This example uses a very simple view frustum culling  technique (check if cube is in the line of sight) to optimize the performance. A 32x32x32 world should run smoothly without any optimization.

A voxel-based world consists of 3D grid of height h, width w and depth d, where h, w and d are integer numbers representing amount of fixed-size cubes (e.g. size 16).  

  1. Create a new Processing (P5.js) sketch in a directory called "asg2" with at least three files: "index.html",  "sketch.js" and "world-generator.js".
  2. Write (in "world-generator.js")  a "WorldGenerator" class with the necessary properties and methods to instantiate a voxel-based world with a given seed as well as width, height and depth representing number of unit cubes.
    • For each cell on the x-z plane of your world, generate a random number between 0 and 1 with the noise(x, z) function.
    • Map this random number to an integer y representing the cube height. 
    • Map this cube height to a cube type (e.g. deep water, shallow water, sand, grass, mountain, etc). 
    • Each cube type has to be textured with one or more textures.
    • If the same seed is given is input, the same world should be generated. 
  3. Instantiate (in "asg2.js") a a world generator and generate a world of size at least equal to w = 32, h = 32 and d = 32.
  4.  Using the the p5.js built-in p5.Camera class, implement a simple first person camera that can be moved with keyboard (w, a, s and d) and rotated with mouse. You don't need to implement any type of collision detection, i.e. the camera can move through cubes in the world.
    • Implement the mouseDragged() function to capture moues drag events.
    • Inside mouseDragged(), use p5.Camera pan() function to pan the camera and the function tilt() to tilt the camera. You can use event.movementX and event.movementY to access the amount of movement of mouse during the drag event.

Resources

  • Making maps with noise functions. Links to an external site.
  • 3D scenes in p5.js
    • Cubes Links to an external site.
    • p5.Camera Links to an external site.
    • Textures Links to an external site.

Submission

Host your source code on Github and upload the following on Canvas:

  1. A zip file with the final version of your code.
  2. A link (as a comment to your submission) to this assignment's github page. This page should have examples (.png or .gif) of outputs of your world generator with a brief explanation (1 paragraph) of what (and how) the noise was used to generate the world.
1562873400 07/11/2019 12:30pm
Please include a description
Additional Comments:
Rating max score to > pts
Please include a rating title

Rubric

Find Rubric
Please include a title
Find a Rubric
Title
You've already rated students with this rubric. Any major changes could affect their assessment results.
 
 
 
 
 
 
 
     
Can't change a rubric once you've started using it.  
Title
Criteria Ratings Pts
This criterion is linked to a Learning Outcome Description of criterion
threshold: 5 pts
Edit criterion description Delete criterion row
5 to >0 pts Full Marks blank
0 to >0 pts No Marks blank_2
This area will be used by the assessor to leave comments related to this criterion.
pts
  / 5 pts
--
Additional Comments
This criterion is linked to a Learning Outcome Description of criterion
threshold: 5 pts
Edit criterion description Delete criterion row
5 to >0 pts Full Marks blank
0 to >0 pts No Marks blank_2
This area will be used by the assessor to leave comments related to this criterion.
pts
  / 5 pts
--
Additional Comments
Total Points: 5 out of 5