We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Responsive alignment 50% screen

Home Forums Puzzles Responsive alignment 50% screen

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #60797
    Webenart
    Customer

    Hi,

    1) Is there a way to ensure that the 3d model is on the Right half of the screen? and then by animating the camera (or the main object) to ensure that the model is on the Left half of the screen?

    2) Is there a way to make sure that on mobile devices (filter devices by screen pixels not by device type) to make sure that the above left and right are Top and Bottom half?

    regards

    Webenart | Creative Websites
    webenart.com

    #60799
    Pandern
    Customer

    It could be done with film offset. And three.js has this function, but it would be nice to also be able to control it with a puzzle in verge3d.

    https://threejs.org/docs/#api/en/cameras/PerspectiveCamera.setViewOffset

    Check out kdv’s response in this thread:

    Offset camera so object is displayed off to the side

    #60800
    kdv
    Participant

    And three.js has this function

    v3d.js also has this function. You can find the same info here
    soft8soft.com/docs/api/en/cameras/PerspectiveCamera.html#setViewOffset
    In fact, it’s a clone of three.js with several additional features )))

    it would be nice to also be able to control it with a puzzle in verge3d

    You can control it using only 3 lines of code inside the execscript puzzle.

    const width = app.renderer.domElement.width;
    const height = app.renderer.domElement.height;
    app.camera.setViewOffset(width, height, offsetX, offsetY, width, height);

    to make sure that the above left and right are Top and Bottom half?

    check the browser window orientation

    if (!window.screen.orientation.type.indexOf('landscape')) {
      console.log('it\'s a landscape (horizontal) mode');
    } else {
      console.log('it\'s a portrait (vertical) mode');
    }

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #60816
    Pandern
    Customer

    Thank you, kdv!

    I really need to dive into the programmers reference. I am limiting myself with only doing puzzles.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.