3D Modeling Tool

Screenshot

(click to zoom)

This is a simple 3D modeling tool along the lines of Maya or MilkShape 3D. Written entirely in Java and OpenGL, it allows the user to build a 3D scene with surface patches or the famous Utah Teapot. The user can then assign materials, assign GLSL shaders, and add lights to the scene. Finally, the user can animate, or “fly” through the scene via quaternion interpolation between two points.

Source Code: GitHub

Technologies Used: Java, OpenGL, GLSL, JOGL, Swing, AWT

Tools Used: Eclipse IDE

Features:

  • Loading/saving entire scene to/from a file on disk
  • Bezier surfaces & revolutions
  • Free-form surface patches & revolutions
  • 3D camera positioning via relative or absolute coordinates
  • Modification of translation, scale, and rotation for each object
  • Materials, including ambient, diffuse, and specular properties
  • Lights, including specular, positional, and ambient types
  • Loading and attaching GLSL shaders to objects (screenshot shows Phong reflection and texture shaders)
  • Parametrized shaders, i.e. using time as a parameter to alter a shader’s behavior
  • Camera animation between two points via SLERP (spherical linear interpolation)

Code Snippet:

[java]for(int i = 0; i < 8; ++i)
gl.glDisable(getGLLightNum(i));

if(enableLight.isSelected())
{
gl.glLightModelfv(GL.GL_LIGHT_MODEL_AMBIENT, FloatBuffer.wrap(AmbientLight.getInstance().getIntensity().getRGBComponents(null)));
int i = 0;
for(Light l : lights.values())
{
l.draw(drawable, getGLLightNum(i));
gl.glEnable(getGLLightNum(i));
++i;
}
gl.glEnable(GL.GL_LIGHTING);
}
else
gl.glDisable(GL.GL_LIGHTING);[/java]