org.rajawali3d.primitives / ScreenQuad

ScreenQuad

open class ScreenQuad : Object3D
open class ScreenQuad : Object3D

A screen quad is a plane that covers the whole screen. When used in conjunction with Camera2D you'll get a pixel perfect screen filling plane. This is perfect for things like image slide shows or fragment shader only apps and live wallpapers. When creating solid color plane both createTextureCoordinates and createVertexColorBuffer can be set to false.

When creating a textured plane createTextureCoordinates should be set to true and createVertexColorBuffer should be set to false.

When creating a plane without a texture but with different colors per texture createTextureCoordinates should be set to false and createVertexColorBuffer should be set to true. If you want to show square images without distortion you'll need to resize the quad when the surface changes:


  public void onSurfaceChanged(GL10 gl, int width, int height) {
  	super.onSurfaceChanged(gl, width, height);
  	if(width < height)
  		screenQuad.setScale(height / width, 1, 0);
  	else
  		screenQuad.setScale(1, width / height, 0);
  }
  

Author
dennis.ippel