sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Web Exporter advanced controls

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 354 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F Offline
      Fox
      last edited by Fox

      Hi guys, girls,

      I've come across the wonderful Web exporter and is pretty happy with it, especially considering it's a beta. There is, however, one thing I'd like you help on: using buttons to orbit around the model. Why? Because on touchscreens, the current option doesn't work... And I need to use it on an iPod touch.

      I tried modifying myself the Javascript code, and it somehow worked: it did change the current image, but right after changing it it would show a blank page with only the "false" word. So I commented out the "return false;" line. It solved that problem, but with this I can only change the image one time, that's all.

      Is there anybody able to help me make Sketchup Web Exporter touchscreen/iPhone compatible? With simple buttons as "Left, Right, Reset view".

      Thanks!
      Regards,
      Fox

      1 Reply Last reply Reply Quote 0
      • tbdT Offline
        tbd
        last edited by

        if you post your code we can take a look and provide more help. I did something similar with my http://plugins.ro/su2web/ project some time ago before WebExporter

        SketchUp Ruby Consultant | Podium 1.x developer
        http://plugins.ro

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          p.s. the convention of adding "[Plugin]" to the beginning of a thread title is when someone is posting a plugin for people to download, making it easier to search this forum for them. Using it when asking questions is confusing.

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • F Offline
            Fox
            last edited by

            Well, I can post my code but that's really dirty bad code lol... anyway I'll post it later so you understand what I was talking about πŸ˜‰

            Thanks!

            PS thomthom: Sorry, I edited the topic's title πŸ˜‰

            1 Reply Last reply Reply Quote 0
            • F Offline
              Fox
              last edited by

              Alright... as I said it's dirty code made at 1:00 AM with the one and only (failed) intent to make it work... so I could show the model with my iPod Touch...
              http://ales.foxleader.net/-REPO-/3D1/AlesFoxJet5XLS_index.html

              Note that "Gauche" is the french for "Left" while "Droite" means "Right" πŸ˜‰ Also, all the code is in that page between the head tags, and my modified code is at the end of the head.

              I added this in the body:

              <a href="javascript&#058;cs(10)">Gauche</a> <a href="javascript&#058;cs(20)">Droite
              
              </a>
              
              

              and this before the end of the <script> tags in the head, modified from the handleRotate(e) function:

              function cs(e)
              {
                // STEP is how many pixels equals an image swap
                var STEP = 10; 
                var width = sketchUpObj.offsetWidth;
                var delta = e
              
                addToPos = Math.floor(delta/STEP);
              
                //handle wrap around
                var wrap = (currentPos + addToPos) % imageCount;
                var newPos = (wrap < 0) ? imageCount + wrap ; Math.abs(wrap);
              
                //hide everyone except the image we are over
                for (var i = 0; i < imageCount; i++) {
                  hide(sketchUpImageArray[i]);
                }
              
                show(sketchUpImageArray[newPos]);
              
               // return false;
              }
              
              

              I repeat, that's dirty code. Really dirty. Lol. I also know that it's JS, so not really Ruby but I guessed it was still the best section to post this.

              Thanks for your help!

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement