
Easy3D
Open Source C++ API for 3D Data Processing & Rendering
A Stable Free C++ Library that Provides Support for 3D Modeling, Geometry Processing, Apply Different Transparency Techniquesand and Text Rendering inside C++ applications.
What is iGeo Easy3D?
A lightweight, cross-platform library called Easy3D offers a straightforward yet effective collection of tools for making 3D graphics apps. This open source toolkit for 3D processing in pure C++ enables programmers to make applications for the creation and rendering of 3D models. The library generates effective results and is incredibly user-friendly. It has supported a number of 3D data processing and rendering methods, including ambient occlusion, eye-dome illumination, shadow, transparency, and many more. Although Easy3D was created for study and teaching, it may also be used to create excellent 3D applications.
Easy3D places a high value on usability and simplicity, as the name implies. A clear and user-friendly API makes it easy for developers to get started right away. Because of the library's modular design, software developers can effortlessly add new features or connect it with pre-existing codebases. To assist developers in getting started, the library comes with extensive documentation and a number of samples. These resources offer helpful advice and inspiration for your projects, regardless of your level of experience with 3D programming.
Point clouds, mesh surfaces, scalar fields, and vector fields may all be rendered using a few lines of C++ code thanks to the Easy3D library's support for 3D drawables including points, lines, triangles, and more. Additionally, it supported a number of crucial functions for subdivision, hole filling, simplification, smoothing, fairing, remeshing, mesh curvature, 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;
}