Bl
Bl
Bl
Bl
Bl
You are here:   Home »  Products »  PolyTrans|CAD+DCC  
Bl

Home > Supported File Formats > STL to OpenGL C Code


How to convert STL (StereoLithography) to OpenGL C Code (.cpp)?


PolyTrans|CAD+DCC performs mathematically precise CAD, DCC/Animation, GIS and BIM 3D file conversions into all key downstream 3D packages and file formats. Okino software is used and trusted throughout the world by many tens of thousands of 3D professionals in mission & production critical environments, backed by respectable personal support directly from our core development team.

     

STL

STL (StereoLithography) is one of the industry's oldest (and simplest) 3D file formats created back in 1987 for 3D Systems' first commercial 3D printer. It is widely used for rapid prototyping, 3D printing and CAM. Okino has provided one of the very first and still primary STL export conversion systems for close to 3 decades.

Please take note that there is no 3D file format which is much simpler than STL. It is not a high-end, high fidelity 3D conversion file format as many people have come to wrongly believe. Rather, STL defines just a raw triangulated polygon mesh with no smoothing information (vertex normals), no uv texture coordinates, no assembly hierarchy part naming or any material assignments. 3MF and VRML2 are often much better file formats for moving 3D datasets into downstream programs and/or 3D printers.

The Okino STL exporter WEB page provides good graphical tutorial about how to convert CAD file data into STL and also how to clean a 3D model which is 'almost water tight'.

     

OpenGL C Code

OpenGL is a cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering.

Okino's OpenGL export converter writes out the scene database as a C code program in the Open GL scene description language. The resulting program can then be compiled and used to draw the 3D database directly using OpenGL. The database is output as a series of polygons with vertex positions, normals, colors and texture coordinates. In addition, the surface definitions (materials) associated with each polygon is used to set up the OpenGL shading parameters. Please note that each object is output as a separate C code function in the resulting file.