zoom issue.
This commit is contained in:
@@ -381,9 +381,13 @@ export class Engine {
|
||||
this.canvas.height = Math.max(this.canvas.height, targetH);
|
||||
}
|
||||
|
||||
gl.viewport(0, 0, targetW, targetH);
|
||||
const viewportY = this.canvas.height - targetH;
|
||||
gl.viewport(0, viewportY, targetW, targetH);
|
||||
gl.enable(gl.SCISSOR_TEST);
|
||||
gl.scissor(0, viewportY, targetW, targetH);
|
||||
gl.clearColor(0.0, 0.0, 0.0, 0.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
|
||||
gl.disable(gl.SCISSOR_TEST);
|
||||
|
||||
const aspect = rect.width / rect.height;
|
||||
const viewProj = diorama.updateMatrices(aspect);
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
|
||||
<h2>Static Sub-Figures</h2>
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr;">
|
||||
<div class="figure" id="demo-2"></div>
|
||||
<div class="figure" id="demo-3"></div>
|
||||
<div class="figure" id="demo-top-static"></div>
|
||||
<div class="figure" id="demo-iso"></div>
|
||||
</div>
|
||||
|
||||
<div id="atlas-container" style="position: absolute; right: 0; top: 0"></div>
|
||||
@@ -66,14 +66,14 @@
|
||||
p 0 -2 0 piston facing=north extended=false
|
||||
`)
|
||||
const f_static = new WorldFrame(w_static);
|
||||
const d_static_top = new Diorama('demo-2', f_static, () => engine.requestRender());
|
||||
const d_static_top = new Diorama('demo-top-static', f_static, () => engine.requestRender());
|
||||
d_static_top.radius = 5;
|
||||
d_static_top.theta = 180;
|
||||
d_static_top.phi = 90;
|
||||
d_static_top.centerView();
|
||||
d_static_top.saveState();
|
||||
engine.addDiorama(d_static_top)
|
||||
const d_static_iso = new Diorama('demo-3', f_static, () => engine.requestRender());
|
||||
const d_static_iso = new Diorama('demo-iso', f_static, () => engine.requestRender());
|
||||
d_static_iso.radius = 5;
|
||||
d_static_iso.centerView();
|
||||
d_static_iso.saveState();
|
||||
|
||||
Reference in New Issue
Block a user