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.

Zooming / transforming code required

Home Forums Programming Zooming / transforming code required

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9354
    justkmoo
    Participant

    Hello, I added “zoom” into the css to make it look like browser-scaling. So that the scene looks more high-quality. But this method will cause other problems like HTML elements messing. Are there any other methods to achieve this zooming goal without messing things up?

    #9364

    Hi, it’s better to directly change the size of the rendering viewport via API. If you have an application in the standard verge3d App Manager, you can add the following lines into the runCode() function in the application’s main js file:

    
    function runCode(app) {
        // add your code here, e.g. console.log('Hello, World!');
    
        app.renderer.setPixelRatio(2);
        app.onResize();
    }
    

    app.renderer.setPixelRatio(2) increases resolution by 2 times, without affecting the HTML layout.

    Co-founder and lead developer at Soft8Soft.

    #9371
    justkmoo
    Participant

    Thank you so much Ivan! It works perfectly! :good:

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