Giter Site home page Giter Site logo

Comments (8)

vincentfretin avatar vincentfretin commented on July 21, 2024

See my comments 3DStreet/3dstreet-editor#185 (comment)

from 3dstreet.

Algorush avatar Algorush commented on July 21, 2024

See my comments 3DStreet/3dstreet-editor#185 (comment)

Thanks, I read the comments but didn't look in detail yet. Yes, the parameters of the Ortho camera are different from the Perspective camera. Perhaps this is causing the problem. I studied ortho and perspective cameras while working with 3dtiles-loader, I'll try to fix this

from 3dstreet.

vincentfretin avatar vincentfretin commented on July 21, 2024

Good luck. I spend about 2 hours trying without success.

from 3dstreet.

vincentfretin avatar vincentfretin commented on July 21, 2024

Oh I see that EditorControls is also messing around the left bottom right top property of the ortho camera

if (this.isOrthographic) {
// Change FOV for ortho.
let factor = 1;
if (delta.x + delta.y + delta.z < 0) {
factor = -1;
}
delta = distance * scope.zoomSpeed * factor;
object.left -= delta * ratio;
object.bottom -= delta;
object.right += delta * ratio;
object.top += delta;
if (object.left >= -0.0001) {
return;
}
object.updateProjectionMatrix();

I missed that code when I tried to fix the issue.

from 3dstreet.

vincentfretin avatar vincentfretin commented on July 21, 2024

controls.setAspectRatio(sceneEl.canvas.width / sceneEl.canvas.height);

probably just need to be executed on resize

from 3dstreet.

Algorush avatar Algorush commented on July 21, 2024

I made it work. I'll add a PR later. in window resize I first calculate FrustumSize, then add parameters for ortho camera. It works with Plan View in inspector, but not with Cross Section View:

        if (inspector.camera.isOrthographicCamera) {
          const frustumSize = inspector.camera.top - inspector.camera.bottom;
          inspector.camera.left = -frustumSize * aspect / 2;
          inspector.camera.right = frustumSize * aspect / 2;
          inspector.camera.top = frustumSize / 2;
          inspector.camera.bottom = -frustumSize / 2;
        }

so I need to do this work in Cross Section View also

from 3dstreet.

Algorush avatar Algorush commented on July 21, 2024

I fixed it with Cross Section View too.
I'll try to add this fix in aframe repo in resize event function here: https://github.com/aframevr/aframe/blob/66baa9c8128caf9199e8a773ca4d637a25947d06/src/core/scene/a-scene.js#L577

from 3dstreet.

Algorush avatar Algorush commented on July 21, 2024

Added PR here in 3DStreet. I was unable to clone the aframe repository due to an error during the download, perhaps a problem with my unstable connection in a rural area

from 3dstreet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.