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.

Resizing Scene to Match Window Resize

Home Forums General Questions Resizing Scene to Match Window Resize

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #42512
    ccoul
    Customer

    Hello,
    I am trying to make it so that if you resize the window of verge3d, the scene automatically resizes to fit the window. Right now, if I resize the window, sometimes parts of the scene are cut from view. Is there a puzzle configuration that can achieve this?

    #42513
    ccoul
    Customer

    Current puzzle setup that is not working:

    Attachments:
    You must be logged in to view attached files.
    #42515
    xeon
    Customer

    ok…I might be having difficulty understanding what it is you are really trying to accomplish that is different from the base window that automatically resizes keeping the center camera to center screen.

    Now…if you rescale the current default window maintaining the aspect ratio as much as possible… .my default window scales with no issue scaling all the content inside and not cutting off anything from view.

    If in that same window I change the the aspect ratio to something similar to what I would see on a mobile phone or vertical ratio, the scene is truncated to the left and right. Is this what you are trying to prevent?

    Or did I miss the understanding of your issue?

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #42518
    ccoul
    Customer

    Yes, like you said the problem is that changing the aspect ratio truncates the scene. Is there a way to prevent this?

    #42520
    GLiFTeK
    Customer
    #42522
    xeon
    Customer

    If you are using the default window that V3D creates, it will resize your scene to fit regardless of aspect ratio. Depending on the speed of your computer hardware, size of the scene, etc., it is possible you might be having redraw issues. If you are scaling the window by dragging a corner to resize the browser window, the redraw/refresh may be slow or not able to catch up and thus may appear to be truncated momentarily while the scene updates.

    I have tried a few simple scenes with objects on the edge of the camera view with different camera aspect ratios and the default window does a great job at keeping the items center and in complete view without truncating. However, during the resizing, before a refresh, the window may show a truncation.

    If you are willing, you may want to try a simple scene of 5 objects spaced out to the edges of the camera view…with one being in center.
    Bring that scene into SneakPeak and then if you get similar issues that you are having now with truncation. If you don’t have any issues, then it could be your scene is just heavy and needs a refresh after the resize. If it doesn’t work then there is something else going on that may be specific to your hardware configuration.

    Within the V3D HTML template container you will find:

    <meta name=”viewport” content=”width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0″>

    This is typical of responsive design.
    https://www.w3schools.com/css/css_rwd_viewport.asp

    You could create a new template and manage your own viewport to fit your needs. Basically setting the viewport to a specific aspect ratio and then letting the margins of the page scale accordingly. This would give a Letter Boxed view vs the full screen view but it would guarantee the content is always at the exact ratio you want.

    .,

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

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