Web Exporter advanced controls
-
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 -
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
-
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.
-
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
-
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.htmlNote 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:cs(10)">Gauche</a> <a href="javascript: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!
Advertisement