Part of the Graphics Log series:
- Intro into Computer Graphics
- Animated Clock using 2D Graphics
- Creating an Animated Barber Pole with OpenGL
- Basic Texturing
- Creating a flag using Bezier Curves
- Understanding Subdivision Surfaces in Computer Graphics
- Lighting in Computer Graphics : A Practical Guide with OpenGL
- Techniques for Object CreationThis post!
- Practical tips for efficient development with OpenGL
- Computer Graphics: Top Learning Resources for beginners
Introduction:
In this article I’ll be presenting some techniques that we have used in our lab sessions to construct 3D objects with OpengGL.OpenGL provides the ability to create some common predefined shapes using built in methods,but since we often need to model custom objects we have to find some ways to make this process easier.
Creating Complex Shapes with Basic 3D Primitives:
When creating some complex objects its easier to visualize them as a composition of certain basic shapes such as spheres,cubes,cuboids,cones and cylinders.This techniques could be used in OpenGL to build up complex objects using these common shapes for which there are built in methods present in the library.
Building Objects through Vertex Specification:
Another technique of 3D object creation involves the explicit definition of vertices. When following this approach, I found it helpful to sketch and plan the arrangement of vertices.This would make the implementation coding easier.
Additionally, in some sitations it’s useful to have a known solid object, like a cube, as a reference to shape more intricate forms.An example for using this technique is creating a shape such as a ‘atapattama’ or Vesak lantern using points on a cube as reference points.
Conclusion
As you embark on the adventure of creating 3D objects in OpenGL, the versatility of approaches at your disposal becomes clear. Whether you opt for the artistic fusion of basic shapes or thee specification of vertices, each method offers a unique avenue for bringing your digital creations to life.