Skip to content
Dalí edited this page Sep 25, 2017 · 17 revisions

Easy projects for you to start with

Image title/link Description Contributor(s)
icon100x100 code_example ShowCase New Features Hjalmar Snoep

Enable SphereMode

      function panoramaEnable() {
            // Als op de button wordt geklikt:
            if(panoSphere.getSphereMode()==true)
            {
                panoSphere.setSphereMode(false);
                document.getElementById("sphereButton").innerHTML ='Zet SphereModus aan' ;

            }  else
            {
                panoSphere.setSphereMode(true);
                document.getElementById("sphereButton").innerHTML ='Zet SphereModus uit' ;
            }

Code by: Jesse De jong

Edit by: Dalí Klaassen

Pop-up with the direction when a user clicks an image

   panoSphere.setCallback(clickSomething); // zodra de gebruiker klikt, wordt dit aangeroepen.
        function clickSomething(richting)
        {
            console.log("er is geklikt op: "+richting);
            panoSphere.popup.show("er is geklikt op: "+richting);
        }

Code by: Jesse De jong

Edit by: Dalí Klaassen

Change image

   function loadLocation(x){
            // laat een nieuwe plek zien.
            panoSphere.showCustomNode({
                front: "img/node"+x+"/front.jpg",
                back: "img/node"+x+"/back.jpg",
                left: "img/node"+x+"/left.jpg",
                right: "img/node"+x+"/right.jpg",
                up: "img/node"+x+"/up.jpg",
                down: "img/node"+x+"/down.jpg",
            });
        }

Code by: Jesse De jong

Edit by: Dalí Klaassen

Follow mouse position

function mouseUpHandler(e) 
    {
        e = e || window.event;
        mouse.down = false;

        // check if user moved the view!
        var dx=mouse.x-mouse.start_x;
        var dy=mouse.y-mouse.start_y;
        var dist_swiped=Math.sqrt(dxdx+dydy);
        //console.log("distance swiped: "+dist_swiped);
        if(dist_swiped<20)
        {
            //console.log("click direction "+mouse.dir);
             broadCastEvent({type:"click",data:mouse.dir});

            if(callback!=null) callback(mouse.dir);
        }
        e.preventDefault();
    }

Code by: Jesse De jong

Edit by: Dalí Klaassen