We have a 3D image composed of a nii volume and several obj meshes. We want to clip it to expose partial image. The viewpoint option at http://www.usc.edu/programs/face/3Dmodel/C57BL6-E185.html is the target. Is it possible to do in XTK?
I have figured out how to do this. In camera3D.js, on the call to create _perspective matrix,
X.matrix.makePerspective(X.matrix.identity(), this._fieldOfView, (width/height), 1, 10000);
adjust the 4th parameter (near) to introduce a clip view plane.
If want to use Orthographic projection, in order to unflatten the cube in example 00, (4th parameter is also the 'near' parameter)
X.matrix.makeOrtho(X.matrix.identity(), -(width/2), (width/2), -(height/2), (height/2), 1, 10000);
(there is also a _perspective creation call in renderer.js)
It would be great if there is a way in XTK to have an easy access to adjust that parameter on the fly but for now I will embed a handle to it.