..scene appearance related to Graphics3D settings..

Started by Naughty Alien, July 27, 2022, 10:14:34

Previous topic - Next topic

Naughty Alien

..hi guys..im wondering why rendered scene looks different, depending on how Graphics3D is initiated..scene consists of one cube at center (0,0,0) and camera moved to (0,0,-10). If Graphics3D is set as
Graphics3D(1024, 768, 32, 2) , cube is visible at exact center of the screen, as expected. But if Graphics3D is set to full screen Graphics3D(1024, 768, 32, 0) , cube appears somewhat, at left low corner/side of the screen, not at center..

Code, just in case
SuperStrict

Import openb3d.b3dglgraphics


Graphics3D(1024, 768, 32, 2) ' as expected
'Graphics3D(1024, 768, 32, 0) ' messed up
MoveMouse(0, 0)

Global s:String

AmbientLight 50, 40, 30
Global Light:TEntity = CreateLight()
Global Camera:TCamera = CreateCamera()
MoveEntity Camera, 0, 0, -10

Global Cube:TMesh = CreateCube()

While Not KeyHit(KEY_ESCAPE)

   
   TurnEntity Cube, 0.01, 0.02, 0.03
   
       
   UpdateWorld
   RenderWorld()

   Flip 0
 
   GCCollect()
 
WEnd

angros47

Sounds like the screen (and most important, the OpenGL context) is initialized at one resolution, and OpenB3D is initialized at a different resolution

Naughty Alien

..im using 4K screen, so may be the culprit.
If i set Graphics3D(3840, 2160, 32, 1) , which is max resolution of the screen, all works and cube appears also at low right corner of the screen..no error is thrown.
Then i use text(2258, 0, "X"), its drawn just at the right edge of the screen, so its clear that initialized screen size is not what was set by Graphics3D(3840, 2160, 32, 1).
What is interesting is, same effect happen with lower resolution such as described in first post (fullscreen).

markcwm

I stopped using real fullscreen a long time ago because if I crashed in Linux I often had to reboot.

What I do for fake fullscreen is just use the desktop width and height in Graphics3D, there's some code in Graphics3D (in Blitzmax) to account for the titlebar, so it should just look like real fullscreen.