Hello Cube
This example shows how to display a spinning red cube in O3D.
// World View Projection matrix that will transform the input vertices // to screen space. uniform mat4 worldViewProjection; // input parameters for our vertex shader attribute vec4 position; /** * The vertex shader simply transforms the input vertices to screen space. */ void main() { // Multiply the vertex positions by the worldViewProjection matrix to // transform them to screen space. gl_Position = worldViewProjection * position; } // This hack his here for now since O3D only allows one string // to be passed to Effect::loadFromFXString // #o3d SplitMarker // #o3d MatrixLoadOrder RowMajor /** * This pixel shader just returns the color red. */ void main() { gl_FragColor = vec4(1, 0, 0, 1); // Red. } // Here we tell our effect file *which* functions are // our vertex and pixel shaders.