3d animation with JUCE?

Hey yall,

I’m planning out a project at the moment and I’m considering trying to implement 3d Graphics. As I understand JUCE can do some basic 3D with it’s openGL renderer and classes, but I don’t think there’s built in support for a full rigged and animated object?

My question is really how would I go about implementing 3d animation into a project, and if possible, how difficult would that be? I’m guessing this would require stepping outside the boundries of JUCE. Quite frankly, I’m barely getting into the intermediate level of C++, so I realize this might be WAY over my head, but I’ve also wanted to take a deep dive into openGL for a while now.

Any thoughts or resources on the subject would be appreciated!

Yes, it is possible. The question is what are you going to achieve. It is possible that the OpenGL wrapper in JUCE will be enough. If not you can select a component from your JUCE project as a surface to draw your animation via external OpenGL or other library. You need to use getWindowHandle method of this component to draw natively/externally on it. It was working for me in projects on embedded platforms where I needed fast rendering impossible to get by standard methods and/or OpenGL implementation was very platform specific.

2 Likes

Just wanted to update for anyone in the future that may use it. The method proposed above works great. Basically you can just pass the getWindowHandle to which ever graphics API you go with and start drawing from there. And thanks to Juce, all the windowing set up is done for you. I also found it was useful to utilize juce::NSViewComponent and juce::HWNDComponent, but mostly just for convivence of settings bounds and what not.

I didn’t end up going with OpenGL but instead using the native Graphics APIs for mac and windows. Mac was incredibly easy in comparison because you could basically pass the window handle to apples Scenekit Framework, and with some Objective C++ you can do 3d like you were making an app (But metal can also be used if needed). Windows on the other hand has required a lot of DirectX work lol.