Skip to content

Add a mechanism to expose params to dat.GUI #3

@OmarShehata

Description

@OmarShehata

In the original entwined you can add this line of code that will expose a parameter to the GUI:

final BasicParameter speedParam = new BasicParameter("Speed", defaultValue, min, max);

That creates a slider you can change at runtime. And then you can get its value with:

speedParam.getValue()

It would be nice to do something similar here. It should be pretty easy using dat.gui. You would need to:

  1. Update PatternBase.js to give all patterns some new addParameter function
  2. PatternBase will also need access to the dat.gui instance which is created in LoadPatterns.js. This may be best to refactor. Maybe the gui instance should be created in index.js, and then passed to the patterns in this line:
/// You would change this to (cubes, model, gui)
patternInstance = new patternModule.default(cubes, model);

The addParameter function should just create a slider to start out with.

  1. There should also be a getValue(paramName) function that patterns can use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions