I would like to “animate” the motion of physical objects in 3D (opengl) in ROOT v5.14. For example, I would like to show the motion of a double pendulum. In other words, I want the volumes themselves to move, not just the camera.
What would be the recommended way to go about this? I thought maybe TGeoManager, but this seems to be just for “static” geometries.
Thanks for any tips or tutorials that might get me started.
I have a simple sample for you, I’m not sure if it’s what you want, but at least something:
You should have CVS head (or at least the latest release) of ROOT and opportunity to recompile.
Place modified TGLViewer.h into your $ROOTSYS/gl/inc and
TGLViewer.cxx into $ROOTSYS/gl/src and recompile
Use sample macros (animation.C or pendulum.C) - look at their code for example, how to do animation.
Sometimes due to unknown reason parts (or all) of geometry disappear (not my fault) - just double click in viewer’s OpenGL drawing area.
I’m afraid, that’s not a real solution, but it’s the simplest way to do animation now (AFAIK)
I was wondering if the new functionality that tpochep included in the hacked version of TGLViewer is now included in the latest versions of ROOT or not.
I checked the header file for TGLViewer.h for version 5.18 and I don’t see an obvious method to get direct access to a specific TGLPhysicalShape and then move it (ie animate it).
Does anybody know if this has been done or is in the works?
Thanks. Actually, what I was looking for was if it is now possible to do the kind of animation requested in this thread (above). This animation moves the physical objects themselves, rather than just the camera view.
Timur posted a reply about how one could do it with a small hack to TGLViewer, by keeping a publicly accessible container of the TGLPhysicalShapes in TGLViewer.
Is this kind of animation possible in version 5.18 or above?