From: Phlip Date: 2001-11-29T15:14:00+09:00 Subject: [ruby-talk:26871] FXGLViewer - rotate a primitive? Rubies: I finally got back to this effort; here's a recap 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. My experiments with C OpenGL sample code reveals that to rotate one pushes the current transformation matrix, builds a new one with what you want in it, paints a gluCylinder in, and then pops the matrix. However, when I open up FXGLCylinder.cpp, I find this function: // Draw void FXGLCylinder::drawshape(FXGLViewer*){ #ifdef HAVE_OPENGL GLUquadricObj* quad=gluNewQuadric(); gluQuadricDrawStyle(quad,(GLenum)GLU_FILL); /* gluQuadricNormals(quad,GLU_SMOOTH); gluQuadricOrientation(quad,GLU_OUTSIDE); */ glPushMatrix(); glRotatef(-90,1,0,0); gluCylinder(quad,radius,radius,height,FXGLCYLINDER_SLICES_NUMBER,FXGLCYLINDER_STACKS_NUMBER); gluQuadricOrientation(quad,(GLenum)GLU_INSIDE); gluDisk(quad,0,radius,FXGLCYLINDER_SLICES_NUMBER,FXGLCYLINDER_LOOPS); glTranslatef(0,0,height); gluQuadricOrientation(quad,(GLenum)GLU_OUTSIDE); gluDisk(quad,0,radius,FXGLCYLINDER_SLICES_NUMBER,FXGLCYLINDER_LOOPS); glPopMatrix(); gluDeleteQuadric(quad); #endif } Observe that we push the matrix, add a hard-coded rotation to the current matrix, paint the cylinder, and pop the matrix. The library therefor disables end-programmer control over the orientation of the cylinders available. Also observe this is on the FOX side, not the FXRuby side. I could go in after this myself, but first I must ask if the ability to set the rotation matrix as a property of the FXGLCylinder is a pending or near-term feature. I'm asking here on behalf of continuity with my prior posts, and with Lyle's maintenance of FXRuby, but I'm also asking on the FOX mailing list. I have fox-0.99.174, but the source for fox-0.99.181 shows the same problem. -- Phlip http://www.greencheese.org/HatTrick