Changeset 29634 for other-projects/nz-flag-design/trunk/render-3d/weather
- Timestamp:
- 2014-12-15T13:07:02+13:00 (9 years ago)
- Location:
- other-projects/nz-flag-design/trunk/render-3d/weather
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/nz-flag-design/trunk/render-3d/weather/rain.js
r29475 r29634 3 3 4 4 this.isInit = false; 5 this.MASS = 0.01; 5 6 6 7 this.init = function() { … … 13 14 14 15 // create the particle variables 15 this.particleCount = 1800,16 this.particleCount = 3500, 16 17 this.particles = new THREE.Geometry(), 17 18 this.pMaterial = new THREE.ParticleBasicMaterial({ … … 31 32 // create a particle with random 32 33 // position values, -250 -> 250 33 var pX = Math.random() * window.innerWidth * 2 - window.innerWidth,34 35 pZ = Math.random() * window.innerWidth * 2 - window.innerWidth;36 this.particle = new THREE.Vector3(pX, pY, pZ); 34 var pX = (Math.random() * 3000) - 1500, 35 pY = Math.random() * window.innerHeight * 3 - window.innerHeight, 36 pZ = (Math.random() * 3000) - 1500; 37 this.particle = new THREE.Vector3(pX, pY, pZ); 37 38 38 39 // create a velocity vector 39 40 0, // x41 -Math.random(), // y42 0); // z40 this.particle.velocity = new THREE.Vector3( 41 (windForce.x * this.MASS), // x 42 -Math.random() * 0.01, // y 43 (windForce.z * this.MASS)); // z 43 44 44 45 // add it to the geometry … … 70 71 71 72 // check if we need to reset 72 if(this.particle.y < - 200) {73 this.particle.y = Math.random() * window.innerHeight+10;73 if(this.particle.y < -10) { 74 this.particle.y = (window.innerHeight*2)+(Math.random() * 100); 74 75 this.particle.velocity.y = 0; 76 this.particle.x = (Math.random() * 4000) - 2000; 77 this.particle.z = (Math.random() * 4000) - 2000; 78 75 79 } 76 80 77 81 // update the velocity 78 this.particle.velocity.y -= Math.random() * .1;82 this.particle.velocity.y -= Math.random() * 0.01; 79 83 80 84 // and the position -
other-projects/nz-flag-design/trunk/render-3d/weather/snow.js
r29547 r29634 3 3 4 4 this.isInit = false; 5 this.M ass = 0.01;5 this.MASS = 0.005; 6 6 7 7 this.init = function() { … … 14 14 15 15 // create the particle variables 16 this.particleCount = 2000,16 this.particleCount = 3000, 17 17 this.particles = new THREE.Geometry(), 18 18 … … 32 32 33 33 // create a particle with random 34 // position values , -250 -> 25035 var pX = Math.random() * window.innerWidth * 3 - window.innerWidth,36 pY = Math.random() * window.innerHeight * 4- window.innerHeight,37 pZ = Math.random() * window.innerWidth * 3 - window.innerWidth;34 // position values 35 var pX = (Math.random() * 3000) - 1500, 36 pY = Math.random() * window.innerHeight * 3 - window.innerHeight, 37 pZ = (Math.random() * 3000) - 1500; 38 38 this.particle = new THREE.Vector3(pX, pY, pZ); 39 39 40 40 // create a velocity vector 41 41 this.particle.velocity = new THREE.Vector3( 42 0, // x 43 -Math.random(), // y 44 0); // z 45 42 (windForce.x * this.MASS), // x 43 -Math.random() * 0.01, // y 44 (windForce.z * this.MASS)); // z 45 46 //this.particle.velocity.z = arrow.direction.z * this.MASS; 46 47 // add it to the geometry 47 48 this.particles.vertices.push(this.particle); … … 73 74 74 75 // check if we need to reset 75 if(this.particle.y < - 200) {76 this.particle.y = Math.random() * window.innerHeight+10;76 if(this.particle.y < -10) { 77 this.particle.y = (window.innerHeight*2)+(Math.random() * 100); 77 78 this.particle.velocity.y = 0; 79 this.particle.x = (Math.random() * 4000) - 2000; 80 this.particle.z = (Math.random() * 4000) - 2000; 81 78 82 } 79 83 80 84 // update the velocity 81 this.particle.velocity.y -= Math.random() * this.Mass; 82 85 this.particle.velocity.y -= Math.random() * 0.001; 86 //this.particle.velocity.x = (windForce.x * this.MASS); 87 //this.particle.velocity.z = (windForce.z * this.MASS); 88 83 89 // and the position 84 90 this.particle.addVectors( -
other-projects/nz-flag-design/trunk/render-3d/weather/weather.js
r29475 r29634 23 23 this.swap = function(w){ 24 24 if(this.type != w){ 25 if(this.type !== null) this.scene.remove(this.getWeather()); 25 if(this.type !== null){ 26 this.scene.remove(this.getWeather()); 27 } 26 28 this.set(w); 27 29 } 28 30 } 29 30 31 31 32 32 this.isSet = function(){
Note:
See TracChangeset
for help on using the changeset viewer.