RoffView - Ryan's Off
Viewer

RoffView - Ryan's Off Viewer


RoffView is a small program I wrote for a course in computer graphics (CSE470) at Arizona State University. The original program was written as an MFC application with Visual C++. I have since ported the program to Java 1.3 and to OpenGL, and expanded its functionality while doing so. I also have written a number of utilities for manipulating the OFF files that RoffView works with. These can be found on my OFF Tools Page. A newer program of mine, MeshMan, also works with OFF files, and has a somewhat more advanced feature set.

Common Features In All Versions

Java Version Features

OpenGL C++ Version Features

MFC C++ Version Features

Limitations

RoffView does not at this time load or save per-polygon color data from the OFF file. Colors are specified within the program and applied to the entire surface of the model, or are specified in the file per-vertex (For the OpenGL version).

RoffView does not support 4 or n-dimensional OFF files.

RoffView only supports 3 floating-point values (RGB) for vertex color specification.

RoffView does not support the binary OFF format.

Known Bugs

None.

Gallery

View sample shots of various models and dialogs in the gallery.

Applet

Play with RoffView on-line if you have (Or want to download) the Java 1.3 Plug-In. (Or better)

Version History

Java Version 3.1 - Modified display to use the entire window, instead of the largest square that fit within the window. Fixed bug where editing in wireframe mode could not find the correct point to edit. Cleaned up code for release. (First source release. July 2004)
Java Version 3.0 - Added ability to export the current image to a PostScript format file. This works only when running as a stand-alone application, not as an applet. Also cleaned up some utility code and tweaked the lighting dialog to display numerical values for settings in tooltips. (December 2001)
Java Version 2.8 - Added a wireframe with hidden lines removed viewing mode. It uses a simplistic method of hidden line removal, painting each triangle from the tessellation in the background color, then drawing its outline. It thus has more lines than the pure wireframe display, which uses the edges from the model's definition only. Also added a "near plane" culling (not clipping) for shaded and hidden lines removed wireframe modes, so that triangles behind or a little bit in front of the viewing point are not painted. This allows going inside models, to some extent. Because the depth is based on the entire triangle this culling will fail for very large triangles, very skinny ones, or otherwise non-regular models. (November 2001)
Java Version 2.7b - Cleaned up the applet window handling to account for having multiple windows, so that both go away when RoffView is exited when run as an applet. (November 2001)
Java Version 2.7 - Added 3D clipping to wireframe displays, as the Java VM's 2D clipping was overflowing and locking the VM. Re-wrote 3D transformations slightly for speed. Added an Observer tool, that shows a second perspective of the current model with a graphical representation of the viewing model of the main window. (November 2001)
Java Version 2.6 - Added anti-aliasing in wireframe display. Re-wrote unique edge determination for faster load times. Fixed a bug with the selection of a point to edit in edit mode. Cleaned up some of the code. (November 2001)
Java Version 2.5 - Added ability to run as an applet. (June 2001)
Java Version 2.0 - Direct port of C++ version 2.1, addition of alpha-transparency support. (January 2001)

C++ OpenGL Version 3.2 - Added ability to export scenes to STL files (binary or ASCII) and to a point cloud format used by another ASU student's program. Added ability to import meshes from STL files (both binary and ASCII). Did minor fix-ups on the interior structures to handle the new features.
C++ OpenGL Version 3.1 - Added ability to export a "scene" (collection of open OFF files and their positions) to a single OFF file. This can be used to create an OFF file of a word from the OFF files of letters, for example. Added support for exporting screenshots as JPEG images, using the Intel JPEG Library.
C++ OpenGL Version 3.0 - Re-wrote much of the interior handling code to handle multiple objects. Added keyframe animation capabilities. Created a couple supporting file formats for the animation. These will be documented once I finalize the formats I want to use. Removed the interactive light positioning, as the interface was changed to handle multiple objects. Zooming and panning interface has been replaced with scene-editing equivalents.
C++ OpenGL Version 2.2 - Added support for backface culling. Improved the transformations to the mesh by recalculating some mesh information afterward.
C++ OpenGL Version 2.1 - Added support for OFF files with per-vertex colors. Added ability to disable lighting. Added options for changing the type and method of positioning the light. Added ability to move the light with the mouse by holding down shift while zooming and panning. Added the ability to apply transformations to the mesh coordinates. This is still limited, and works best if you apply your transformation, save to a new file, and then re-load the file.
C++ OpenGL Version 2.0 - Added texture mapping. Loads Windows bitmaps, or generates a checkboard texture for testing. Requires OFF files with texture coordinates, which can be found in the textured directory of the OFF directory listed at the bottom of the page.
C++ OpenGL Version 1.9 - Added ability to export image as a Windows Bitmap. Minor adjustments to rotation handling.
C++ OpenGL Version 1.8 - Re-wrote spin timer code for flexibility and speed. Added a FPS counter to give a rough idea of performance. Rotation speed adapts itself based on performance to attempt to achieve a balance between speed and CPU usage. This is done by slowing down refresh frequency if refreshes are taking more time than alloted.
C++ OpenGL Version 1.7 - Added hands-free rotation mode, so you can give the model a bit of spin and let it turn by itself. Added wireframe with hidden lines removed mode.
C++ OpenGL version 1.6 - Added ability to export rendered images as Windows Enhanced Metafiles.
C++ OpenGL Version 1.5 - Added ability to invert the mesh, reversing inside and outside.
C++ OpenGL Version 1.4 - Added ability to copy the current image to the Windows clipboard (As a Windows Enhanced Metafile). Added a display in the status bar to show the current image size in pixels. Added keyboard controls for rotation, using the arrow keys.
C++ OpenGL Version 1.3 - Souped up the normal calculation to handle degenerate cases better. Removed flickering problem when re-sizing the window.
C++ OpenGL Version 1.2 - Added flat shading as an option. Added support for OFF loading for the NOFF variety of OFF file, where normals are specified in the file for each vertex instead of allowing the viewer to calculate them on the fly.
C++ OpenGL Version 1.1 - Fixed a bug where loading an invalid OFF file would crash instead of gracefully refusing. Previous code worked on a debug compile, but not on a release compile.
C++ OpenGL Version 1.0 - Initial release.

C++ Version 2.5 - Cleaned up source code (from the end of 2000, two years ago) for release. Fixed several GDI object leaks, added comments, and tidied things up a bit.
C++ Version 2.1 - Fixed bug that caused exceptions when using shaded display mode on Windows 98 (But not on Windows 2000).
C++ Version 2.0 - Addition of illumination model, shaded display, pointfield display. Extensive re-write of underlying classes for speed.
C++ Version 1.5 - Addition of full rotation to first project
C++ Version 1.0 - First project. Perspective viewing, loading and saving of files, limited rotation of model

Downloads

Visual C++/OpenGL version 3.2, zip file containing Win32 executable, 150KB RoffViewGL.zip
Visual C++/OpenGL version 2.2, zip file containing Win32 executable, 26.3KB RoffViewGLold2_2.zip
Java 1.4.2 version 3.1, executable jar file, 36.6KB jroff.jar
Java 1.4.2 Version 3.1, zip file containing Java source files. 32.8KB JRoffView_3_1_Source.zip Read the ReadMeJ.txt file from the zip file, explaining its contents.
Visual C++ version 2.5, zip file containing Win32 executable, 165KB RoffView.zip
Visual C++ version 2.5, zip file containing Visual C++ 6.0 project files and source code, 64.7KB RoffView_2_5_Source.zip Read the ReadMe.txt file from the zip file, explaining its contents.

Note that the 2.2 OpenGL version is outdated. It is still available because it is sometimes nice to simply view a single OFF file without dealing with controls designed for multiple OFF files. I recommend my newer program, MeshMan for such situations.

For sample OFF files and more information about the OFF file format, see my OFF Files page.

The original project specification for part one, Word document, 36KB ProjectOne.doc
The original project specification for part two, PDF document, 27KB project2.pdf

Note: Source code for the OpenGL version will not be available here, as this project or something similar may be re-used by Dr. Nielson. If you are interested in the source for a use unrelated to CSE470, contact me.


Page contents copyright 2000-2004, Ryan Holmes
Graphics Links at Holmes3D.net
The Off Tools Page