Ignore:
Timestamp:
2014-12-15T13:07:02+13:00 (9 years ago)
Author:
bmt11
Message:

All weather is now functioning including switching back to fine weather. Weather is now also affected by wind force

File:
1 edited

Legend:

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

    r29620 r29634  
    2727                transition: right 0.5s;
    2828                background-image: url("./images/slider.png");
    29                 background-size: 25vw 150vh;
     29                background-size: cover;
    3030                background-position: center;
    3131            }
     
    6767                <!--Toggle:
    6868                <a onclick="wind = !wind;">Wind</a> |-->
    69                 <a class="myButton" style="background-image:url('./images/sunButton.jpg')" onclick="fine = !fine;"></a>
     69                <a class="myButton" style="background-image:url('./images/sunButton.jpg')" onclick="sunny = !sunny;"></a>
    7070                <a class="myButton" style="background-image:url('./images/rainButton.jpg')" onclick="raining = !raining;"></a>
    7171                <a class="myButton" style="background-image:url('./images/snowButton.jpg')" onclick="snowing = !snowing;"></a>
     
    8080            function openclose(){
    8181                if (open){
    82                     document.getElementById("menuContainer").style.right = "-20vw";
     82                    document.getElementById("menuContainer").style.right = "-19vw";
    8383                    document.getElementById("arrow").style.transform = "rotate(360deg)";
    8484                }else{document.getElementById("menuContainer").style.right = "0vw";
     
    101101        <script type="text/javascript" src="./weather/rain.js"></script>
    102102        <script type="text/javascript" src="./weather/snow.js"></script>
     103        <script type="text/javascript" src="./weather/sun.js"></script>
    103104       
    104105        <script type="text/javascript" src="./Flag_files/KeyboardState.js"></script>
     
    161162            /*  Weather variables  */
    162163            var weatherSystem;
     164           
    163165            var raining = false;
    164166            var snowing = false;
     167            var sunny = false;
     168           
    165169            var snowSystem;
    166170            var rainSystem;
     171            var sunSystem;
    167172           
    168173            /*  Mouse variables     */
     
    184189           
    185190            var object, tmpFlag, arrow;
     191           
    186192
    187193            var rotate = false;
     
    259265                rainSystem = new rain();
    260266                snowSystem = new snow();
     267                sunSystem = new sun();
    261268                weatherSystem = new weatherSystem(scene);
    262269           
     
    285292                arrow = new THREE.ArrowHelper( new THREE.Vector3( 0, 1, 0 ), new THREE.Vector3( 0, 0, 0 ), 50, 0xff0000 );
    286293                arrow.position.set( -200, -50, -200 );
     294                arrow.setLength( 0 );
     295                arrow.setDirection( 0 );
    287296                //scene.add( arrow );
    288297
     
    423432
    424433                var time = Date.now();
     434               
    425435                windStrength = Math.cos( time / 7000 ) * 100 + 200;
    426436                windForce.set( 1000,500,Math.sin( time / 1000 ) ).normalize().multiplyScalar( windStrength );
    427437                arrow.setLength( windStrength );
    428438                arrow.setDirection( windForce );
     439
    429440                controls.update();
    430441                simulate(time);
     
    468479                if(raining && weatherSystem.type != rainSystem){
    469480                    snowing = false;
     481                    sunny = false;
    470482                    weatherSystem.swap(rainSystem);
    471483                }else if(snowing && weatherSystem.type != snowSystem){
    472484                    raining = false;
     485                    sunny = false;
    473486                    weatherSystem.swap(snowSystem);
     487                }else if(sunny && weatherSystem.type != sunSystem){
     488                    raining = false;
     489                    snowing = false;
     490                    weatherSystem.swap(sunSystem);
    474491                }
    475492               
Note: See TracChangeset for help on using the changeset viewer.