LibGizmo: C++ Lib to Manipulate Transformation Matrices

Scale and Move operations

LibGizmo is a small C++ library that brings easy matrix (4×4 floats) manipulation in your OpenGL applications. Three main functions are available to create a move, rotate and scale gizmo objects to handle the fundamental matrix operations. A draw function is also available with mouse control that allows to display the gizmos and handle them with the mouse.

Here is a code snippet to show the basic use of LibGizmo:

#include "IGizmo.h"
// The model matrix.
float objectMatrix[16];
// The three gizmos
IGizmo* gizmoMove = CreateMoveGizmo();
IGizmo* gizmoRotate = CreateRotateGizmo();
IGizmo* gizmoScale = CreateScaleGizmo();
IGizmo* cur_gizmo = NULL;
// Manipulate the position of the object.
cur_gizmo = gizmoMove;
gizmo->SetScreenDimension(screenWidth, screenHeight);
// Render the gizmo.
gizmo->SetCameraMatrix(viewMat, projMat);

Will test it asap in GeeXlab ;)


Rotate operation

↑ Grab this Headline Animator