Finishing touches to my app


A couple of things would finish my app off nicely and I could do with a few pointers as to how to implement them


  1. The text at the bottom LH corner is static as is the colour bar on the RHS (they are both in the OGL render window).

Both of these items do not rotate when rotatef/scale is called AND you can move the polygon model behind the colour bar + text so that it appears behind the objects.

  • you can see the model behind the text ---- kind of like an XOR opp has been performed.
  1. The XYZ axis rotates as per the model BUT it has its own local origin. I.E it always stays put even if a scale/translate opp is performed.

Any quick pointers on what to look at in the Red book?

Many thanks and have a great weekend


I’m assuming your color key at the upper right is static (those values don’t change?)

render your static elements last (i.e. your text at the lower left and your color key chart at the upper right).

before you render them set up an orthographic projection and load the model view matrix with the identity glLoadIdentity().

This will ensure that no transformations are applied to those elements.

You can apply your color key chart as a texture on a quad and to make it transparent use glColor4f(1,1,1,.60) or something like that to make the chart translucent.

As for your axis view at the lower right…

keep track of the rotation value for the model in your app. You’ll want to use this same value to do a glRotate before you render your axis view.

You can’t just use the current modelview matrix as it may have scales and translates in there.

so I would

  1. render the scene (your beams and such)
  2. glLoadIdentity() on the modelview
  3. translate,rotate,and translate back the axis view (in order to rotate about its center).
  4. render the axis view
  5. setup an ortho projection
  6. superimpose all static elements.

I hope that’s the kind of info you were looking for.