Open GoogleCodeExporter opened 8 years ago
Hi, Ruchir:
If what you need is just a simple rotation animation, maybe the demo
http://jsc3d.googlecode.com/svn/trunk/jsc3d/demos/earth.html provides a good
example for how to achieve this. The key is to utilize a timer
(setTimeout()/setinterval()) to produce continuous frames along the timeline.
Original comment by Humu2...@gmail.com
on 20 Feb 2015 at 3:13
function foo(){
viewer.init();
viewer.update();
setInterval(rotateThatShit, 50);//function rotateThatShit() is called every 50 miliseconds
}
function rotateThatShit(){
viewer.rotate(10, 2, 0);//rotates 10 degrees on X axis, 2 on Y axis and not on Z axis, everytime this function is called.
viewer.update();
}
You can also set a specific rotation to start with in the first frame, as soon
as the model is loaded.
viewer.setParameter('InitRotationX', 130);
viewer.setParameter('InitRotationY', 0);
viewer.setParameter('InitRotationZ', 60);
These are of course put next to the rest of the parameters.
Original comment by Tjardo.K...@gmail.com
on 26 Feb 2015 at 6:47
Original issue reported on code.google.com by
ruchir.k...@gmail.com
on 19 Feb 2015 at 9:08