@@ -76,8 +76,10 @@ Drawing.SimpleGraph = function(options) {
7676
7777 function init ( ) {
7878 // Three.js initialization
79- renderer = new THREE . WebGLRenderer ( { alpha : true } ) ;
80- renderer . setSize ( window . innerWidth , window . innerHeight ) ;
79+ renderer = new THREE . WebGLRenderer ( { alpha : true , antialias : true } ) ;
80+ renderer . setPixelRatio ( window . devicePixelRatio ) ;
81+ renderer . setSize ( window . innerWidth , window . innerHeight ) ;
82+
8183
8284 camera = new THREE . PerspectiveCamera ( 40 , window . innerWidth / window . innerHeight , 1 , 1000000 ) ;
8385 camera . position . z = 5000 ;
@@ -102,9 +104,9 @@ Drawing.SimpleGraph = function(options) {
102104
103105 // Node geometry
104106 if ( that . layout === "3d" ) {
105- geometry = new THREE . CubeGeometry ( 25 , 25 , 25 ) ;
107+ geometry = new THREE . BoxGeometry ( 25 , 25 , 25 ) ;
106108 } else {
107- geometry = new THREE . CubeGeometry ( 50 , 50 , 0 ) ;
109+ geometry = new THREE . BoxGeometry ( 50 , 50 , 0 ) ;
108110 }
109111
110112 // Create node selection, if set
@@ -226,16 +228,20 @@ Drawing.SimpleGraph = function(options) {
226228 * Create an edge object (line) and add it to the scene.
227229 */
228230 function drawEdge ( source , target ) {
229- material = new THREE . LineBasicMaterial ( { color : 0xff0000 , opacity : 1 , linewidth : 0.5 } ) ;
231+ material = new THREE . LineBasicMaterial ( { color : 0xff0000 , opacity : 1 , linewidth : 1 } ) ;
230232
231233 var tmp_geo = new THREE . Geometry ( ) ;
232234 tmp_geo . vertices . push ( source . data . draw_object . position ) ;
233235 tmp_geo . vertices . push ( target . data . draw_object . position ) ;
234236
235- line = new THREE . Line ( tmp_geo , material , THREE . LinePieces ) ;
237+ line = new THREE . LineSegments ( tmp_geo , material ) ;
236238 line . scale . x = line . scale . y = line . scale . z = 1 ;
237239 line . originalScale = 1 ;
238240
241+ // NOTE: Deactivated frustumCulled, otherwise it will not draw all lines (even though
242+ // it looks like the lines are in the view frustum).
243+ line . frustumCulled = false ;
244+
239245 geometries . push ( tmp_geo ) ;
240246
241247 scene . add ( line ) ;
0 commit comments