You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am new in this, and want to know whether it is possible to have a motion in
rotating the model.
I used the following code to rotate the model to the specific coordinates and
working proper.
Here is the link : http://eworkdemo.com/development/ruchir/hotel-3d-model/
function changeRotationLeft()
{
viewer.rotMatrix.identity();
viewer.rotMatrix.rotateAboutXAxis(-90);
viewer.rotMatrix.rotateAboutYAxis(180);
viewer.update();
}
Now I want this with slow motion animation.
Please help me with some demo.
Original issue reported on code.google.com by [email protected] on 19 Feb 2015 at 9:08
The text was updated successfully, but these errors were encountered:
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.
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 issue reported on code.google.com by
[email protected]
on 19 Feb 2015 at 9:08The text was updated successfully, but these errors were encountered: