Download presentation
Presentation is loading. Please wait.
1
Object Oriented Design
2
Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality
3
The makings of the glutplane Assumption: runtime environment is set up u Windows: GL4Java*.dlls installed u Mac: GL4Java*.zips installed in MRJClasses Find file “glutplane.java” and “glutplane.html” Install compile/link time environment u Windows: add GL4Java.jar to classpath u Mac: add GL4Java*.zips to project
4
Tools Basic level tools u Javac (part of Sun’s JDK) u Jikes: http://www.research.ibm.com/jikes/http://www.research.ibm.com/jikes/ IDEs u Jbuilder (Windows, OS X) u CodeWarrior (Windows, OS X, OS 9, …)
5
Modify source Edit “glutplane.java” Replace 3 calls to add_plane(); with 20 calls u Hint: use a “for” loop instead of typing add_plane(); 20 times! Compile/run/test Upload binary files (.class) and.html file to Web server u glutplane.class u glutplane$planeobj.class u glutplane$glutplaneCanvas.class Test applet on server email URL referring to html file.
6
More information Provided by the Game Engine builders http://schenkc.freeshell.org/classes/csci4448 /contra/installation.html http://schenkc.freeshell.org/classes/csci4448 /contra/installation.html Chris Schenk: schenkc@freeshell.orgschenkc@freeshell.org Luke Swanson: swansonl@colorado.eduswansonl@colorado.edu
7
Top Down Requirement Analysis Collect what the different applications/games need to have from the Game Engine Danger: u Getting carried away u Creating specification that cannot be implemented (in time, within budget, …)
8
Requirement for Game engine Camera aimed at character u Multiple cameras Shapes Aggregate shapes Rotation of shapes and camera Collision detection IIII Clipping Physics II u Particles Text Infinite backgrounds (repetitive textures, sky domes, …) Foreground/messages/score keeping
9
Camera Control Multiple cameras u Switching between cameras: no gui Camera tracking (stay on object) zoom Multiple views at the same time Independent control of camera
10
Shapes Box, sphere, circle, rectangle, plane, line, point, cylinder, triangle strip, Single / aggregate shapes Rotation Move in scene Add textures to shape Loading models u Load.obj files
11
Collision Detection iii Detect collision of shapes and groups of shapes Approximation with u spheres u Cubes
12
Clipping no
13
Physics Particles Airplanes, skis, bikes Simple gravity (would be nice)
14
Text no
15
Backgrounds Flat but repetitive Sky domes, Sky boxes
16
Information panels Score keeper Output message Dialogs (hard) u Use OpenGL, Swing or AWT? Menus (hard) u Use OpenGL, Swing or AWT?
17
Bottom Up system design Refactor existing functionality (the OpenGL mega blob) into service classes Approach: look at instances of applications containing functionality that could be factored out of the application into a the middle ware layer => the Game Engine Danger: u Feature oriented: contrast between cool and necessary functions
18
Refactoring textured square example Basic structure of OpenGL application is give by init, display, and reshape Look for code that, in generalized form could be pushed into game engine => collect these operations and attributes in a class called glWindow
19
INIT Collect a set of good initializations that make sense for most applications Turn most features ON (lighting, texture mode) In worst case application can overwrite or extend INIT
20
DISPLAY Refactor display method into u preDisplay: low level initializations that most applications would need anyway, e.g, clearing buffer. Translating, rotating individual objects u mainDisplay: leave this to application to specialize u postDisplay: Cleanup, error handling Buffer swapping (to implement double buffering)
21
Factor out utility functions Example: texture manager Replace complex implementations of texture loading with single calls of texture managing functions located in middle ware (game engine)
22
Produce new application with middleware stuff removed
23
Homework PROJECT: u Finish game proposal document u Email to Alex & Andri u Due: November 12 READING: u OpenGL Red book chapter 3; Viewing u http://fly.cc.fer.hr/~unreal/theredbook/ http://fly.cc.fer.hr/~unreal/theredbook/ u Due: November 12
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.