the sword: a role playing game for demonstrating computer graphics techniques

17
JN 06/14/22 Knowledge Systems Lab The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques Joshua R. New Computer Graphics Jacksonville State University

Upload: kassia

Post on 15-Jan-2016

50 views

Category:

Documents


0 download

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 Presentation

TRANSCRIPT

Page 1: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

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

Page 2: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

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

Page 3: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

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

Page 4: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

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

Page 5: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

JN 04/21/23

Knowledge Systems Lab

2D Transparent,Image-Based Font

Transparent Text Example

Page 6: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

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)

Page 7: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

JN 04/21/23

Knowledge Systems Lab

3D ANSI/Symbol Font

Texture Effects: Gray Color, Object Linear, Eye Linear, Sphere Map

Page 8: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

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}

Page 9: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

JN 04/21/23

Knowledge Systems Lab

Fog

NONE

LINEAR

EXP

EXP2

Page 10: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

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

Page 11: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

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

Page 12: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

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.)

Page 13: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

JN 04/21/23

Knowledge Systems Lab

Particle System

Blending

Off

Blending

On

Page 14: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

JN 04/21/23

Knowledge Systems Lab

Particle System

EXPLOSION

IMPLOSION

Page 15: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

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:

Page 16: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

JN 04/21/23

Knowledge Systems Lab

Video w/ Env. Mapping

SPHEREMAP Off SPHEREMAP On

Page 17: The Sword: A Role Playing Game for Demonstrating Computer Graphics Techniques

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