Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added clipping planes #103

Merged
merged 3 commits into from
Jan 24, 2017
Merged

Added clipping planes #103

merged 3 commits into from
Jan 24, 2017

Conversation

favreau
Copy link
Member

@favreau favreau commented Jan 19, 2017

No description provided.

@@ -335,6 +340,9 @@ enum class CameraMode
inspect
};

// A clip plane is defined by a normal and a distance to the center of the scene bounding box
typedef std::vector< Vector4f > ClipPlanes;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it difficult to define clipping planes like the usual plane equation?
That's what RTNeuron uses and I think that Livre also.
I don't like your definition because if I have some clip planes and then I change the scene that would change the clip plane position, that makes no sense to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definition packs the plane equation into 4 floats for implementation convenience. That makes it easier to transfer the data to the underlying rendering engine. What matters is what is exposed to the client: the definition in the fbs, and this is common to RTNeuron, Livre and Brayns.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not my point. Both Livre and RTNeuron use 4 floats also. My concern is about the specification of what the 4th component means. In the usual plane equation the plane is defined by a b c d, and the points on the plane are those for which ax + by + cz + d = 0, in this equation a, b, c is a vector normal to the plane.
Your 4th component on the other hand is bizarre, because there's no way of writing a similar equation to the same before without knowing the bounding box of the scene, and that's something that changes, so your plane is not fully defined is it's not in the context of a specific scene, which is bad.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 4 floats contain absolute values, so changing the size of the scene does not affect the equation, and clip planes are reset anyway whenever the scene is changed. I'll update the documentation accordingly.

@@ -308,7 +312,8 @@ enum class CameraType
perspective,
stereo,
orthographic,
panoramic
panoramic,
clipped
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the clipping depends on the camera?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the best solution with ray-tracing, both for simplicity and performance.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an implementation detail to me. Can't you put the planes in the scene and then do the glue between the scene and the camera for the planes inside the OSPray implementation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should the clipping be attached to the scene? We are not selecting the data there, only visualizing a subset of it. The scene should definitely not be affected by the clipping planes. The camera definitely is the place where the clip planes should be handled.

@favreau favreau force-pushed the master branch 2 times, most recently from 1f5edb0 to b1a630f Compare January 19, 2017 13:41
@favreau favreau closed this Jan 19, 2017
@favreau favreau reopened this Jan 19, 2017
@favreau favreau changed the title Added clipping planes (OSPRay engine only) Added clipping planes Jan 20, 2017
@favreau
Copy link
Member Author

favreau commented Jan 24, 2017

Ping!

@favreau favreau merged commit b01b117 into BlueBrain:master Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants