= new THREE.Clock(); var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera( 60, width / height, .1, 100 ); camera.position.set( 0, 0, 2 ); var renderer = new THREE.WebGLRenderer(); renderer.setSize( width, height ); document.body.appendChild( renderer.domElement ); ! ! var indices = new Uint16Array( [ 0, 1, 2, 3, 4, 5 ] ); ! var vertices = new Float32Array( [ -1, -1, 0, 1, -1, 0, -1, 1, 0, !
var vertexBuffer = new THREE.BufferAttribute( vertices, 3 ); var uvBuffer = new THREE.BufferAttribute( uvs, 2 ); ! ! var geometry = new THREE.BufferGeometry(); geometry.addAttribute( 'index', indexBuffer ); geometry.addAttribute( 'position', vertexBuffer ); geometry.addAttribute( 'uv', uvBuffer ); ! ! // // You don't need to put following uniforms. // modelMatrix is automatically linked to `mesh.matrixWorld` // viewMatrix is automatically linked to `camera.matrixWorldInverse` // projectionMatrix is automatically linked to `camera.projectionMatrix` // var uniforms = { // modelMatrix : { type: 'm4', value: new THREE.Matrix4() }, // viewMatrix : { type: 'm4', value: new THREE.Matrix4() }, // projectionMatrix : { type: 'm4', value: new THREE.Matrix4() },