Programs
What kind of programs are there ?
There are two types of programs.
- Data Reduction Program is written by LISP. LISP interpreter is required to reduce graphics data and merge a set of files into one file.
- Network Brower Program is written by JAVA. JAVA extension is required to run the browser.
How to use LISP files ?
The instruction of using LISP programs is as follows.
- Down load all necessary LISP files by just clicking and saving them.
- Run LISP interpreter
- Load "load-me-first.lisp"
- Follow the directions of the program. This looks like as follows.
> (load "load-me-first.lisp")
;;; Loading source file "load-me-first.lisp"
**************************
* Please type (load-data) *
**************************
#P"/amd/sundown/h/mukai/Courses/cs790/project/load-me-first.lisp"
> (load-data) <---- Type (load-data)
Please hit any key + return!
(ARE ALL FILES IN THE CURRENT DIRECTORY ?)
(PLEASE INPUT Y OR N.)y <---- Assume answering y here
definition.sbin
utility.sbin
reduction.sbin
one-by-step.sbin
some-by-step.sbin
merge-files.sbin
(ARE THERE ALL THE ABOVE FILES IN THE DIRECTORY ?)
(PLEASE INPUT Y OR N.)n <---- Assume answering n here
definition.lisp
utility.lisp
reduction.lisp
one-by-step.lisp
some-by-step.lisp
merge-files.lisp
(ARE THERE ALL THE ABOVE FILES IN THE DIRECTORY ?)
(PLEASE INPUT Y OR N.)y <---- Assume answering y here
(CAN YOU COMPILE FILES ?)
(PLEASE INPUT Y OR N.)y <---- Assume answering y here
;;; You are using the compiler in PRODUCTION mode ...
;;; ......
;;; Reading source file "definition.lisp"
;;; Writing binary file "definition.sbin"
;;; Loading binary file "definition.sbin"
;;; ......
;;; Reading source file "merge-files.lisp"
;;; Writing binary file "merge-files.sbin"
;;; Loading binary file "merge-files.sbin"
##############################################################
# Welcome to data-reduction of VRML!! #
......
# input0 < input1 < input2 < input3 < input4 < input5 #
##############################################################
NIL
> (count-data "dolphin.wrl") <---- Assume counting data of dolphin.wrl
vertex-number=285 facet-number=563
NIL
> (reduction "dol_250.wrl" "dolphin.wrl" :vertex-num 250)
<---- Assume making reduced dolphin data which has 250 vertices.
vertex-num is 285. Goal(250) facet-num is 563. Goal(10000)
Current error is 1.965716028441366. Max-error is 10000.
....
vertex-number=250 facet-number=493
NIL
> (merge-files "dol_mer.wrl" "dol_100.wrl" "dol_250.wrl")
<--- Assume merging dol_100.wrl and dol_250.wrl
Merging dol_250.wrl into dol_100.wrl
vertex-number=100 facet-number=196
deleted-vertex=0 added-vertex=150 deleted-facet=132 added-facet=429
vertex-number=250 facet-number=493
NIL
>
How to use JAVA files ?
The instruction of using JAVA programs is as follows.
- Down load all JAVA files by just clicking and saving them.
- Compile java source files by using make command located at the end.
- Put the new file name into files.lst found at the end.
Files.lst can support only 10 files in this version.
- See Usage for the usage of the browser.
Down load LISP files
There are 7 lisp files to reduce graphics data and to merge them into one file.
- Load-me-first.lisp
This file loads all necessary files according to questions and answers.
- Definition.lisp
This file contains global constants, variables and structures.
- Utility.lisp
This file contains useful methods and functions.
- Reduction.lisp
This file reduces a graphics data by checking the amount of data and errors.
- One-by-step.lisp
This file defines functions of one-by-step strategy which reduces graphics data by removing one vertex at one step.
- Some-by-step.lisp
This file defines functions of some-by-step strategy which reduces graphics data by removing some vertices at one step.
- Merge-files.lisp
This file merges a set of reduced data files into one file.
Down load JAVA files
There are 16 classes in GraNet.
- GraNet
This is an extension of the Applet class and defines the positions of several panels and a canvas. Also, this class reads VRML files and stores the data for the future use. Several actions such as mouse press, key press are also defined in this class.
- Panel0
This is an extension of the Panel class and defines the format of the file input region.
- Panel1
This is an extension of the Panel class and defines the format of the file select region.
- Panel2
This is an extension of the Panel class and defines the format of the change action region.
- Tcanvas
This is an extension of the Canvas class and defines the format of the display region. Also, this class redisplays an image according to actions such as rotation and expansion. Progressive refinement action is also defined in this class.
- Genpoly
This is an extension of the Polyhedron class and defines the concrete class because Polyhedron is defined as an abstract class.
- Polyhedron
This class is an extension of the VisualObject and defines the several functions such as set color, transformation of polygons. This class is defined as an abstract class.
- VisualObject
This class is defined as an abstract class. The concrete functions are defined in Polyhedron and Genpoly class.
- VisualWorld
This class defines camera functions for painting images according to the change of camera parameters.
- ViewTransformer
This class defines transformation calculations such as view transformation and perspective transformation.
- Vector4
This is an extension of the Vectorf class and defines 4 dimensional vector calculation such as addition, subtraction, dot product and cross product.
- Vectorf
This class defines the vector composed of floating point values.
- VectorI
This class defines the vector composed of integer values.
- Matrix4x4
This class defines the 4 by 4 matrix and some functions such as multiply, scaling and rotation.
- VectorPolygon3D
This class defines polygons using vector class.
- Polygon3D
This class defines polygons.
Makefile of the browser is here.
VRML file list is here.