From: Bill Kelly Date: 2001-11-13T12:36:38+09:00 Subject: [ruby-talk:24975] Re: FXGLViewer - rotate a primitive? Hi Phlip, From: "Phlip" > > Rubies: > > Regarding this example code... > > FXRuby-0.99.174/examples/glviewer.rb > > ....open it up and eyeball this line: > > gp2.append(FXGLCylinder.new(-1.0, 0.5, 0.0, 1.0, 0.5)) > > Now suppose I feel that vertical cylinders are boring. I want to > rotate this cylinder (not the whole scene - just the cylinder) 30 > degrees over. > > Does OpenGL miss this simple ability? The concept I'm trying to match > is POVray script, which rotates all the time as part of Composite > Solid Geometry. My OpenGL's going on about 3+ years rusty, but, I can imagine circumstances under which vertical cylinders might indeed be boring, such as the hypothetical inability to make some less vertical than others :-) Check out robot.rb which should hopefully be found in your rubygl-x.xx/samples directory. . . a hierarchical "robot arm" model built from a few 'box' primitives scaled and rotated relative to one another. Also, Ch. 4 of: http://ask.ii.uib.no/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_PG/ (Plus there are a plethora of OpenGL examples at: http://www.opengl.org/developers/code/samplecode.html ) HTH, Bill P.S. Your mention of CSG in POVRay reminded me of an article about doing fast (dynamic) CSG in OpenGL using the stencil buffer: http://www.sgi.com/software/opengl/advanced97/notes/node11.html