Camera.ORTHO_SIZE_VIEWPORT problem

  1. last year

    Hello.

    Hello. What is the correct way to use the following command?

    myScene: getDefaultCamera (): setProjectionMode (Camera.ORTHO_SIZE_VIEWPORT)

    According to the documentation, this mode should render pixel-perfect, adjusting the orthosize with the resolution of the viewport, but no objects added to the scene is displayed ... or are outside the camera's limits ... I do not know.

    Could anyone help me?

  2. With a little "trial and error" found a solution.

    Really use this mode causes the rendering corresponds to the amount of pixels in the viewport. But for the objects are visible, I had to set the z coordinate them to a negative value (-1 or less).

    Also I needed to scale these objects accordingly.

    I also noticed that the coordinate (0,0) is no longer the center of the screen, becoming the lower left corner of the window ...

    Question: because with the negative value of the z coordinate this work?
    Sorry if it's a very basic question. I'm still starting in computer graphics.

    Thanks!

  3. Ivan

    4 May 2016 Administrator

    Yep, that mode is mostly there because of the SCENE_2D_TOPLEFT mode of Scene, which sets it up for rendering in the traditional "center is top left, Y increases downwards" drawing setup. This mode should be used for UI-based application screens (the IDE uses that mode).

  4. Thank you!

 

or Sign Up to reply!