Anders and Briegel in Python
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

grid.js 791B

123456789101112131415161718192021222324
  1. //TODO Move to THREE.gridhelper
  2. // Make a grid
  3. function makeGrid(side, n, color) {
  4. var markers = new THREE.Object3D();
  5. var gridStyle = {
  6. color: color,
  7. transparent: true,
  8. linewidth: 1,
  9. opacity: 0.5
  10. };
  11. var material = new THREE.LineBasicMaterial(gridStyle);
  12. for (var i = -n / 2; i <= n / 2; ++i) {
  13. var geometry = new THREE.Geometry();
  14. geometry.vertices.push(new THREE.Vector3(side * i / n, -side / 2, 0));
  15. geometry.vertices.push(new THREE.Vector3(side * i / n, side / 2, 0));
  16. var line = new THREE.Line(geometry, material);
  17. var line90 = line.clone();
  18. line90.rotation.z = Math.PI / 2;
  19. markers.add(line);
  20. markers.add(line90);
  21. }
  22. markers.name = "grid";
  23. return markers;
  24. }