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

Support clipping planes #517

Open
lexaknyazev opened this issue Dec 14, 2023 · 0 comments
Open

Support clipping planes #517

lexaknyazev opened this issue Dec 14, 2023 · 0 comments

Comments

@lexaknyazev
Copy link
Member

Custom clipping planes could be used for more convenient model inspection.

This feature would consist of:

  • Six planes forming a rectangular cuboid either axis- or viewer-oriented
  • Sliders to control them, each plane should move only along its normal

Rendering implementation would require a relatively simple vertex shader update:

gl_ClipDistance[0] = dot(position, planeXPos);
gl_ClipDistance[1] = dot(position, planeXNeg);
gl_ClipDistance[2] = dot(position, planeYPos);
gl_ClipDistance[3] = dot(position, planeYNeg);
gl_ClipDistance[4] = dot(position, planeZPos);
gl_ClipDistance[5] = dot(position, planeZNeg);

where position is a vertex position in the world (or view) space and each plane* is a vector with plane equation coefficients in the same space.

The feature would require support for the WEBGL_clip_cull_distance extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant