glVisualizer

by Wing Keong Loo

Download the zipped executable glvis.zip - 163Kb

This is a port of the osurfnorm program which includes a graphical front end written with OpenGL and the Windows MFC library. It allows the user to specify the points which represent the profile segment graphically and will show a preview of the revolved result. The outline can be saved as .glv files. The revolved figure can be saved to a text file revolve.txt with the export command. Revolve.txt is an optik script file describing the resultant object. The object is normalized to a maximum height of 10 and is translated to the origin.

Commands are accessible through the menus and the option dialog is activated with the right mouse button. When the program starts up, the user is presented with a drawing surface in the positive x, y plane. The cursor is a crosshair, indicating it's readiness to accept left mouse clicks or drags to define the points. To delete the last point made, use the delete key or the Delete Last command from the edit menu. The program will revolve the line segment( at least 2 points ) about the y axis when the preview command is issued from the pop up menu or the toolbar button. It will then show a preview of the object with lighted, flat shaded OpenGL polygons. The user will notice the cursor has changed to an arrow and can use the left mouse button with click and drag, to rotate the figure.

The other options in the menu and toolbar include insert points, delete points, and move point which have not been implemented yet. Notice however the cursors for these commands have been defined and that all the menus and buttons are disabled and enabled to the right set of conditions, for e.g. no points defined. The other menus and toolbar buttons such as File New are standard windows commands. The option dialog box can be accessed both with the right mouse button and through the view menu. It contains the following options. The sector option allows the user specify the number of sectors to create in the revolve( default is 20 ). The Materials option selects the current color and material but not resultant optik surface( enhancement later ) . Shading model chooses between smooth and flat shading and the anti-aliasing option is to turn on anti-aliasing. It is not recommended to use that option as it takes too much processing power. Another option is the distance between points in pixel that the program will generate as the outline is drawn with left mouse button drags.

Limitations and other features.

The user is arbitrarily limited to 49 points in defining the profile. Extra points will cause memory overwrites and crash the program at present. This limit can be increased statically at compile time but can only be removed with a total rewrite of the basic osurfnorm revolving code. The lighting model for the preview has been improved. The program handles windows redraws and resizes intelligently. Try drawing some points, resize the window ( notice the figure is scaled proportionately ), continue to draw and resize the window again. The first and last segments of the revolved object does not have normals, consequently it wall appear black. This is a problem with the osurfnorm code which I will look at when I can.

To do's

screen shot of glVisualizer.glVisualizer screen shot.
e-mail:wingkeonxxerasethisxx@ecst.csuchico.edu
Back to home