mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
fix bug with ray subsetting using wrong near and far planes
This commit is contained in:
parent
67b0fea23a
commit
7d0c1e66c1
@ -830,6 +830,7 @@ void Camera::FindSubset(const vtkm::Bounds& bounds)
|
|||||||
transformed[2] = (transformed[2] * 0.5f + 0.5f);
|
transformed[2] = (transformed[2] * 0.5f + 0.5f);
|
||||||
zmin = vtkm::Min(zmin, transformed[2]);
|
zmin = vtkm::Min(zmin, transformed[2]);
|
||||||
zmax = vtkm::Max(zmax, transformed[2]);
|
zmax = vtkm::Max(zmax, transformed[2]);
|
||||||
|
// skip if outside near and far clipping
|
||||||
if (transformed[2] < 0 || transformed[2] > 1)
|
if (transformed[2] < 0 || transformed[2] > 1)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@ -894,15 +895,10 @@ VTKM_CONT void Camera::UpdateDimensions(Ray<Precision>& rays,
|
|||||||
this->CameraView.SetLookAt(this->GetLookAt());
|
this->CameraView.SetLookAt(this->GetLookAt());
|
||||||
this->CameraView.SetPosition(this->GetPosition());
|
this->CameraView.SetPosition(this->GetPosition());
|
||||||
this->CameraView.SetViewUp(this->GetUp());
|
this->CameraView.SetViewUp(this->GetUp());
|
||||||
//
|
|
||||||
// Just create come clipping range, we ignore the zmax value in subsetting
|
|
||||||
//
|
|
||||||
vtkm::Float64 maxDim = vtkm::Max(
|
|
||||||
boundingBox.X.Max - boundingBox.X.Min,
|
|
||||||
vtkm::Max(boundingBox.Y.Max - boundingBox.Y.Min, boundingBox.Z.Max - boundingBox.Z.Min));
|
|
||||||
|
|
||||||
maxDim *= 100;
|
// Note:
|
||||||
this->CameraView.SetClippingRange(.0001, maxDim);
|
// Use clipping range provided, the subsetting does take into consideration
|
||||||
|
// the near and far clipping planes.
|
||||||
|
|
||||||
//Update our ViewProjection matrix
|
//Update our ViewProjection matrix
|
||||||
this->ViewProjectionMat =
|
this->ViewProjectionMat =
|
||||||
|
Loading…
Reference in New Issue
Block a user