3D gizmos

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • I'm starting to write my first engine, after reading the book and several other articles and books (learnopengl.com) on the topic. So far, i have the basics: model loading, camera (which flies around with the mouse and WASD) and basic lighting. I've decided to start working on the scene editor and, before i even started with the scene graph, i'm stuck with the gizmos. Here's what i'm trying to create:


      Basically, widgets that allow me to manipulate the models that i'm able to load in the world. Can anyone share some simple, easy to grasp, gizmo code?
    • This is just a quick guess, but I'd imagine it would be something like this:

      If mouse click and hold is translateGizmoX:
      Check if mouse drag coordinates and compare to previous coordinates
      If compare is positive then move object positively on x
      If compare is negative then move object negatively on x

      Then there would be similar ones for the other dimensions and rotate and scale. The gizmo itself could hold code to indicate when it is active (ie being clicked) and then either a process or some other update type function could check if it has been dragged.