So I met some strange things when I deal with vulkan coordinate system. I'm used to the opengl coordinate system, so when I create the viewport in vulkan, I did
VkViewport viewport = {};
viewport.width = 800;
viewport.height = -600;
viewport.x = 0.0f;
viewport.y = 600;
viewport.minDepth = 0.0f;
viewport.maxDepth = 1.0f;
By that, I flip the y axis, so I assume positive X-axis is to right of the screen, positive Y-axis is to the up of the screen, and positive Z-axis is pointing into the screen. Am I correct? But then when I drew a simple square, using four vertices,
(150, 50, 0.0), (50.0, 50, 0.0), (50.0, -50, 0.0), (150.0, -50, 0.0)
with model transformation matrix as identity, and view matrix as
glm::lookAt(glm::vec3(0, 0, -500), glm::vec3(0, 0, 0), glm::vec3(0, 1, 0));
and projection matrix
glm::perspective(glm::radians(45.0f), m_swapchainExtent.width / (float)m_swapchainExtent.height, 0.1f, 1000000.0f);
I got a square that is actually on the left side of the image. How to explain this, or just the positive X-axis actually pointing to the left?