the sword: a role playing game for demonstrating computer graphics techniques
DESCRIPTION
The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques. Joshua R. New Computer Graphics Jacksonville State University. Outline. Introduction 2D Transparent, Image-based Font 3D ANSI/Symbol Font Fog Model Loading Animated Texture Particle System - PowerPoint PPT PresentationTRANSCRIPT
JN 04/21/23
Knowledge Systems Lab
The Sword: A Role Playing Game for Demonstrating Computer
Graphics Techniques
Joshua R. NewComputer Graphics
Jacksonville State University
JN 04/21/23
Knowledge Systems Lab
Outline
• Introduction• 2D Transparent, Image-based Font• 3D ANSI/Symbol Font• Fog• Model Loading• Animated Texture• Particle System• Video w/ Environmental Mapping
JN 04/21/23
Knowledge Systems Lab
Introduction
• The Sword – An RPG for demonstrating computer graphics techniques
• Created using C++ and OpenGL
• Most insight gained from Nehe’s OpenGL tutorials
http://nehe.gamedev.net/
• Computer Graphics by Dr. Mario Aguilar
JN 04/21/23
Knowledge Systems Lab
2D Transparent,Image-Based Font
• Load file and create font texture for HUD
TGA_Load(&font_texture, "Art/font.tga",
GL_LINEAR, GL_LINEAR);
Targa Image (*.tga) Alpha Channel
JN 04/21/23
Knowledge Systems Lab
2D Transparent,Image-Based Font
Transparent Text Example
JN 04/21/23
Knowledge Systems Lab
3D ANSI/Symbol Font
wglUseFontOutlines(base,… //Start of display lists0.2f, // Font thickness in Z directionWGL_FONT_POLYGONS,…) //Not lines
printf(“FPS = %2.0f”,fps);
glPrint(x, y, char *text)
JN 04/21/23
Knowledge Systems Lab
3D ANSI/Symbol Font
Texture Effects: Gray Color, Object Linear, Eye Linear, Sphere Map
JN 04/21/23
Knowledge Systems Lab
Fog
glFogi(GL_FOG_MODE, fogMode[fogfilter]); glFogf(GL_FOG_START, 30.0f); glFogf(GL_FOG_END, 190.0f);glFogf(GL_FOG_DENSITY, 0.007f); glFogfv(GL_FOG_COLOR, fogColor);glHint(GL_FOG_HINT, GL_DONT_CARE);glEnable(GL_FOG);
fogMode[]={GL_exp, GL_exp2, GL_linear, GL_none}
JN 04/21/23
Knowledge Systems Lab
Fog
NONE
LINEAR
EXP
EXP2
JN 04/21/23
Knowledge Systems Lab
Model Loading
Milkshape 3D: Program for building, coloring, texture-mapping, and animating 3D models (*.ms3d)
Screenshot of MS3D
The One Sword
Bubbling Cauldron
JN 04/21/23
Knowledge Systems Lab
Animated Texture
• Animate when the player is close to the texture (replicates a waving flag effect)
- Change height value of each vertex according to a sinusoidal wave in order to create a 3D mesh
Bitmap Image Sinusoidal Height Waving LinesWaving Texture
JN 04/21/23
Knowledge Systems Lab
Particle System
Flare (*.tga)
• Load *.tga for a single particle• Particle system creates multiple images with
specified properties– Number of particles per second– Properties (color, position, size)– Behavior (spread, velocity, gravity, attraction, etc.)
JN 04/21/23
Knowledge Systems Lab
Particle System
Blending
Off
Blending
On
JN 04/21/23
Knowledge Systems Lab
Particle System
EXPLOSION
IMPLOSION
JN 04/21/23
Knowledge Systems Lab
Video w/ Env. Mapping
• Open AVI file
• Grab the next frame and treat as bitmap
• Environmental mapping – mapping of a texture from the environment to a surface in order to replicate reflections:
JN 04/21/23
Knowledge Systems Lab
Video w/ Env. Mapping
SPHEREMAP Off SPHEREMAP On
JN 04/21/23
Knowledge Systems Lab
Future Directions
• Additional graphical techniques– Shadows using stencil buffer– Picking for selection of objects– Masking for appearance of 3D depth– Multi-texturing
• New MS3D loader
• Integration with gaming engine