Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore Channels as underlying animation paradigm #42

Open
sansumbrella opened this issue Feb 25, 2016 · 1 comment
Open

Explore Channels as underlying animation paradigm #42

sansumbrella opened this issue Feb 25, 2016 · 1 comment

Comments

@sansumbrella
Copy link
Owner

Channels: stream of values with interpolation
Players: playhead referring to a channel
Connectors: timeline item connecting a player to an output

Working on this in the exp_channel branch.

Would like to be able to write something like:

channel = Channel<float>{ {1.0f, 0.0}, {Linear}, {10.0f, 2.0}, {Bezier, 0.2, 0.4, 0.8, 1.0}, {20.0f, 3.0} };
player = Player(channel);
value = player.step(dt);
values = player.sample(128, dt);

Channel<float> x, y, z;
…
player = Player<vec3>(x, y, z);
vec3 previous = player.value();
vec3 value = player.step(dt);

struct Transform {
  float x, y, z;
  quat orientation;
};

Channel<quat> orientation;
player = Player<Transform>(x, y, z, orientation);
Transform xf = player.value();
@sansumbrella
Copy link
Owner Author

Tricky part will be combining non-float values and unpacking into custom type constructors. Might need some kind of traits class or just a bunch of offsetof(Transform, orientation) and a non-type-safe writeTo method.

So more practically (for c++), looking something like:

Channel<float> x, y, z;
positionChannel = Player<vec3>(offsetof(vec3, x), x, offsetof(vec3, y), y, offsetof(vec3, z), z);
Player<Transform>(offsetof(Transform, position), positionChannel, offsetof(Transform, orientation), orientationChannel);

And we could provide some custom constructors for glm types so you can skip the offsetof business.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant