From: ruth c. <rc...@an...> - 2001-07-16 14:52:47
|
Very cool! We'll definitely add it to the VPython website. What's a good VRML viewer for windows? I downloaded one at random (cortona) but find it somewhat unintuitive. Ruth Chabay --On Monday, July 16, 2001 12:34 AM -0400 Michael Zadok Katzhyman <mz...@an...> wrote: > Everyone, > > Attached is a python module, based on povexport, which will export a > VPython scene into VRML97 (2.0). Feel free to integrate this into the > VPython package and/or post on the VPython webpage. > > Everything is implemented except convex objects, text, textures, lighting, > and camera positions. Right now curves look like crap and I think I'll > need to come up with some interpolation code. Arrows are currently > implemented as cylinders and cones instead of boxes and pyramids. VRML > has no primative for toruses (rings) but the code uses extrusions to make > a torus (the only problem being rendering is slower since an extrusion is > madup of a bunch of smaller shapes). > > Included in the file are routines to convert axis/angle rotations to > quaternions (originally I was planning to implement them to combine > rotations) and I have left them in there for future use. > > The code is call-compatible with povexport, if you pass an inc list to it > it will ignore it (same with the Shadowless flag). The only thing you > haev to cahnge is the import string from "import povexport" to "import > vrmlexport" and the calling code from "povexport.export(..." to > "vrmlexport.export(..." > > The code itself has been tested on a couple of the demos, the > electromagnetic wave problem from 33-132 at CMU, and a VPython model of > the G0 Detector being installed at Jefferson Lab (I wrote this myself and > it included nested frames with rotations and was what I used to initially > test my code). > > VRML can be easily imported to other 3D rendering software > (and then back into povray, I think). Also VRML can be embedded in > webpages which might be good for class webpages, etc. > > Cheers, > Michael Katz-Hyman |