Move the axes to the upper right corner
This commit is contained in:
parent
e6023d2ef7
commit
3e92c452f2
@ -97,7 +97,6 @@ abstract class BasicRenderer<
|
|||||||
*/
|
*/
|
||||||
protected resize() {
|
protected resize() {
|
||||||
this.loop(0);
|
this.loop(0);
|
||||||
this.gl.viewport(0, 0, this.canvas.width, this.canvas.height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,8 +66,13 @@ class ClassicRenderer extends BasicRenderer<{}, IClassicRendererParams> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
loop(t: number): void {
|
loop(t: number): void {
|
||||||
|
|
||||||
|
// 常规绘制窗口
|
||||||
|
this.gl.viewport(0, 0, this.canvas.width, this.canvas.height);
|
||||||
|
|
||||||
this.camera.dynamics(t);
|
this.camera.dynamics(t);
|
||||||
|
|
||||||
|
// 自动计算最佳雾参数
|
||||||
let dist = this.camera.eyeDist;
|
let dist = this.camera.eyeDist;
|
||||||
if (Math.abs(this.lastScale - dist) > this.camera.EL) {
|
if (Math.abs(this.lastScale - dist) > this.camera.EL) {
|
||||||
this.lastScale = dist;
|
this.lastScale = dist;
|
||||||
@ -79,9 +84,18 @@ class ClassicRenderer extends BasicRenderer<{}, IClassicRendererParams> {
|
|||||||
|
|
||||||
this.cleanCanvas();
|
this.cleanCanvas();
|
||||||
|
|
||||||
this.axisObject.draw(this.basicShader);
|
|
||||||
this.cubeObject.draw(this.basicShader);
|
this.cubeObject.draw(this.basicShader);
|
||||||
this.basicGroup.draw(this.groupShader);
|
this.basicGroup.draw(this.groupShader);
|
||||||
|
|
||||||
|
// 右上角绘制坐标轴
|
||||||
|
const position = 120;
|
||||||
|
this.gl.viewport(
|
||||||
|
this.canvas.width - position * this.camera.ratio + (this.camera.ratio - 1) * position / 2,
|
||||||
|
this.canvas.height - position,
|
||||||
|
position * this.camera.ratio,
|
||||||
|
position
|
||||||
|
);
|
||||||
|
this.axisObject.draw(this.basicShader);
|
||||||
}
|
}
|
||||||
|
|
||||||
clean(id?: ObjectID | ObjectID[]): this {
|
clean(id?: ObjectID | ObjectID[]): this {
|
||||||
|
Loading…
Reference in New Issue
Block a user