/**
   * Creates a new CaptureRenderer, based on an Inside3dRenderer with the given mesh as Skybox.
   *
   * @param context - Context of the application.
   * @param skybox
   * @param cameraManager
   */
  public CaptureRenderer(Context context, Cube skybox, CameraManager cameraManager) {
    // based on Inside3dRenderer. We are inside a skybox.
    super(context);
    mSkybox = skybox;
    super.setSurroundingMesh(mSkybox);
    super.setFovDeg(DEFAULT_FOV_DEG);

    // init attributes
    mCameraManager = cameraManager;
    mCameraManager.addSnapshotEventListener(this);
    mContext = context;

    mMarkerBitmap = BitmapDecoder.safeDecodeBitmap(mContext.getResources(), MARKER_RESSOURCE_ID);
    mContourBitmap = BitmapDecoder.safeDecodeBitmap(mContext.getResources(), CONTOUR_RESSOURCE_ID);

    // if auto samplig enabled
    if (mSampleRate == 0) {
      mSampleRate = (int) mCameraManager.getCameraResolution();
      mSampleRate = (int) (ceilPowOf2(mSampleRate) / SNAPSHOT_AUTO_SAMPLE_RATIO);
    }

    mViewMatrix = new float[16];
    Matrix.setIdentityM(mViewMatrix, 0);

    // create dots and snapshot lists
    mSnapshots = new ArrayList<Snapshot3D>();
    mDots = new LinkedList<Snapshot3D>();
    mContours43 = new LinkedList<Snapshot3D>();
    mContours34 = new LinkedList<Snapshot3D>();
    mContours = mContours43;
    mTargetsLock = new ReentrantLock();
    mSnapshotsLock = new ReentrantLock();
  }