private void renderObject(final Graphics2D graphics,
			final Matrix viewProjectionMatrix, 
			final CountDownLatch latch,
			final AtomicLong renderingTime, 
			final Object3D obj,final boolean isLastChild) 
	{
		calculationThreadPool.submit( new Runnable() {

			@Override
			public void run() 
			{
				try 
				{
					final RenderingMode renderMode;
					if ( obj.isRenderOutline() ) {
						renderMode = RenderingMode.RENDER_OUTLINE;
					} else if ( obj.isRenderWireframe() ) {
						renderMode = RenderingMode.RENDER_WIREFRAME;
					} else {
						renderMode = RenderingMode.DEFAULT;
					}

					final PrimitiveBatch batch = new PrimitiveBatch(renderMode,obj);

					prepareRendering( obj , viewProjectionMatrix , batch , graphics );

					if ( ! batch.isEmpty() ) 
					{
						synchronized( batches ) {
							batches.add( batch );
						}
						
						if ( isLastChild && ! obj.hasChildren() ) { // only count down after a root object has been queued for rendering
							latch.countDown();
						}						
						
						// recursively render children only if parent was rendered
						for ( Iterator<Object3D> it = obj.getChildren().iterator() ; it.hasNext(); ) 
						{
							renderObject( graphics , viewProjectionMatrix , latch , renderingTime , it.next() , ! it.hasNext() );
						}
					} 
					else 
					{
						latch.countDown();
					}
				}
				catch(Exception e) 
				{
					e.printStackTrace();
				    System.err.println("Failed to render "+obj);
					latch.countDown();
				}
			}
		} );
	}