Changeset 29694


Ignore:
Timestamp:
2015-01-22T14:28:16+13:00 (9 years ago)
Author:
bmt11
Message:

Wind Control is now fully implemented and functioning as expected :)

Location:
other-projects/nz-flag-design/trunk/render-3d
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • other-projects/nz-flag-design/trunk/render-3d/CSS/slider.css

    r29693 r29694  
    22    width: 50vw;
    33    height: 50px;
    4     position: relative;
    5     margin: 0 auto;
    6     margin-top: 20px;
     4    position: absolute;
     5    margin: 0;
     6    margin-top: 15px;
     7    left: 25vw;
    78    background: url('../images/slider-graphics.png') no-repeat left top;
    8     background-color: transparent;
    99    border: none;
    10     border-color: transparent;
    1110    outline: 0;
    12     color: transparent;
    1311    z-index: 0;
    1412
     
    2927    position: absolute;
    3028    background: url('../images/speed-full.png') no-repeat left top;
    31     opacity: 0.5;
     29    opacity: 0.7;
    3230    border: none;
    3331    outline: 0;
     
    3533
    3634#speed .ui-slider-handle{
    37     width: 38px;
    38     height: 39px;
    39     background: url('../images/slider-knob.png') no-repeat left top;
     35    width: 50px;
     36    height: 39px;
     37    background: url('../images/wind-symbol.png') no-repeat center;
     38    background-size: cover;
    4039    position: absolute;
    4140    margin-left: -15px;
  • other-projects/nz-flag-design/trunk/render-3d/Flag_files/Flag.js

    r29693 r29694  
    269269        particle.addForce(gravity);
    270270        //
    271         var x = particle.position.x, y = particle.position.y, z = particle.position.z, t=Date.now() / 1000;
     271        //var x = particle.position.x, y = particle.position.y, z = particle.position.z, t=Date.now() / 1000;
    272272        //windForce.set(Math.sin(x*y*t), Math.cos(z*t), Math.sin(Math.cos(5*x*y*z))).multiplyScalar(0);
    273         particle.addForce(windForce);
     273        //particle.addForce(windForce);
    274274        particle.integrate(TIMESTEP_SQ);
    275275    }
     
    291291
    292292    // Pin Constrains
    293     if(Boolean(pinning)){
    294         for (i=0, il=pins.length;i<il;i++) {
    295             var xy = pins[i];
    296             var p = particles[xy];
    297             p.position.copy(p.original);
    298             p.previous.copy(p.original);
    299         }
    300     }
    301 
    302 }
     293    for (i=0, il=pins.length;i<il;i++) {
     294        var xy = pins[i];
     295        var p = particles[xy];
     296        p.position.copy(p.original);
     297        p.previous.copy(p.original);
     298    }
     299}
  • other-projects/nz-flag-design/trunk/render-3d/Flag_files/slider.js

    r29693 r29694  
    11jQuery(document).ready(function ($) {
    22    $("#speed").slider({
    3         min: 0,
    4         max: 100,
    5         value: 0,
     3        min: 25,
     4        max: 300,
     5        value: 100,
    66        animate: true,
    77        range: 'min',
    88        slide: function(event, ui) {
    9             setSpeed(ui.value/100);
     9            setSpeed(ui.value);
    1010        }
    1111    });
     
    2020   
    2121    function setSpeed(speed){
    22         windForce.set(speed,100,speed);
     22        windStrength = speed;
    2323    }
    2424});
  • other-projects/nz-flag-design/trunk/render-3d/flag.html

    r29693 r29694  
    1313            body {
    1414                font-family: Monospace;
    15                 background-color: #000;
     15                background-color: transparent;
    1616                color: #000;
    1717                margin: 0px;
     
    124124       
    125125        <script type="x-shader/x-fragment" id="fragmentShaderDepth">
    126 
     126       
    127127            uniform sampler2D texture;
    128128            varying vec2 vUV;
     
    227227                container = document.createElement( 'div' );
    228228                document.body.appendChild( container );
    229                    
     229               
     230                windStrength = 100;
    230231               
    231232                // scene
     
    363364                //
    364365
    365                 stats = new Stats();
     366                /*stats = new Stats();
    366367                stats.domElement.style.position = 'absolute';
    367368                stats.domElement.style.top = '0px';
     
    370371                stats.domElement.children[ 0 ].children[ 0 ].style.color = "#aaa";
    371372                stats.domElement.children[ 0 ].style.background = "transparent";
    372                 stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";
     373                stats.domElement.children[ 0 ].children[ 1 ].style.display = "none";*/
    373374
    374375                //
     
    465466
    466467                var time = Date.now();
    467                
    468                 windStrength = Math.cos( time / 7000 ) * 100 + 200;
     468
     469                //windStrength = Math.cos( time / 7000 ) * 100 + 200;
    469470                windForce.set( 1000,500,Math.sin( time / 1000 ) ).normalize().multiplyScalar( windStrength );
    470471                arrow.setLength( windStrength );
     
    474475                simulate(time);
    475476                render();
    476                 stats.update();
     477                //stats.update();
    477478
    478479            }
     
    521522       
    522523        </script>
    523        
    524 </body></html>
     524
     525    </body>
     526</html>
  • other-projects/nz-flag-design/trunk/render-3d/weather/rain.js

    r29634 r29694  
    1414   
    1515        // create the particle variables
    16         this.particleCount = 3500,
     16        this.particleCount = 10000,
    1717        this.particles = new THREE.Geometry(),
    1818        this.pMaterial = new THREE.ParticleBasicMaterial({
     
    3232            // create a particle with random
    3333            // position values, -250 -> 250
    34             var pX = (Math.random() * 3000) - 1500,
    35                 pY = Math.random() * window.innerHeight * 3 - window.innerHeight,
    36                 pZ = (Math.random() * 3000) - 1500;
     34            var pX = (Math.random() * 10000) - 5000,
     35                pY = Math.random() * window.innerHeight * 6 - window.innerHeight,
     36                pZ = (Math.random() * 10000) - 5000;
    3737                this.particle = new THREE.Vector3(pX, pY, pZ); 
    3838
     
    7272            // check if we need to reset
    7373            if(this.particle.y < -10) {
    74                 this.particle.y = (window.innerHeight*2)+(Math.random() * 100);
     74                this.particle.y = (window.innerHeight*6)+(Math.random() * 100);
    7575                this.particle.velocity.y = 0;
    76                 this.particle.x = (Math.random() * 4000) - 2000;
    77                 this.particle.z = (Math.random() * 4000) - 2000;
     76                this.particle.x = (Math.random() * 10000) - 5000;
     77                this.particle.z = (Math.random() * 10000) - 5000;
    7878
    7979            }
  • other-projects/nz-flag-design/trunk/render-3d/weather/snow.js

    r29634 r29694  
    1414       
    1515            // create the particle variables
    16             this.particleCount = 3000,
     16            this.particleCount = 6000,
    1717            this.particles = new THREE.Geometry(),
    1818           
     
    3333                // create a particle with random
    3434                // position values
    35                 var pX = (Math.random() * 3000) - 1500,
    36                     pY = Math.random() * window.innerHeight * 3 - window.innerHeight,
    37                     pZ = (Math.random() * 3000) - 1500;
     35                var pX = (Math.random() * 10000) - 5000,
     36                    pY = Math.random() * window.innerHeight * 6 - window.innerHeight,
     37                    pZ = (Math.random() * 10000) - 5000;
    3838                    this.particle = new THREE.Vector3(pX, pY, pZ); 
    3939               
     
    7575                // check if we need to reset
    7676                if(this.particle.y < -10) {
    77                     this.particle.y = (window.innerHeight*2)+(Math.random() * 100);
     77                    this.particle.y = (window.innerHeight*6)+(Math.random() * 100);
    7878                    this.particle.velocity.y = 0;
    79                     this.particle.x = (Math.random() * 4000) - 2000;
    80                     this.particle.z = (Math.random() * 4000) - 2000;
     79                    this.particle.x = (Math.random() * 10000) - 5000;
     80                    this.particle.z = (Math.random() * 10000) - 5000;
    8181
    8282                }
Note: See TracChangeset for help on using the changeset viewer.