Example code - CSU540 Computer Graphics - Fall 2005

Professor Futrelle, Northeastern University, CCIS

Version of 4 September 2005

This page includes pointers to source code, to directories containing sources and executables and to sites that have sample graphics code. In particular, here is a link to a number of directories and files.

A separate, recent example, Fall 2005, is this one on ray tracing a triangle.

If you want to ftp to the directory where the files are in order to transfer them that way, you'll want to move to this directory: /home/futrelle/.www/teaching/csu540f2005/examps/examps/

You are welcome to adapt any of the code you find here for your projects. You may also want to adapt code you find elsewhere. But it's very important that you write most of the code yourself. It's also important that you carefully describe the origin of any code that you adapt. I'm quick to notice code that is not code you wrote yourself, believe me. Using others' code and pretending it's yours is plagiarism and a violation of the university's code of conduct.

An important limitation on adapting code is that you will have to develop data structures and code for certain capabilities that you could bypass by using builtins, e.g., the built-in linear transformations of Java 2D. Instead, you will be required to build them yourself, from scratch.

A Sun site has many Java 2D examples. Some simple Swing examples can be found here.

Geometry classes for ISU540 class added 24 and 25 January 2005

The first items added were the API for the four classes. These should be studied. Futrelle will go over the source code in class before posting it along with the first related assignment.

The source code for the four "geometry" classes have been added in addition. You can access them here

Notes on selected examples

When all the examples from the Sun site I've included are added up, there are too many to comment on individually. But below are comments on selected ones of mine and a few from the Sun site. See also my comments on timers, which can be useful for animation.


Go to CSU540 homepage. or RPF's Teaching Gateway or homepage