You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Goal: decide how mathbox-react should mediate interactions with mathBox/Threestrap options.
My understanding of mathBox/Threestrap options.
The options passed to const mathbox = mathBox(options) are passd directly to Threestrap, so really this is a discussion of mathbox-react's API for interacting with Threestrap options.
The Threestrap options are generally of the form { plugins: string[], ...pluginOptions }. In general, plugins have options and an API with methods and properties. For example, the loop plugin has:
options:
{
start: boolean, // whether to start the render loop on initialization
each: number // render every nth frame
}`
API
{
// methods:
stop(): void, // stop the render loop
start: void, // stop the render loop
get(): void // get current options
set(options): // set new options
// properties:
each: number // render every nth frame
}`
Observations:
Some options only affect initialization behavvior: For the Loop plugin, updating the start option doesn't really make sense because the start option is specifically "start the loop on initialization". It only affects the initialization behavior. Several other plugins have initialization options like this. In contrast, updating the each option DOES make sense.
Some options don't actually work: In particular, the "each" option on Loop does not actually work at the moment. (And in an alternate timeline it was renamed "rate").
Some options work, but can't be updated: I'm not 100% sure about this, but I suspect that there are some options (Camera may be one) that function correctly at initialization (e.g., perspective vs orthographic) but then can't be updated without re-initialization.
(I'm not sure that mathbox wroks with orthographic cameras anyway, I would really like it to!)
Questions
Should mathbox-react do full re-render when options are updated?
Should mathbox-react provide a declartive interface for interacting with the Threestrap plugin "APIs"? For example, should there be a declarative way to start/stop the render loop?
Goal: decide how
mathbox-reactshould mediate interactions withmathBox/Threestrapoptions.My understanding of
mathBox/Threestrapoptions.The options passed to
const mathbox = mathBox(options)are passd directly to Threestrap, so really this is a discussion ofmathbox-react's API for interacting with Threestrap options.The Threestrap options are generally of the form
{ plugins: string[], ...pluginOptions }. In general, plugins have options and an API with methods and properties. For example, theloopplugin has:options:
API
Observations:
Some options only affect initialization behavvior: For the Loop plugin, updating the
startoption doesn't really make sense because the start option is specifically "start the loop on initialization". It only affects the initialization behavior. Several other plugins have initialization options like this. In contrast, updating theeachoption DOES make sense.Some options don't actually work: In particular, the "each" option on Loop does not actually work at the moment. (And in an alternate timeline it was renamed "rate").
See animation loop pause / slowdown? #19 (comment).
Some options work, but can't be updated: I'm not 100% sure about this, but I suspect that there are some options (Camera may be one) that function correctly at initialization (e.g., perspective vs orthographic) but then can't be updated without re-initialization.
(I'm not sure that mathbox wroks with orthographic cameras anyway, I would really like it to!)
Questions
mathbox-reactdo full re-render when options are updated?mathbox-reactprovide a declartive interface for interacting with the Threestrap plugin "APIs"? For example, should there be a declarative way to start/stop the render loop?See also discussion in #20