   // Inverse modelview-projection matrix.
   vvMatrix mvp, pr;
   getModelviewMatrix(&mvp);
+
+  // Not related.
+  vvMatrix invMV;
+  invMV.copy(&mvp);
+  invMV.invert();
+  // Not related.
+
   getProjectionMatrix(&pr);
   mvp.multiplyPost(&pr);
   mvp.invert();

    volSize = make_float3(vd->vox[0] * inv, vd->vox[1] * inv, 1.0f);
  }

  render<true><<<gridSize, blockSize>>>(d_output, width, height, 2.0f / (float)numSlices, volSize);
  cudaGLUnmapBufferObject(pbo);

  glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo);


typedef struct
{
  float m[4][4];
} matrix4x4;

__constant__ matrix4x4 c_invViewMatrix;

struct Ray
{
  float3 o;
  float3 d;
};

__device__ float volume(const float x, const float y, const float z)
{
  return tex3D(volTexture, x, y, z);
}

__device__ float volume(const float3& pos)
{
  return tex3D(volTexture, pos.x, pos.y, pos.z);
}

__device__ bool intersectBox(const Ray& r, const float3& boxmin, const float3& boxmax,
                             float *tnear, float *tfar)
