I’m pleased to let you know that I recently have released the nub library which supersedes and at the same time simplifies proscene. Please check the README for its usage and main features which include:
Interaction: 2D/3D navigation, object picking & manipulation through the mouse or any other device.
Rendering and animation frameworks which provides the ground to easily implement advanced effects such as shadow mapping and others.
You can import the library directly from the PDE. Please report issues you may find at the project page and discuss questions and ideas here at the discourse. Please also consider sharing your creations with nub here at the Processing discourse.
Hello @nakednous .
Thanks a lot for sharing and all the amazing code. Love the library.
I was wondering how could I save a bunch of keyframes and later read them from a file.
Can be done?
Can I access the internal keyFrames storing structure?
I found no way of accessing it via API. But maybe I’m just not finding it…
: )
Anyway, thanks a lot.
cheers
vk
ps: Actually I’m willing to save each frame and play it back later. I’m not using, or willing to use, the interpolation. Just the “state” of each object/eye each frame.
My first test code goes like:
if (rec) {
scene.eye().addKeyFrame();
master.addKeyFrame();
} else {
if (scene.eye().removeKeyFrame(0.0) != null) {
master.animate();
scene.eye().animate();
}
}
I’m saving this data every frame, than later I’ll play it back, saving each frame as an image.
This is necessary to keep the skecth flowing without the lag introduced by saving each frame.
Apologies for the delayed response. I’ve just caught up with your query.
As of now, there isn’t a built-in method to achieve what you’re looking for. However, you can create a JSON serialization process to handle this. Below is a suggested approach:
This code defines a method, toJSONObject, which converts a Node object into a JSONObject. Additionally, it includes helper methods to convert vectors and quaternions to JSONArray representations.