Skip to content

Commit

Permalink
More renderer; multi-view rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Jul 18, 2024
1 parent 944b3b0 commit ee5233e
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 177 deletions.
3 changes: 2 additions & 1 deletion packages/demos/demos/viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@

"Multiple Views": [
"#Multi-View Examples",
["viewer_multiView", "Viewer with multiple Views"]
["viewer_multiView_loadWebIFC", "Viewer with multiple Views of IFC model"],
["viewer_multiView_SceneModel", "Viewer with multiple Views of simple SceneModel"]
]
};

Expand Down
33 changes: 23 additions & 10 deletions packages/demos/demos/viewer/viewer_multiView_SceneModel.html
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ <h3>Major components used</h3>
position: [-4, -6, -4],
scale: [1, 3, 1],
rotation: [0, 0, 0],
color: [1, 0.3, 0.3]
color: [0.3, 0.3, 1.0]
});

sceneModel.createObject({
Expand All @@ -321,7 +321,7 @@ <h3>Major components used</h3>
position: [4, -6, -4],
scale: [1, 3, 1],
rotation: [0, 0, 0],
color: [0.3, 1.0, 0.3]
color: [0.3, 0.3, 1.0]
});

sceneModel.createObject({
Expand Down Expand Up @@ -349,7 +349,7 @@ <h3>Major components used</h3>
position: [-4, -6, 4],
scale: [1, 3, 1],
rotation: [0, 0, 0],
color: [1.0, 1.0, 0.0]
color: [0.3, 0.3, 1.0]
});

sceneModel.createObject({
Expand All @@ -363,7 +363,7 @@ <h3>Major components used</h3>
position: [0, -3, 0],
scale: [6, 0.5, 6],
rotation: [0, 0, 0],
color: [1.0, 0.3, 1.0]
color: [0.3, 0.3, 1.0]
});

sceneModel.createObject({
Expand All @@ -373,13 +373,26 @@ <h3>Major components used</h3>

sceneModel.build();

// viewer.onTick.subscribe(() => {
// view1.camera.orbitYaw(.5);
// view3.camera.orbitYaw(-1.3);
// view2.camera.orbitPitch(3);
// });
viewer.views["myView1"].objects["greenLeg"].colorize = [0.3, 1, 1];
viewer.views["myView2"].objects["greenLeg"].colorize = [0.3, 1.0, 0.3];
viewer.views["myView3"].objects["greenLeg"].colorize = [1, 0.3, 0.3];

viewer.views["myView1"].objects["purpleTableTop"].colorize = [0.3, 1, 1];
viewer.views["myView2"].objects["purpleTableTop"].colorize = [0.3, 1.0, 0.3];
viewer.views["myView3"].objects["purpleTableTop"].colorize = [1, 0.3, 0.3];

viewer.onTick.subscribe(() => {
// view1.camera.orbitYaw(.5);
view3.camera.orbitYaw(-1.3);
// view2.camera.orbitPitch(3);
});

let toggle = false;
setInterval(() => {
viewer.views["myView1"].objects["purpleTableTop"].colorize = (toggle = !toggle) ? [0.3, 1, 1] : [1, 0.3, 0.3];
}, 2000);

window.viewer= viewer;
window.viewer = viewer;

</script>

Expand Down
Loading

0 comments on commit ee5233e

Please sign in to comment.