Animations with Loop
albertpeiro opened this issue · comments
What's the main pattern we can use for animations with Loop?
Been playing with this:
https://whs.io/Loops%20&%203D%20Animation.html
const app = new WHS.App([
// ...
]);
new WHS.Loop(() => {
box.rotation.y += 0.02;
}).start(app);
But having trouble grabbing the references for app and component
What’s the exact trouble?
…On Sun, Nov 11, 2018 at 11:56 PM Albert Peiró ***@***.***> wrote:
What's the main pattern we can use for animations with Loop?
Been playing with this:
https://whs.io/Loops%20&%203D%20Animation.html
const app = new WHS.App([
// ...
]);
new WHS.Loop(() => {
box.rotation.y += 0.02;
}).start(app);
But having trouble grabbing the references for app and component
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#18>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHTX1YJu8KgClpqeHU09S_i0I9TZMjP-ks5uuJ0fgaJpZM4YYtVU>
.
Hi Alex, thanks a lot.
I solved this by using named functions and saving APP as a global instead
of setting it in the state:
```
canRef(component) {
new WHS.Loop(() => {
component.rotation.y += 0.002;
}).start(APP);
}
<Cylinder
refComponent={this.canRef}/>
```
Thank you
On Mon, 12 Nov 2018 at 00:07, Alexander Buzin <notifications@github.com>
wrote:
… What’s the exact trouble?
On Sun, Nov 11, 2018 at 11:56 PM Albert Peiró ***@***.***>
wrote:
> What's the main pattern we can use for animations with Loop?
>
> Been playing with this:
> https://whs.io/Loops%20&%203D%20Animation.html
>
> const app = new WHS.App([
> // ...
> ]);
>
> new WHS.Loop(() => {
> box.rotation.y += 0.02;
> }).start(app);
>
> But having trouble grabbing the references for app and component
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#18>, or mute the
thread
> <
https://github.com/notifications/unsubscribe-auth/AHTX1YJu8KgClpqeHU09S_i0I9TZMjP-ks5uuJ0fgaJpZM4YYtVU
>
> .
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB5HjSGRBRo-qhJu7TIMgKCwdo5QT-kRks5uuK3KgaJpZM4YYtVU>
.
--
*Albert Peiró*