Saltar la navegación

28 Rotate Photosphere

29 Rotate Photosphere
Camera rotate

var radio_1 = 6;//Circle radio 1

var x_initial_1=0;//Circle center coordinates item 1

var y_initial_1=0;

var z_initial_1=0;

var rotate_0_1 = 0;//rotate initial del item 1

var height_from_the_ground_1= 0;//level z item 1

var item_1 = Scene.getItem('Nv4nEB2Rw6');

var steps_1=50;//number steps circle

var speed=4;//speed rotate

var step=0;//number step

item_1.setPositionAngle(0, radio_1,height_from_the_ground_1, 0, 0, 1,rotate_0_1);

Scene.scheduleRepeating(function() {

step=step+1;//go to next step

//clockwise

var pos_x_1= x_initial_1 + radio_1*Math.sin(Math.PI*2*step/steps_1);

var pos_y_1= y_initial_1 + radio_1*Math.cos(Math.PI*2*step/steps_1);

var pos_z_1=z_initial_1 + height_from_the_ground_1;

var rotate_1= rotate_0_1 + (Math.PI*2*step/steps_1);

item_1.setPositionAngle(pos_x_1, pos_y_1, pos_z_1, 0, 0, 1,rotate_1);

item_1.say(step + 1);

}, 1/speed);