COMP3170 2020 Assignment 1 SES Helicopter
Due: 7.00pm Tue 28 April 2020 (week 8)
Value: 20%
Revised: 21 March 2020
The State Emergency Service assists people affected by natural disasters. In this assignment, you will develop a 2D computer graphics simulation of the operation of an SES Helicopter in a flood setting.
Australia often experiences natural disasters, particularly flood. In this assignment scenario, a flood is rising near a town, threatening the town and its residents. The SES helicopter (in this assignment) can travel over the flood-affected area, looking for situations that require assistance. The simulation will allow the end user to develop their skill in deciding what the helicopter should do as the situation develops in order to most effectively protect the town and its residents.
Development environment
Your program is required to compile and run in eclipse/Java/OpenGL. We will test your program in the following environment on a Windows 10 PC. As much as possible, please use the same software versions in your own development environment on your own device. In your report, you will tell us the software and hardware versions of your development environment. Please keep your development environment on your computer until your assignment mark has been finalised. We may contact you to resolve any problems that arise from differences in the environment.
Java JDK version used for compilation
13.0.2
Java compiler compliance level used for compilation
13
Java JRE version used for execution
13
Eclipse version
2019-06
Computer Operating System and version
Windows 10
Task Description
This assignment is about 2D graphics in Java/OpenGL using JOGL and GLSL.
Write a Java/OpenGL program that provides an overhead view of an emergency services helicopter. Show the helicopter flying over the flood scene and performing actions as described below. The program is controlled by the mouse and keyboard.
Also write a short report that discusses the important features of your program, with screen shots, and provides a very brief user documentation explaining how important features work. Use the report template provided with this assignment on iLearn. On the front page of the template there is a table where you must select the features that you have implemented.
Your program must meet the following specifications.
1. Your program is to compile and run in the eclipse/Java/OpenGL environment as installed in the lab. In particular, your program will be tested on a computer running the same environment as in the lab. Because this unit is being offered online, you will be developing your solution in your own environment. Be sure to report that environment to the marker by filling in the details in the report template.
2. Your program must be embedded in an eclipse project, inside a git repository on github. Develop your project from the assignment template provided on github classroom.
3. Do not set the Java versions (compiler compliance, JRE version) within your project. Use eclipse Preferences window for these settings – they will apply to all your projects automatically.
4. Your program may not use any graphics libraries other than those provided and used in COMP3170 – OpenGL/JOGL and JOML.
5. The program will display the helicopter as viewed from above, along with other features (see below).
6. The helicopter may be in flight or hovering. An added feature allows the helicopter to land at an SES base.
7. Short-cut keyboard actions are needed to support some additional features as defined below.
8. The program must be properly commented, with authorship information including your name and student ID. Each procedure or function must have a brief comment describing the behaviour of that function. Data structures / classes must be similarly described.
9. The program must follow Java/OpenGL/GLSL coding conventions as presented in this unit.
10. The program’s display should fill the entire canvas. Optionally, the program should adapt to
changes in the canvas size.
11. The program code must be your own original work. Where you use ideas from other
people’s programs, you must acknowledge the author in a comment and include the URL of the source if it is on the Internet. You may use code examples from the COMP3170 web site/github classroom site; however, it is also appropriate to acknowledge them.
12. In order to receive marks for the operational features of your program, they must be obvious to the marker. This means that the marker will not be reading your source code to look for documentation embedded in the program. Instead, they will check out the things that they can see on the screen, and in the first page of your report.
13. Use exactly the command keys as listed in this assignment specification, so that the marker can easily operate your program.
Features
Note that the features total more than 100%. This is to allow you opportunity to choose which features you implement. On the front page of your report, you will select which features you want
to be marked on. Note that you should not select features with a total of more than 100% – if you do, your final mark will be based on the first selection of features that total no more than 100%, not the sum of marks for every feature that you implement. In other words, do a good job of implementing a set of features that total to at most 100%, rather than trying to implement more features but doing a poor job of each of them.
The first two features are essential for a pass mark. All other features are optional.
See the supplied sample screen shot as an example of what the various features may look like. It is not intended that you copy the example screen shot, but you are encouraged to use it to aid your understanding of the key ideas.
Static terrain with buildings, trees, a (flooded) river, and a helipad. 40%
Learning outcome: Drawing in 2D using OpenGL.
Essential feature. This is the basic background feature required of every program. Start with this.
Show a town from the air, with a flooded river nearby. For simplicity, the river can be straight and the town can consist of a collection of at least 3 simple buildings and a few trees. See the sample screen shot for an example of what this could look like. Include a helipad near the town.
For best marks for this section, use appropriate colours for the ground, buildings and flooded river. Your background must be drawn with OpenGL – you may not simply use an image as the background, although you may use textures appropriately if you wish.
Hint: There is no need to use a font or text to draw the helipad.
Moving the helicopter with keyboard control: turning, moving forward. 30%.
Learning outcome: Application of transformation matrices.
Essential feature. This feature provides a basic helicopter. The helicopter can be a simple polygon that roughly resembles a helicopter viewed from above. The helicopter should appear to be about 50-150 pixels long – detail needs to be visible but the helicopter should be able to move on the screen a significant distance relative to its length. The helicopter does not need to be in scale relative to the features on the ground.
The helicopter is assumed to be hovering when the program starts. Keyboard commands are used to control the helicopter – see the keyboard command table below. The speed of rotation of the helicopter, and the speed of movement, should be chosen so that it is possible to move the helicopter across the screen in about 4-8 seconds, and it should be possible to rotate the helicopter by 180 degrees in about 2-4 seconds.
Helicopter with spinning tandem rotors. 10%
Learning outcome: Use of scene graph attaching moving objects to another moving object.
Enhance the helicopter by showing spinning rotors on top of it. Google “helicopter with tandem rotors” or see https://en.wikipedia.org/wiki/Tandem_rotors. You will find that such helicopters have one rotor at the front and another at the rear. The rear rotor spins in the opposite direction to the front rotor.
Whenever your helicopter is in flight, or hovering, the rotors should spin relative to the body of the helicopter. Choose a rotation speed that allows the user to clearly see the rotation happening – say 1⁄2 to 1 rotation per second.
Resizing the canvas, maintaining display resolution. 10%
Learning outcomes: Respond to resize event, scaling of drawing.
If the user resizes the drawing canvas, your program will ensure that the resulting display maintains the same display resolution. This means that a larger canvas will show more of the world, while a smaller canvas will display less of the world. Ensure that your solution maintains a sensible and useful display even if the canvas is resized many times. For best marks, keep the helicopter on the screen when the canvas is resized.
Control helicopter with the mouse. 10%
Learning outcomes: Converting mouse positions to world coordinates, sequenced animation.
Your program responds to a mouse click on a screen location by sending the helicopter to that location. The helicopter must turn towards the target position, and fly towards it. When it arrives, it must hover at the location, awaiting further commands.
Animate the helicopter to respond to the mouse click by turning towards the destination position and then flying towards it. To provide the user with reasonable control, it should take somewhere between 4 and 8 seconds for the helicopter to move from one side of the screen to the other.
Simple animation of the helicopter will appear that the helicopter can turn on the spot when it is stationary but the helicopter should not spin too quickly– it should take the helicopter somewhere between 2 and 4 seconds to complete a 180 degree rotation.
To instruct the helicopter to move, the operator clicks on the destination position for the helicopter. The helicopter then starts to execute the instruction, by turning to the direction of travel and then flying forward at a steady pace until it reaches the marked point where it hovers.
For added realism, the helicopter may be observed to accelerate and decelerate rather than instantaneously changing its speed of motion. It may also be observed to turn and fly forward at the same time, traveling on an initially curved path towards the destination.
Take-off and Landing at the Helipad. 10%
Learning outcome: Scaling in 2D,
In this option, the helicopter is initially on the helipad. The operator can issue the take-off command (see table below) and the helicopter will rise. To give the appearance of rising, without using 3D graphics, the helicopter should be drawn about half size when on the ground and normal size when in the air. Smoothly zoom the helicopter between the sizes, taking about 1 second for the entire zoom operation.
When in the air, the helicopter can fly to another location as it normally would.
When positioned over the helipad, the land command (see table below) reverses the process, landing the helicopter on the helipad.
Camera mounted on the helicopter. 10%
Learning outcome: Attaching camera to object in the scene graph.
The program normally shows the view from above the entire scene. Provide a short-cut command as listed below to switch to show the view from the helicopter. The same command can switch back to show the entire scene – it switches between the two modes.
The helicopter itself will not appear in the view from the helicopter. To make the view from the helicopter more interesting, show only the area immediately surrounding the helicopter, with all features on the ground enlarged by a factor of between 2 and 3, as though the camera on the helicopter had a telephoto lens. Also, when the helicopter lands (if you are implementing that feature), zoom in on the helipad and zoom out again when it takes off.
Note that, when the helicopter turns, the ground scene will appear to rotate in the opposite direction, since the camera turns with the helicopter. Similarly, when the helicopter flies forward, the ground will appear to move in the opposite direction because the camera is moving with the helicopter.
You should assume that the camera on board the helicopter is aligned so that “up” in the image corresponds to the longitudinal axis of the helicopter – i.e. to the direction “forward” on the helicopter.
Minimap. 10%
Learning outcome: Drawing in multiple viewports; scissor.
Use a viewport to draw a minimap of the entire world and the helicopter location in a corner of the screen. Use the entire canvas, other than the minimap viewport, for the main camera view.
Curved rivers. 10%
Learning outcome: Bezier curves and extrusion.
Draw the river and a branch, or two rivers, as extruded curved 2D shapes using Bezier curves in your program.
Heads up display. 10%.
Learning outcome: Drawing in another coordinate system (not the “world” coordinates).
Provide a status display overlaid on a corner of the camera view that shows the ground speed of the helicopter. When the helicopter is hovering or landed, it should show 0 speed, but when it is flying forward it should show the speed of motion. Draw a standard “needle” type of speedometer, and you don’t have to show any numbers, just the needle. You might add tick marks and arcs such as you would see on a speedometer.
Forest using Instancing. 10%
Learning outcome: Drawing a collection of objects using instancing in the shader.
Draw a forest of at least 40 trees in part of the world. Use instancing in a shader program to draw the forest from a single tree defined by attributes. The base tree should have at least 20 vertices
and be more visually interesting than a simple circle and stick tree (as shown in the sample screenshot). You may also use uniforms and other GLSL features to aid in drawing the forest.
Sample screen shot
Below is an example of what a solution to this assignment might look like. You are expected to design your own solution, not to copy this example. However, this screen shot gives you an idea of the basic appearance with some of the features implemented. More sophisticated visual appearance may be rewarded as creativity.
Keyboard Commands
To avoid any confusion, here is a table of all keyboard commands that you may use in this assignment. You must use the exact keyboard commands listed here, to simplify marking.
Where more than one key is listed, your program should respond to every alternative. For example, to land the helicopter, the user may press lower case ‘l’ or upper case ‘L’ and both should work.
Keyboard command
Action
Left arrow
Helicopter rotates anticlockwise in the world as viewed from above. Hold for continuous rotation.
Right arrrow
Helicopter rotates clockwise. Hold for continuous rotation.
Up arrow
Helicopter moves forward a fixed distance. Hold to fly forward at a fixed speed.
‘l’ or ‘L’
Land the helicopter at the base
‘t’ or ‘T’
Take off from the base. The helicopter rises and hovers.
‘c’ or ‘C’
Switch camera views – normal or helicopter mounted camera
Submission
Submit your program by committing the eclipse project to github, starting with the github classroom template for the assignment. Include your report in the repository as a PDF file – you may also include the MSWord or other word processing source file, but we will mark the PDF file. You are strongly encouraged to commit frequently as you are working on your assignment. This provides a back-up in case you experience a disaster, and allows you to wind back changes if you make a serious programming mistake. We will not show leniency if something goes wrong with submission at the last minute and you have no earlier commits. Finally, if you experience illness or misadventure, we expect your github repository to reflect the work that you performed before the event.
Be sure that your program does not crash in testing – markers cannot correct programming bugs that you may introduce at the last minute so be sure to test your final version thoroughly before you commit it. To be precise, the marker will mark the most recent revision of the master branch in the github repository, which must not have been committed after the assignment due date. In the event that your last commit to the master branch is after the due date, we will mark an earlier commit that is before the due date. We will not mark a late submission unless you have a personal extension as a result of special consideration.
Markers cannot test your program in a non-standard environment. Please use the standard environment on your computer, unless there is a specific problem. Be sure to report details of your environment in your report.
Make small changes and test them thoroughly before moving on to other features. This is particularly important when working on shaders because the compiler errors are not very informative.
Test the interactions between features.
Make it clear to the marker what your program can do, and how to use it. In particular, the summary table in your report will be used by the marker to explore your program’s capabilities.
Special Consideration, Illness and Misadventure
The University is responding to the COVID-19 situation. This may result in a general extension to the deadline for submission or other adjustments to the assignment. Please monitor iLearn for any updates related to the assignment.
If you experience illness or other misadventure that prevents you from submitting the assignment on time, please follow the University’s procedure to request special consideration. Also be sure to commit the latest version of your work to github before the due time, as evidence of the work that you were doing before/during the illness or misadventure event. We expect to see in your repository a git history recording the progress that you were making before the event.
After your request for special consideration, if you become able to resume work on the assignment, you may continue working and push the commits to github. In the event that you are granted an extension, the work that you have done up until the new due time will be marked. If your special consideration request is not accepted, we will mark the last committed version before the original due time.
Marking
The features that you identify in your report will be marked against the requirements listed above, producing a mark for features out of 100%. These marks will be for implementation, showing that you have understood and applied the relevant OpenGL/GLSL features. Each feature that you implement will be marked for completeness of the implementation against the specification – you will receive fewer marks for an incomplete or non-conforming implementation of a feature.
Select the features on the front page of your report that you want to be marked. Do not select features totalling more than 100%, as the marker will ignore excess features. You are permitted to implement additional features in your program that you choose not to have marked, but those features will not count towards your feature mark.
Your program quality will also be marked out of 100%, using the rubric below.
The final mark will be the product of these two marks – the feature mark multiplied by the program quality mark. For example, if your feature implementation earns 90%, and your code quality is 80% (e.g. 45% for correctness, 25% for clarity, and 10% for creativity), then your final mark would be 72%.
Program quality rubric
Your program quality will be marked for correctness, clarity and creativity according to the following rubric.
Mark (%)
Correctness (50%)
Clarity (30%)
Creativity (20%)
100
Code is free from any apparent errors.
Good consistent style. Well structured & commented code.
Original use of graphics to achieve effects not included in lectures or pracs.
95
Code has minor errors which do not significantly affect performance
Minor inconsistencies in style, or patches of undocumented code.
90
Code has one or two minor errors that affect performance
Code is mostly readable but could be better structured
Creative use of graphics effects from lectures/pracs to add distinctiveness to submission
80
Code has multiple significant errors
Code is inconsistently structured, but readable
70
Code is functional but contains major flaws
Code is poorly structured and patchily documented
Basic effort put into colour palette and shapes to give the simulations a consistent visual style
<60
Code is not functional
Code is undocumented and largely unreadable
Implements required features without effort put into visual style