Changeset 29719
- Timestamp:
- 2015-02-09T09:51:09+13:00 (9 years ago)
- Location:
- other-projects/nz-flag-design/trunk/render-3d
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/nz-flag-design/trunk/render-3d/CSS/slider.css
r29694 r29719 43 43 outline: 0; 44 44 } 45 .tooltip { 46 position: absolute; 47 z-index: 1020; 48 display: block; 49 padding: 5px; 50 font-size: 11px; 51 visibility: visible; 52 margin-top: -2px; 53 bottom:120%; 54 margin-left: -2em; 55 } 56 57 .tooltip .tooltip-arrow { 58 bottom: 0; 59 left: 50%; 60 margin-left: -5px; 61 border-top: 5px solid #000000; 62 border-right: 5px solid transparent; 63 border-left: 5px solid transparent; 64 position: absolute; 65 width: 0; 66 height: 0; 67 } -
other-projects/nz-flag-design/trunk/render-3d/Flag_files/slider.js
r29694 r29719 1 1 jQuery(document).ready(function ($) { 2 3 var initialValue = 100; 4 var curValue = initialValue; 5 var tooltip = 'Wind Speed: '+curValue+''; 6 2 7 $("#speed").slider({ 3 8 min: 25, 4 9 max: 300, 5 value: 100,10 value: initialValue, 6 11 animate: true, 7 12 range: 'min', 13 create: function(event, ui) { 14 initTooltip(ui); 15 }, 8 16 slide: function(event, ui) { 9 setSpeed(ui .value);17 setSpeed(ui); 10 18 } 11 19 }); 20 21 function initTooltip(ui){ 22 tooltip = 'Wind Speed: '+curValue+''; 23 var target = ui.handle || $('.ui-slider-handle'); 24 $(target).html(tooltip); 25 } 26 27 function setSpeed(ui){ 28 windStrength = ui.value; 29 curValue = ui.value; 30 tooltip = 'Wind Speed: '+curValue+''; 31 target = ui.handle || $('.ui-slider-handle'); 32 $(target).html(tooltip); 33 } 12 34 13 35 $(".ui-slider").mouseenter(function(){ … … 18 40 controls.enabled = true; 19 41 }); 20 21 function setSpeed(speed){ 22 windStrength = speed; 23 } 42 24 43 }); -
other-projects/nz-flag-design/trunk/render-3d/flag.html
r29696 r29719 180 180 <script type="text/javascript"> 181 181 var keyboard = new KeyboardState(); 182 var clothTexture s = [];182 var clothTexture; 183 183 184 184 var initial = true; … … 227 227 // array for holding existing flags 228 228 229 var flag s = ["./images/flag.png", "./images/flag2.png", "./images/canada.png"];229 var flag = "./images/flag.png";//, "./images/flag2.png", "./images/canada.png"]; 230 230 var flagSelector = 0; 231 231 var materials; … … 305 305 var session_id = $.cookie('JSESSIONID'); 306 306 if (session_id) { 307 flag s[0]= "images/flag-" + session_id + ".png";307 flag = "images/flag-" + session_id + ".png"; 308 308 } 309 309 310 310 // load flag textures 311 var i; 312 313 for(i = 0; i < flags.length; i++){ 314 clothTextures[i] = THREE.ImageUtils.loadTexture( flags[i] ); 315 //clothTextures[i].needsUpdate = true; 316 clothTextures[i].wrapS = clothTextures[i].wrapT = THREE.ClampToEdgeWrapping; 317 clothTextures[i].anisotropy = 16; 318 } 311 312 clothTexture = THREE.ImageUtils.loadTexture( flag ); 313 clothTexture.wrapS = clothTexture.wrapT = THREE.ClampToEdgeWrapping; 314 clothTexture.anisotropy = 16; 319 315 createFlag(); 320 316 … … 418 414 function createFlag(flagFilename) { 419 415 if (flagFilename) { 420 flag s[0]= "./images/" + flagFilename;416 flag = "./images/" + flagFilename; 421 417 } 422 418 … … 425 421 // create materials 426 422 materials = [ 427 new THREE.MeshLambertMaterial( {specular: 0x030303, fog: false, emissive: 0x111111, shininess: 10, map: clothTexture s[0], side: THREE.DoubleSide } ),423 new THREE.MeshLambertMaterial( {specular: 0x030303, fog: false, emissive: 0x111111, shininess: 10, map: clothTexture, side: THREE.DoubleSide } ), 428 424 ]; 429 425 … … 434 430 clothGeometry.computeFaceNormals(); 435 431 436 uniforms = { texture: { type: "t", value: 0, texture: clothTexture s[0]} };432 uniforms = { texture: { type: "t", value: 0, texture: clothTexture } }; 437 433 vertexShader = document.getElementById( 'vertexShaderDepth' ).textContent; 438 434 fragmentShader = document.getElementById( 'fragmentShaderDepth' ).textContent; … … 454 450 455 451 }else{ 456 clothTexture s[flagSelector] = THREE.ImageUtils.loadTexture( flags[flagSelector]+'?'+Date.now() );457 object.material.map = clothTexture s[flagSelector];452 clothTexture = THREE.ImageUtils.loadTexture( flag+'?'+Date.now() ); 453 object.material.map = clothTexture; 458 454 object.material.needsUpdate = true; 459 455 } -
other-projects/nz-flag-design/trunk/render-3d/weather/rain.js
r29694 r29719 39 39 // create a velocity vector 40 40 this.particle.velocity = new THREE.Vector3( 41 (windForce.x * this.MASS), // x41 (windForce.x * (1-this.MASS)), // x 42 42 -Math.random() * 0.01, // y 43 (windForce.z * this.MASS)); // z43 (windForce.z * (1-this.MASS))); // z 44 44 45 45 // add it to the geometry … … 76 76 this.particle.x = (Math.random() * 10000) - 5000; 77 77 this.particle.z = (Math.random() * 10000) - 5000; 78 79 78 } 80 79 81 80 // update the velocity 82 81 this.particle.velocity.y -= Math.random() * 0.01; 82 this.particle.velocity.x = windForce.x * (1-this.MASS); 83 this.particle.velocity.z = windForce.z * (1-this.MASS) 83 84 84 85 // and the position
Note:
See TracChangeset
for help on using the changeset viewer.