Cross section of a 3D model & hidden line wireframe

buano's picture

Is there a way in GL tools to view a cross section of a 3D model, kind of like backface culling but with more control. Ideally what i'd like to do is use an invisible 3d plane to control the cross section view of the mesh.

Photoshop CS4 has a feature that allows me to to make various cross section views along the horizontal and vertical axis, is this at possible with quartz just now without me having to go and manually edit the model in a 3D app?

Another problem i'm looking to solve is to display the wireframe of a mesh with the 'hidden lines removed' to give a clean out line of the model, i know that i can render in wireframe with the mesh renderer patch as well the the gl tools polygon patch, but i cant work out a way to give me a hidden line wireframe view?

Thanks, Nick

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cwright's picture
Re: Cross section of a 3D model & hidden line wireframe

regarding cross-sections, no, that's not possible. Doing cross-sections requires polygon splitter, and even Kineme3D doesn't have code to deal with that (it's not particularly impossible or anything, but it is a fair amount of code none the less). You can possibly fake it with a GLSL shader, but I don't think it'll be exact.

To do outlines, there are a few approaches -- polygon offset is probably a reasonable place to start (there's a sample composition in GLTools that show exact wireframe overlays -- that's not quite what you want, but I believe the effect can be accomplished via similar means).

liik's picture
Re: Cross section of a 3D model & hidden line wireframe

I've done some sort of cross-sections by changing the position of the near-far clipping planes in the Kineme GL Ortho patch...the only thing is it's in ortho view.

PreviewAttachmentSize
ortho_section.qtz4.02 KB

gtoledo3's picture
Re: Cross section of a 3D model & hidden line wireframe

It's not quite the same as a variable cross section, but you can use a render patch (like the 3d object render) and double render it with one slightly smaller, and all black; basically, using one as a mask. I'm attaching a simple example, with just the sphere, to illustrate what I mean.

On the same "tip" about the ortho thing... QC also has it's clipping plane as you bring objects too far "forward" in z. You can bring an object forward to "shave" some of it off, put that in a render in image, and then resize. I think that would be a little weird, but it might be a route to consider if using the object as it's own mask won't work in your scenario.

PreviewAttachmentSize
sphere outline.qtz3.46 KB

fsk's picture
Re: Cross section of a 3D model & hidden line wireframe

dunno what a cross section actually is (half the model or just the thin line). in the attachment half the model remains visible and you can only do it along a x,y or z axis but you could change this by adding another threshold or something like:

if(pos[int(axis)]>treshold&&pos[int(axis)]<treshold+sectionWidth)

or something :).

for an arbitrarily rotated section plane you would have to use a rotation matrix on the pos vector in the vertex shader.

hope this helpes

PreviewAttachmentSize
slice.qtz179.56 KB