Computer Graphics
Selected software applications that showcase Computer Graphics related work.To see more of my work in this field, please drop me a line.
OpenGL Viewer
Most of my earlier applications had a native C++ synthetic camera based viewer.
To add photo-realistic surface rendering, I coded this simple OpenGL based 3D Viewer.
Internally it maintains all data structures used by synthetic camera model. For rendering it uses
OpenGL engine. Using mouse wheel, user can zoom in/out. And drag mouse to change view point.
This viewer can render 3 types of objects as of now.
Below are some sample objects that can be viewed in this viewer. You may find this viewer useful to quickly visualize your experimental data without having to code a separate viewer for it. | ||||||||||||
Sample Data FilesClick images to see respective file format.
| ||||||||||||
Helix Cut Algorithm
One interesting project I worked on was similar to stereo lithography. My role was to develop an algorithm to
determine trajectory of cutting tool head across surface of a polygonal object. The tool would move to-and-fro
and the object platform would rotate at the same time elevate at a constant speed. So the tip of cutting tool would
trace a helix across object surface.
Algorithm:
- Load 3D object from file - in the form of {V,P}.
where:- V is a set of all vertices.
- P is a set of all polygons.
- Calculate center of mass (CM) for the object.
- Calculate radius of bounding sphere R.
- From (CM.z-R) to (CM.z+R) traverse a helix with varying parameter t.
- For each iteration of t, build a ray from rayStart to rayEnd.
- rayEnd = (cm.x + Rcos(t), cm.y + Rsin(t), cm.z + t)
- rayStart.x = (cm.x, cm.y, rayEnd.z)
- For each polygon of object, calculate intersection point (if one exists) with this ray.
- Insert this intersection point in helix storage vector.
where a point pt on a helix is:
Cutting with Plane
Another interesting case if that of planar cutting. I was working on development of algorithm for shaping objects, the way they do it for diamond polishing. As part of that project, I developed a program to cut objects with a plane. Have lost the original program long time back, but its screen shot was found in some obscure place. Have a look at it below.
![]() |
| Planar Object Cutting. (a) GUI for interactive experience. (b) 3D object with
a cutting plane. (c) Cut polygons after ray casting & plane intersections. (d) Orbiting view of final cut polygonal mesh. |
Blob Field Rendering
Electromagnetic fields of atoms interfere with each other roughly with this model. Jim Blinn of NASA,
invented Blobs modeling. They are also called as Metaballs. Blobs have come a long way since then. Blobs are widely used in
modeling organic objects, clay-like objects.
Basic idea revolves around computing field effect of each blob. The scene consists of blobs. Each blob is a "sphere". (this is a 2D example, but easily extended in 3D). Blob attributes are center, radius, field strength. At any given point in space, the net resultant field is integration of "contribution" of all blobs in that space. Simple.
Technically, each blob contributes strength*(1-d2/r2)2 to the field. Where r is radius of the blob and d is the distance of the concerned point from blob's center. It is an "additive" effect - blobs nearby develop "soft" joints - as if the water droplets nearby merge together.
Source code for this application is available upon request. Blob Binaries are available for download.
This application is built with Turbo C/C++ 3.0 in DOS. So it has only 16 color support. I wish I could port
it to Windows/Linux high-color version. But time since then has become a rare resource!
Motion Capture
This was one of quite interesting things I worked on during my sophomore years in engineering.
My father and I worked on this concept to capture motion using easy-to-manufacture system.
As motion capture finds several applications in movies, cartoon shows, animations, advertisements,
and games - we were experimenting with its use in learning systems. We went onto build on some useful
models after motion capture.
The system design is pretty straight forward to understand:
|
|
|
|
Click on poster below to play video. You will need MPEG player plugin for your browser to see this video. Alternatively you can download Motion Capture video and play in player application.
Video: Motion Capture







