Easy3D
C++ API for 3D Data Processing & Rendering
A stable free C++ Library that provides support for 3D Modeling, Geometry Processing, and Rendering inside C++ applications.
Easy3D is a lightweight, cross-platform library that provides a simple yet powerful set of tools for creating 3D graphics applications. It is an open source pure C++ 3D processing library that allows software developers to create apps for 3D modeling generation and rendering. The library is very easy to use and produces efficient results. It has included support for several techniques for processing and rendering 3D data such as shadow, eye-dome lighting, ambient occlusion, transparency, and many more. The Easy3D was developed for research and educational purposes but can also be used for building high-quality 3D applications.
As the name suggests, Easy3D prioritizes simplicity and ease of use. With a clean and intuitive API, developers can quickly get up and running with minimal hassle. The library is built with modularity in mind, allowing software developers to easily extend its functionality or integrate it with existing codebases. The library is accompanied by comprehensive documentation and a collection of examples to help developers get started. Whether you're new to 3D programming or a seasoned veteran, these resources provide valuable guidance and inspiration for your projects.
The Easy3D library has included rendering support related to 3D drawables such as points, lines, triangles, and thus point clouds, mesh surfaces, scalar fields, and vector fields with just a couple of lines of C++ code. Moreover, it also included support for several important features for mesh curvature, simplification, smoothing, fairing, remeshing, hole filling, subdivision, and many more.
Getting Started with Easy3D
The easiest way to install Easy3D is using GitHub.Please use the following command for a successful installation.
Install Easy3D via GitHub
git clone --depth=1 https://github.com/LiangliangNan/Easy3D.git
You can also install Easy3D using to CMake. Please use CMake to generate project files for your IDE. Then load the project to your IDE and build.
Text Rendering using C++ API
The open source Easy3D library has provided support for rendering text inside their C++ application with ease. You can easily render strings using Easy3D with just a couple of commands. It allows to increase or decrease font size, manage character spacing, control line spacing, control left or center or right-align the multi-line text, enable or disable kerning, switch the origin between 'upper left' and 'bottom left, and much more.
How to Perform Text Rendering using C++ API?
#include
int main() {
// Initialize Easy3D
Easy3D::initialize();
// Create a window
Easy3D::Window window("Text Rendering Example", 800, 600);
// Load font
Easy3D::Font font("path/to/font.ttf", 24); // Replace "path/to/font.ttf" with the path to your font file
// Main loop
while (!window.shouldClose()) {
// Clear the screen
Easy3D::clear(Easy3D::Color::White);
// Render text
font.renderText("Hello, Easy3D!", 100, 100, Easy3D::Color::Black);
// Swap buffers and poll events
window.update();
}
// Shutdown Easy3D
Easy3D::shutdown();
return 0;
}
Transparency Support via C++ API
The open source Easy3D library gives software developers the capability to apply different transparency techniques inside their C++ apps. Easy3D is a very efficient C++ library for processing and rendering 3D data. You can easily Load a mesh model and switch between different transparency techniques or turn on and off it. You can also increase or decrease the transparency of the current model with ease. You can also render a surface mesh with transparency technique like average color blending and dual depth peeling.
Create Drawables & Visualize 3D Data
The Easy3D library has provided functionality for creating and visualizing drawables without associating them with any 3D models. The drawables are usually created for rendering 3D models or loaded from files. The Easy3D library has included support for visualizing 3D data without explicitly defining a model or you can generate it for a specific rendering purpose or use the viewer to visualize the drawable. Please remember that you need to create a viewer before creating any drawables. Here's a basic example of how to create a window and draw a simple triangle using Easy3D:
How to Create a Window and Draw a Simple Triangle using Easy3D?
#include
int main() {
// Initialize Easy3D
Easy3D::initialize();
// Create a window
Easy3D::Window window("My Easy3D App", 800, 600);
// Main loop
while (!window.shouldClose()) {
// Clear the screen
Easy3D::clear(Easy3D::Color::Black);
// Draw a triangle
Easy3D::drawTriangle({-0.5, -0.5, 0}, {0.5, -0.5, 0}, {0, 0.5, 0}, Easy3D::Color::Red);
// Swap buffers and poll events
window.update();
}
// Shutdown Easy3D
Easy3D::shutdown();
return 0;
}