Closed funwithtriangles closed 1 month ago
It's worth mentioning that it is very easy to get this working inside a sketch file. As of https://github.com/nudibranchrecords/hedron/pull/56 there is now a class on the parent of the viewer canvas.
const OrbitControls = require('three-orbitcontrols')
...
// viewerEl only needed so that mouse events only work inside the viewer and not the whole app UI
const viewerEl = document.getElementById('viewer')
// scene passed in as first agument of the sketch constructor
const controls = new OrbitControls(scene.camera, viewerEl)
This is clearly a bit of a hacky approach so it might still be good to have this as core functionality, however I wonder if it makes more sense to offer this solution in the docs or provide a boilerplate.
Keeping this open for discussion.
Camera controls should be available as a paramater of some sort. Perhaps position and rotation as 6 different params. Would be much more useful once we have new param types (could have a 3D mouse control param type that affects all 6 params). Need to think about how would be incorporated. Could be added to sketches by author or just be a "core param" of some sort.
It would be useful to have optional built in camera controls (e.g. OrbitControls) for easy inspection of a scene.
This feature should be focused as a debugging tool and not something for doing shows with (fancy camera controls for performances can be implemented per project using the
scene
parameter passed to each sketch upon construction).