Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
ANU - College of Engineering and Computer Science - SoCS - COMP4610
| |
ANU College of Engineering and Computer Science School of Computer Science

a simple drawing program. Compile and run it ("javac Line.java; java Line"). You will see a picture with a snowman on the left (drawn by the standard Java line drawing method) and an empty picture on the right (this is what your code draws). The aim is to have both identical. After 5 seconds of running the program marks with blue each pixel in the right drawing that is different to that of the left drawing. On the terminal the program will output the number of different pixels (this should be 0). Also on the terminal the time taken for each approach (standard and yours) on a fixed set of lines is given in ms.

Your objective is to implement the line method such that the snowman is correctly drawn. A little bit of blue in this step is okay for gaining the 3 marks.

A simple loop and floating point operations is okay in this step. How does the performance compare to the original? (The program kmag may be helpful in looking at individual pixels.)

Step 2 (2 mark)

Re-implement your line drawing algorithm using the Bresenham approach. To gain this mark you must not have any blue (well maybe a very small amount!). Is it much faster?

Step 3 (1 mark)

Copy your code to a new class called LineAlias. Remove the 'blue' marking after 5 seconds in the code. Implement a line drawing algorithm that does anti-aliasing. Check that it looks visually better. Also check that the line crossings look okay.
| | |

本站部分内容来自互联网,仅供学习和参考