chetto1983 / jsc3d

Automatically exported from code.google.com/p/jsc3d
0 stars 0 forks source link

Problem loading on page #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi, this is less of a bug and more of an implementation problem.

I am trying to implement jsc3d in my website. I am relatively new to web and 
javascript - so the problem is probably easy to fix.

I was wondering if you could look at the page and help me?
http://daniel-creese.co.cc/Mobile/index.html

Daniel. 

Original issue reported on code.google.com by TheRealR...@gmail.com on 3 Nov 2012 at 11:26

GoogleCodeExporter commented 8 years ago
PLEASE DELETE - FIXED NOW!

Original comment by TheRealR...@gmail.com on 3 Nov 2012 at 1:01

GoogleCodeExporter commented 8 years ago
Nice robin model! 

It is recommended to use the latest code from svn repository. 
jsc3d.0.7.2.min.js is very outdated.

Original comment by Humu2...@gmail.com on 4 Nov 2012 at 3:05

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Yeah, thanks. I was just trying to get it to work. Is there a way to make it 
auto rotate until the user interacts with it?

thanks again, Dan.

Original comment by TheRealR...@gmail.com on 6 Nov 2012 at 6:27

GoogleCodeExporter commented 8 years ago
To implement that, you need to set a timer to rotate your model at a given time 
interval, and then clear it when any input event is detected.

Following snippet demonstrates this:

...
var timerID = 0;
...
// setup event handlers to detect interactions
viewer.onmousedown = viewer.onmouseup = function() {
  // stop animation if any
  if(timerID > 0) {
    clearInterval(timerID);
    timerID = 0;
  }
};
...
// start to rotate model horizontally at increment of 3 degrees per 60 millisecs
timerID = setInterval(function(){viewer.rotate(0, 3, 0); viewer.update();}, 60);
...

That's it.

You can refer to http://jsc3d.googlecode.com/svn/trunk/jsc3d/demos/earth.html 
for a detailed demo.

Original comment by Humu2...@gmail.com on 7 Nov 2012 at 3:57

GoogleCodeExporter commented 8 years ago
Thanks, that works perfectly.

Thanks again,
Dan.

Original comment by TheRealR...@gmail.com on 16 Nov 2012 at 11:21