Re: [PyOpenGL-Users] Library choice for basic solid isometric rendering
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2009-12-21 16:41:05
|
Darren Hart wrote: > I'm looking for a python library to use to do simple 3D-isometric > renderings embedded in a gtk cabinet cad program. I'm looking to do > "solid" renderings with all visible edges in black lines with all the > visible faces a solid white - I don't want to see the occluded parts > of the cabinet. (if there is a term to describe this, please educate > me!). I'd like to be able to convert these to a readily printable > format. > A simple depth buffer will remove the hidden lines. You can either do a shader or a series of line segments/loops to render the edges you want to display. Normally those will be *just* those edges which the user thinks of as edges (not the edge of every triangle), so it's likely easiest just to draw the lines and have full control over them. In terms of printable formats, that depends on whether you want an SVG/PDF/vector graphic or a simple bitmaps. Everything will easily produce bitmap images at screen (low) resolution, and many can render to an off-screen buffer for higher-resolution images. For a vector image you can use gl2ps or the like, which attempts to hook the low-level GL and capture the primitives into a buffer. Failing that, math is your friend (an likely a better approach for a CAD system if you're intending to use the output as plans). > I've looked at several libraries: python-opengl, python-gtkglext, > python-visual, OSG, VTK, crystal-space, ogre, etc. I don't know enough > yet to understand how much of an abstraction I need or which of all of > these is the best starting point. Seeing as how python-opengl would be > involved in most of these I thought I'd ask here for advice on which > of these to start trying to learn more about. > Your query really needs to include how comfortable you are with low-level programming and for what you want to optimize. OSG is a huge hammer, it should be able to handle anything you can throw at it, but it's also a big 3D scenegraph library you'll need to wrap your head around and package with your app. PyOpenGL and GTKGLExt (which is just an OpenGL visual really) are extremely low-level, if you're happy slinging shaders and arrays-of-vertices, that might be appropriate. Crystal-space and Ogre are more focused on the needs of game developers, but the engines are large collections of rendering processes nicely packaged from what I hear. VTK is more focused on visualization of datasets, from what I hear. Choosing one of the big packages means that someone has likely done all the work for you. Choosing one of the low-level packages means you have to code it yourself, but it's just going to do what you've told it to do. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |