Understanding Canvas Width and Height and Update

Hello,



if I create my canvas, I set its width and height to 640x480pixels. However, my canvas will not be exactly that size due to the fact that it is part of an JInternalFrame in a JDesktopPane. The JInternalFrame is, let’s say, 500x420pixels. Does this effect anything? What about the camera width and height? How does the camera width and height take effect on the canvas width and height? How can I figure out the conjunction between both? How do I have to think in terms of “the real universe” ? Thanks a lot.



Regards,

Equi

Why can’t you just set the canvas’ resolution to 500x420 pixels? The camera will attempt to match the resolution of the canvas.

Hello,



Due to following problem. I set up everything, canvas has been created. Then I add a camera to my scene (with viewport and everything). If I add a skybox, I can see following problem.







When I resize the JInternalFrame, problem is solved.







this tells me, that if the canvas has been created before the camera and the camer is attached afterwards, I have to call any method to tell the camera to update. Of course, the user could resize the JInternalFrame with at least one pixel, but that is dirty. The user should already see everything perfectly when starting. The update or updateViewProjection method of the camera can’t do it. Repaint of canvas also doesn’t work. I want to understand the update procedure. I think that it must have something to do with the viewport.

thanks for help.



Regards,

Equi