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.

graph.js 522B

8 years ago
1234567891011121314151617181920
  1. function buildGraph(json) {
  2. // Add all the qubits
  3. var geometry = new THREE.Geometry();
  4. var vertex = new THREE.Vector3(0, 0, 0);
  5. geometry.vertices.push(vertex);
  6. var nodes = new THREE.Points(geometry, materials.node);
  7. // Add all the edges
  8. var edges = new THREE.Object3D();
  9. edges.add(makeEdge({
  10. "start": [0, 0, 0],
  11. "end": [1, 1, 1]
  12. }));
  13. // Construct and return
  14. var graph = new THREE.Object3D();
  15. graph.add(nodes);
  16. graph.add(edges);
  17. return graph;
  18. }