|
|||||||||||||||
|
Bitmap Text Text is obviously quite useful for graphics applications - instruction screens, timers, popup menus, etc. There are more advanced ways of displaying text in OpenGL, but for now, we see that GLUT offers a painless way to display text using: void glutBitmapCharacter(void *font, int character); The fonts available are bitmap fonts such as: GLUT_BITMAP_HELVETICA_12 and By stepping through an array of characters (until you hit the null character), you can display text strings on the screen. void Print(void *font, char *theText) Use glRasterPos3f(x,y,z); to set the location of where the text will appear. The Sample Code uses the 3D scene from Figure 5.63 in the text, so there's lighting and material properties involved. To set the colour of your text, you can use: GLfloat mat_emission[] = {0.0f, 1.0f, 0.0f}; This operates just like the GL_AMBIENT, GL_DIFFUSE, etc. except it's the emission colour of the object, meaning the colour emitted by the object (glow).
Using QME to Create MD2 Models You are required to create MD2 files for your major project from Inspire 3D objects. Here's a quick how-to.
There's help for using QME here. The left panel shows the frames available (in two scenes here), with the middle view showing the current frame. Clicking the green play button will play the frames of one scene repeatedly.
To add more frames, right-click on the scene (which you can rename by the usual methods), and choose Import Frames. You need to import the same model in a different position. You can't have multiple frames of different objects - they need to have the same number of triangles. That's why using one boned object in Inspire and saving the transformed object from Layout is probably going to be the easiest way to make the Inspire frames. Importing frames normally makes a separate scene for each frame. You can simply drag frames from one scene to the other and drag them around to set the correct order. Once you have the frames in place, rename the scene and it should logically name the frames after the scene with numbers. (If pressing Enter doesn't make the program accept your name change, you can simply click in an empty area of the workspace). You can view and edit the properties of your model by choosing View > Model Properties. Check the number of triangles is < 4096.
When you have finished the model, you save it as an MD2 file (not MDO or MDL). This should make a .md2 file and a skin (.pcx). NEW! Getting QME skins to work with the model loading code! (18/10 & updated 24/10) Painting the skin can be done in QME using the painting tools or in an external image editor. If you want better detail in your QME skin (and you probably do), then you can resize the skin by setting the skin size in the model properties panel (see screenshot above). OK, so it seems that the MD2 loading code we have can't open the pcx file produced by QME. We can convert it to a format that we can use, however:
That should get you usable skins out of QME. All you need to do is draw them in QME (covered in lecture), and maybe touch them up in Paint or some other program.
|
|
||||||||||||||