|
| Is there any function for rotating a model with a constant speed? |
 |
Mon, 7 Apr 2008 23:51:04 -0700 |
I want my model to rotate left with a constant speed when it loads, or
eventually, make it happen without activating the model.
1) Is there any function I can use for rotating the model on load until the user
physically changes the view of the model with his mouse click?
2) Is there any function or perhaps simple html code for activating the model
automatically when it loads?
|
| Post Reply
|
| Re: Is there any function for rotating a |
 |
Tue, 22 Apr 2008 14:26:44 -070 |
Jon,
Sorry for the delay in response(very busy for me right now). Here's some
responses to your questions, in oder.
>> Answer to 1): The 3D Javascript API has all the methods you need
to
do this task. Below is a hunk of script that will do the trick for you.
Follow these steps:
A) Copy/Paste this code into a text file, and name it with the extention .js,
like "rotate.js". (Note: the "scene.meshes..." line below is
long and wraps. Make sure it's all one line.)
//=============================================================
//amount to rotate with each frame
angleChangeInRadians = 0.3;
//rotate with a timer
var myTimer = new TimeEventHandler();
myTimer.onEvent = function(event)
{
for ( i=0; i<scene.meshes.count; i++ ) {
scene.meshes.getByIndex(i).transform.rotateAboutZInPlace(event.deltaTime *
angleChangeInRadians); } } //Register the handler and turn the mule on
runtime.addEventHandler(myTimer);
//=======================================================
B) Add the 3D object to your page.
C) From the menu, select Tools | Advanced Editing | Select Object Tool.
D) Double-click the 3D object to open the 3D Properties Dialog.
E) Click the "Edit Content" button at bottom to open the "Add 3D
Content" dialog.
F) For "Default Script" field, use the Browse button and select the
script you just created above.
G) OK both dialogs.
H) Use the Hand tool, and activate the 3D annot again.
Bingo. Your object now rotates. In the script, adjust the
"angleChangeInRadians" value to change the rotation speed.
>>> Answer to 2): Use the same tool above in this manner:
A) From the menu, select Tools | Advanced Editing | Select Object Tool.
B) Double-click the 3D object to open the 3D Properties Dialog.
C) In the 'Activation Settings' section, select the "Enable 3D When"
drop-down, and choose one of the bottom two entries (whichever suits you best).
Hope this helps,
|
| Post Reply
|
| Re: Is there any function for rotating a |
 |
Wed, 23 Apr 2008 00:26:42 -070 |
|
| Post Reply
|
| Re: Is there any function for rotating a |
 |
Wed, 23 Apr 2008 04:32:24 -070 |
Hi Gary,
|
| Post Reply
|
| Re: Is there any function for rotating a |
 |
Tue, 10 Jun 2008 01:51:38 -070 |
|
| Post Reply
|
|
|
|
|
|
|
|
|
|