Ignore:
Timestamp:
04/03/14 17:07:28 (10 years ago)
Author:
mmichalski
Message:

New NeuronDrawer? without U-shape in connections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • js/viewer-f0/js/graphicsEngine.js

    r193 r208  
    1 function GraphicsEngine(context) {
     1function GraphicsEngine(context, width, height) {
    22    this._scene = undefined;
    33    this._camera = undefined;
    44    this._renderer = undefined;
    5     this._canvasWidth = 400;
    6     this._canvasHeight = 400;
    7     this._containerContext = context;
     5    this._canvasWidth = width;
     6    this._canvasHeight = height;
     7    this._containerContextName = context;
    88    this._BALL_RADIUS = 0.25;
    99    this._controls = undefined;
     
    1111    this._debug1 = 0
    1212    this._showAxis = false;
     13    this._render = true;
    1314}
    1415
     
    2122    this._renderer.setClearColor(0x000000, 1);
    2223    this._renderer.setSize(this._canvasWidth, this._canvasHeight);
    23     //this._containerContext = $("#container");
    24     this._containerContext.append(this._renderer.domElement);
     24    this._containerContextName.append(this._renderer.domElement);
     25
     26    var self = this;
     27    this._renderer.domElement.addEventListener('mousemove', function(evt){
     28        self._render = true;
     29    });
    2530}
    2631
     
    138143
    139144GraphicsEngine.prototype.addPart = function (part) {
    140     console.log(part.getX(),part.getY(),part.getZ(), "|", part.getXshape(),part.getYshape(),part.getZshape(),"|",part.getXrot(),part.getYrot(),part.getZrot())
     145    //console.log(part.getX(),part.getY(),part.getZ(), "|", part.getXshape(),part.getYshape(),part.getZshape(),"|",part.getXrot(),part.getYrot(),part.getZrot())
    141146    switch (part.getType()) {
    142147        case 0:
     
    257262            self.renderScene();
    258263        });
     264
     265    if(!this._render)
     266    {
     267        return;
     268    }
     269
    259270    this._renderer.render(this._scene, this._camera);
    260271    this._controls.update();
    261 
     272    this._render = false;
    262273}
    263274
    264275GraphicsEngine.prototype._debug = function()
    265276{
    266 
    267     this._scene.add( new THREE.AxisHelper( 20 ) );
     277    this._scene.add(new THREE.AxisHelper( 20 ));
    268278}
    269279
Note: See TracChangeset for help on using the changeset viewer.