void render(GraphicsContext g,Point2D viewportOrigin){
  g.setGlobalAlpha(life);
  g.setGlobalBlendMode(blendMode);
  if (image != null) {
    g.save();
    g.translate(x - viewportOrigin.getX(),y - viewportOrigin.getY());
    g.scale(radiusX * 2 / image.getWidth(),radiusY * 2 / image.getHeight());
    g.drawImage(image,0,0);
    g.restore();
  }
 else {
    g.setFill(color);
    g.fillOval(x - viewportOrigin.getX(),y - viewportOrigin.getY(),radiusX * 2,radiusY * 2);
  }
}

void render ( GraphicsContext g , Point2D viewportOrigin ) { g . setGlobalAlpha ( life ) ; g . setGlobalBlendMode ( blendMode ) ; if ( image != null ) { g . save ( ) ; g . translate ( x - viewportOrigin . getX ( ) , y - viewportOrigin . getY ( ) ) ; g . scale ( radiusX * 2 / image . getWidth ( ) , radiusY * 2 / image . getHeight ( ) ) ; g . drawImage ( image , 0 , 0 ) ; g . restore ( ) ; } else { g . setFill ( color ) ; g . fillOval ( x - viewportOrigin . getX ( ) , y - viewportOrigin . getY ( ) , radiusX * 2 , radiusY * 2 ) ; } }
renders particle to g context . takes into account the viewport origin , so if particle xy is outside the viewport it will not be seen .
