-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Labels
Description
Current Situation
Right now, the only options to create or retrieve Three.js 3D objects are:
1. Using a "dummy" div placed off-screen
- This dummy element is supplied as a parameter alongside the parsed primitive object.
- After rendering/redrawing, the objects can be obtained through the
framePainter
, which holds the Three.jsscene
object.
Simplified example from our implementation:
this.histogramGroup = new THREE.Group();
this.dummyEl = document.createElement("div");
this.dummyEl.id = "dummyDiv" + id;
document.body.appendChild(this.dummyEl);
draw("dummyDiv" + this.id, this.rootObj, opts).then(retValue => {
this.histogramGroup.add(this.framePainter.scene);
});
2. Handling the case when no div is set
- I was able to create 3D objects with this approach, but it didn't really work reliably.
Key Questions
-
Would it be possible to create a method or support functionality where the parameters are:
- object → the object to draw
- options → draw options
…and the return value consists of either a Three.js scene or (preferably) a Three.js group.
-
Could this work universally for TH1/TH2/TH3 objects?
- If I'm correct, TH1/TH2 are rendered by d3.js by default.
- But they can be rendered via Three.js either by setting
drawWith: "lego"
or by enablingmode3d: true
on the painter.
-
Would it be possible to support creating 3D objects for all JSROOT primitives?