-
-
Save pavelvasev/119b78009294e63c0df5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scene { | |
text: "Подключение ThreeJS-объекта + параметры" | |
Param { | |
id: c1 | |
text: "count 1" | |
value: 500 | |
max: 10000 | |
} | |
MyPointCloud { | |
color: 0xffff00 | |
radius: 5 | |
data: makeRand(c1.value) | |
} | |
Param { | |
id: c2 | |
text: "count 2" | |
value: 500 | |
max: 10000 | |
} | |
MyPointCloud { | |
color: 0xff0000 | |
radius: 5 | |
data: makeRand(c2.value) | |
id: cube2 | |
} | |
/* | |
RenderTick { | |
onAction: cube2.color = [Math.sin(time),Math.cos(time),0]; | |
} | |
*/ | |
function makeRand( n ) { | |
var acc = []; | |
var r = 100; | |
for (var i=0; i<n; i++) { | |
acc.push( r*(Math.random()-0.5) ); //x | |
acc.push( r*(Math.random()-0.5) ); //y | |
acc.push( r*(Math.random()-0.5) ); //z | |
} | |
return acc; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment