in app/scripts/views/mainPage/view3d.js [369:414]
addThreeJsScene: function (json, nodeGeometry, nodeArrowsGeometry) {
if (!Ember.isNone(json.nodes)) {
var camera = this.get('camera');
var scene = this.get('scene');
this.clearScene();
if (nodeGeometry === undefined) {
nodeGeometry = new THREE.CubeGeometry(25, 25, 25);
}
var nodes = [];
this.set('nodes', json.nodes);
var firstNode = null;
for (var nodeId in json.nodes) {
var nodeData = json.nodes[nodeId];
var node = this.createNodeObject(nodeGeometry, nodeArrowsGeometry, nodeData);
scene.add(node);
if (firstNode === null) {
firstNode = node;
}
}
this.addSceneLigths(scene);
camera.position.z = 450;
this.initConnections(json.connections);
this.drawLines(json.connections);
var plane = new THREE.Mesh(
new THREE.PlaneBufferGeometry(this.dragPlaneWidth, this.dragPlaneHeight, 8, 8),
new THREE.MeshBasicMaterial({color: 0x000000, opacity: 0.25, transparent: true})
);
plane.visible = false;
plane.scale.x = this.dragPlaneSelectedScale;
plane.scale.y = this.dragPlaneSelectedScale;
plane.scale.z = this.dragPlaneSelectedScale;
plane.position.copy(firstNode.position);
scene.add(plane);
this.set('nodeMoveHelperPlane', plane);
}
},