I am trying to code a UI for a homemade jukebox (with a touch screen).
I would like to display a background texture which size is the same as the screen to exactly fit to it.
That texture has nx by ny black boxes where the labels with the available songs will be displayed. I want these labels to rotate on their X axis when I change the page and they should, once again, perfectly fit to the boxes (when they are not turning).
I see how to display a 2D rectangle with this kind of vertex shader:
vec2 vertexPosition = vPosition - vec2(screenwidth/2,screenheight/2); // ramener le 0,0 au centre de l'écran vertexPosition /= vec2(screenwidth/2,screenheight/2); // ramener les coordonnées sur un intervalle [-1;1] gl_Position = vec4(vertexPosition,0,1);
But I can’t use that as I must display all that in 3D and then I don’t know how manage the (x,y,z) coordinates of the 3D vertices to be placed exactly where I want, to perfectly fit to the screen.
Any help would be appreciated.