opensourceBIM / BIMsurfer

The latest version of the BIM Surfer WebGL viewer for IFC
MIT License
382 stars 132 forks source link

Nothing is rendered using orthogonal projection #88

Open muren400 opened 3 years ago

muren400 commented 3 years ago

Hi,

currently it's not really possible to set an orthogonal projection.

In camera.js in the function setModelBounds(bounds), the bounds array/vector ist cloned using vec3.clone(). Since bounds has six entries (minX, minY, minZ, maxX, maxY, maxZ) we lose some information and end up with three entries. This results in an invalid projection matrix and the model can't be rendered.

setModelBounds(bounds) { // <-- takes an array with six entries
    this._modelBounds = [];

    this.perspective.setModelBounds(vec3.clone(bounds)); // <-- creates an array with three entries
    this.orthographic.setModelBounds(vec3.clone(bounds));

Thanks