Anders and Briegel in Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

grid.js 733B

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