reverted xml3d changes and added flipping for texture with gl.pixelStorei