34 A Position Onstage
var center_distance = 15;
//change 5 10 or 15
//radius of the circumference around (0,0,0)
//where the labels will be placed
//change 5 10 or 15
//radius of the circumference around (0,0,0)
//where the labels will be placed
//Useful if you have to apply an initial rotation to the object
var rotate_0 = 0;
var height_of_the_ ground= 0;
//change options exemple 5
//number of items
var ITEMS=4;
//change to 10, 20, 50
var items=[];
for (var i=0; i < ITEMS; i++){
var pos_x= center_distance*Math.sin(Math.PI*2*i/ITEMS);
var pos_y= center_distance*Math.cos(Math.PI*2*i/ITEMS);
var pos_z=height_of_the_ ground;
var rotate= rotate_0 + (Math.PI*2*i/ITEMS);
var poster=Scene.createTextBillboard(pos_x,pos_y,pos_z);
poster.setPositionAngle(pos_x, pos_y, pos_z, 0, 0, 1,rotate);
var xc=Math.round(pos_x)
var yc= Math.round(pos_y)
var zc= Math.round(pos_z)
poster.setBackgroundColor(17, 116, 22);
poster.setTextColor(255,255, 255);
poster.setFontSize(2);
poster.setSize(6, 3);
poster.setText("x ="+xc +"\n" +"y ="+ yc +"\n"+"z ="+zc +"\n" +"Center distance ="+ center_distance + "\n");
items.push(poster);
}
Obra publicada con Licencia Creative Commons Reconocimiento 4.0