170 likes | 357 Views
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
E N D
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 • Video w/ Environmental Mapping
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
2D Transparent,Image-Based Font • Load file and create font texture for HUD TGA_Load(&font_texture, "Art/font.tga", GL_LINEAR, GL_LINEAR); Alpha Channel Targa Image (*.tga)
Transparent Text Example 2D Transparent,Image-Based Font
3D ANSI/Symbol Font wglUseFontOutlines( base,… //Start of display lists 0.2f, // Font thickness in Z direction WGL_FONT_POLYGONS,…) //Not lines printf(“FPS = %2.0f”,fps); glPrint(x, y, char *text)
3D ANSI/Symbol Font Texture Effects: Gray Color, Object Linear, Eye Linear, Sphere Map
Fog fogMode[]={GL_exp, GL_exp2, GL_linear, GL_none} 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);
Fog L I N E A R N O N E E X P 2 E X P
Model Loading Milkshape 3D: Program for building, coloring, texture-mapping, and animating 3D models (*.ms3d) The One Sword Screenshot of MS3D Bubbling Cauldron
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 Texture Waving Lines
Flare (*.tga) Particle System • 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.)
Particle System B l e n d i n g O f f B l e n d i n g O n
Particle System E X P L O S I O N I M P L O S I O N
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:
Video w/ Env. Mapping SPHEREMAP Off SPHEREMAP On
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