b0VIM 8.0sZA/angus17Anguss-MacBook-Pro.local~angus17/Dropbox/MAMP_htdocs/ccl_UCSC/courses/cmpm163/code/week4/w4_6_snowflakes.htmlutf-8 3210#"! UtpH_?Pad N H~kZD?4#  v u O !  y [ Z B # "   a ` / . ) (   m N W K J I > =   X xuk^][GFjiP:# ON)l9J$v# geometry.addAttribute( 'size', new THREE.BufferAttribute( sizes, 1 ) ); geometry.addAttribute( 'customColor', new THREE.BufferAttribute( colors, 3 ) ); geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) ); var geometry = new THREE.BufferGeometry(); } spriteNums[ i ] = Math.floor(Math.random(0) * 5.0); sizes[ i ] = 20; color.toArray( colors, i * 3 ); } //color.setRGB( 0.0, 0.0, 1.0 ); color.setHSL( 0.0 + 0.1 * ( i / amount ), 0.9, 0.5 ); } else { //color.setRGB( 1.0, 0.0, 0.0 ); color.setHSL( 0.5 + 0.1 * ( i / amount ), 0.7, 0.5 ); if ( vertex.x < 0 ) { vertex.toArray( positions, i * 3 ); vertex.z = ( Math.random() * 2 - 1 ) * radius; vertex.y = ( Math.random() * 2 - 1 ) * radius; vertex.x = ( Math.random() * 2 - 1 ) * radius; for ( var i = 0; i < amount; i ++ ) { var color = new THREE.Color( 0xffffff ); var vertex = new THREE.Vector3(); var spriteNums = new Float32Array( amount ); var sizes = new Float32Array( amount ); var colors = new Float32Array( amount * 3 ); var positions = new Float32Array( amount * 3 ); var radius = 200; var amount = 10000; //var radius = 25; //var amount = 10000; //initialize point attributes scene = new THREE.Scene(); var controls = new THREE.OrbitControls( camera ); camera.position.z = 300; camera = new THREE.PerspectiveCamera( 40, WIDTH / HEIGHT, 1, 10000 ); function init() { animate(); init(); var sprite4 = textureLoader.load( "snowflake5.png" ); var sprite3 = textureLoader.load( "snowflake4.png" ); var sprite2 = textureLoader.load( "snowflake3.png" ); var sprite1 = textureLoader.load( "snowflake2.png" ); var sprite0 = textureLoader.load( "snowflake1.png" ); var textureLoader = new THREE.TextureLoader(); var HEIGHT = window.innerHeight; var WIDTH = window.innerWidth; var boxOfPoints; var renderer, scene, camera; } gl_Position = projectionMatrix * mvPosition; gl_PointSize = size * ( 300.0 / -mvPosition.z ); vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); vWhichSprite = spriteNum; vColor = customColor; void main() { varying float vWhichSprite; varying vec3 vColor; attribute float spriteNum; attribute vec3 customColor; attribute float size; uniform float amplitude; precision highp float;
a { color: #ff0000 } } z-index:100; padding: 5px; top: 0px; width: 100%; position: absolute; color: #fff; #info { } overflow: hidden; margin: 0px; background-color: #000000; font-weight: bold; text-align:center; font-size:13px; font-family:Monospace; color: #ffffff; body {