Interactive Cutaway Illustrations - Visualisierung 2
The paper „Interactive Cutaway Illustrations of Complex 3D Models“ by Wilmont Li et.al introduces a system that enables users to create viewing presentations with different types of cuts. This allows to visualize complex models and coherent parts other than simply being limited to binary plane partitioning.
This application, realized during the course Visualisierung 2 implements a subset of the functionality presented in the paper to give a similar experience in modifying the presentation of 3D models with a set of cutting techniques.
Core functionality relies on constraint tests in the OpenGL shader pipeline, in which a set of cut parameters is translated to a range comparison for projected positions. The user sets the parameter space UVW and an offset for 3D position to produce a cutout on vertex based 3D Model.
Models can be loaded from Wavefront (obj) files, with corresponding mtl files for material /textures. The model is rendered with a Blinn-Phong shader with one lightsource (eye-direction)
To create a cut, the user can either type in parameter values in the top right window and play around with values by increasing/decreasing buttons, click and drag on the value to increase it by mouse-movement or by clicking the Select Cut button to enable a drag and drop style selection of a cut-size on the model. By clicking Select Cut, an arrow picker is enabled, which is rendered along the model.
Cuts and views can be saved in a list, and either be recalled on demand, or enabled or disabled.
Multiple cuts are allowed. Saving a cut and keeping it enabled renders the cut next to consecutive cutaways.
The user interface allows to change face colors of the model to single color, material, texture, a checkered pattern and the values of normals.
User controls GUI driven. 3 freely arrangable windows are provided to interact with the application
•Cut Settings: List of parameters for the current cutaway
◦Mode: Shape of the cut. Can be box, ball or plane
◦U, V, W: Sets the cut parameters for local x,y and z axis, similar to the illustrations in the paper
◦PosX,Y,Z Sets the World coordinates for the cut, as offset from local space
◦Alpha: Transparency. If set to 0, the cut area is discarded in the shader, otherwise the cut is displayed as simple alpha blending
◦Select Cut Allows to set parameters by clicking on the object and to define cut size drag and drop stlye.
•Rigs: Naming and saving of views and cuts
◦LabelName: Name of a cutaway, which can be a partname,a viewingangle, etc
◦Enabled: Enables or disables the cut
◦Safe cut: Safes cut in a list
◦Rig List of safed cutaways
◦Load cut Loads the selection from the list into the cut settings parameter window
•General Options: A few settings to manipulate rendering
◦Framerate: No manipulation, gives a metric for performance through average FPS
◦Face Culling Manipulates Face culling. Allows to view model from all angles, and visualizes models, that may not have inside parts
◦Draw Grid Enables grid. Each grid cell is a 1x1 cell in world coordinates
◦Texturing Mode Changes model color according to setting: white, material, texture, checkered, normals
◦Open File Opens a file dialog to open a different obj file.
Each numbered parameter can also be manipulated by a +/- sign in the text box next to the number or by clicking the label, drag the mouse and „roll“ the value up or down.
NOTE: UVW values can be negative, which is useless for Box or Ball cutaways, but is necessary to set plane parameters properly.
Camera can be controlled by mouse drag and drop:
left click: rotate around projection center
right click: zoom camera
mouse3 click pan camera
scrollwheel: zoom
The mouse can be used to draw a cut on the surface area of the model. Press C or click Select Cut in the Cut Settings window and move the cursor position to the model surface. On the surface you can then see a small 3d curser that stands perpendicular to the surface area. Clicking sets cut position to clicked area, drag and drop manipulates UVW parameters, too.
The actual implementation differs from the method presented in the paper, in which a CSG based library is used to define parameters for simple geometry and ranges of complex polygon chains to define a cut. The implementation for this prototype are inspired by methods used in typical 3D software called boolean modifiers and boolean modeling in a simplified form.
User parameters are send to a glsl shader program which performs a range test on each 3D coordinate of a drawn point and if a cut condition is met (e.g transformedPoint.x < box.x) in the Fragment/Pixelshader stage, the pixel will either be discarded (other points with bigger z value will be drawn instead) or the alpha channel will be set to a user value, rendering the point transparent.
S