Re: [PyOpenGL-Users] Library choice for basic solid isometric rendering
Brought to you by:
mcfletch
From: Darren H. <da...@dv...> - 2009-12-21 17:35:07
|
Hi Mike, Thanks for the response, a couple more questions inline... On Mon, Dec 21, 2009 at 8:40 AM, Mike C. Fletcher <mcf...@vr...> wrote: > 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. Are there likely to be existing shaders for something this "simple" or should I plan to write my own? What do you mean by "just draw the lines"? My plan was to have a model of the cabinet in some yet-to-be-determined format and let the yet-to-be-written IsometricGLArea class render it for me. Is this something that would be part of the model or part of the renderer? Or maybe both? > 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). What are you getting at with "math is your friend" - as in: I should write the conversion to vector graphics by hand for best results? I'm very comfortable with math and have written various matrix transformations etc. several years ago. That said, I'd rather focus my very limited hobby time on the problem I am trying to solve: generate plans with 3d-isometric views for cabinets, rather than writing low-level graphics code for something that isn't particularly unique or compute intensive. >> 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. I am Linux kernel developer by trade (core locking code most recently), so I'd say pretty comfortable with "low-level code". However, I have only a few hours experience with OpenGL and am not particularly interested in learning any more of the nitty-gritty than I have to to accomplish the job at hand. As for what I want to optimize for. I mentioned my goals above. I don't need a high frame rate, just something the user can comfortably rotate to get a good view and then print a high quality image along with the cutlist. Eventually I may want to do full kitchen renderings and walkthroughs - but that is years away - if ever, and I suspect I'll need something more like a scenegraph library for that. > 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. Agreed. It also doesn't appear to have a very complete or stable python API. I'd rather not have my tiny little python app require such a huge dependency. > 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. Is PyOpenGL sufficient to embed a "drawingarea"-like widget in a gtk app? Do I need GTKGLExt for that? > 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. Thanks for the insight, very much appreciated. -- Darren Hart > > HTH, > Mike > > -- > ________________________________________________ > Mike C. Fletcher > Designer, VR Plumber, Coder > http://www.vrplumber.com > http://blog.vrplumber.com > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > -- Darren Hart |