metafizzy / metafizzy/zdog

Cannot create new shapes inside animate function

Open
#67 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
10.7k
Forks
407
PR merge metrics
No merged PRs in 30d

Description

When I try and create a new shape inside:

var shapes = [];

function animate(){
push.shapes(new Zdog.Shape({...}));
illo.updateRenderGraph();
window.requestAnimationFrame(animate);
}

Although the array gets populated, the new shapes do not get rendered to the screen.

I am not sure whether this is a bug or a constraint of 'requestAnimationFrame'?

Contributor guide

Open the contributing guide

Research direction

Start with the reported animate function and the call to illo.updateRenderGraph(); reproduce the issue using a minimal Zdog.Shape created during requestAnimationFrame. Trace how newly added shapes enter the render graph and confirm that the completed behavior renders shapes created during animation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.