object oriented design. goals feedback homework 8 top down design: analyzing the requirements ...
Post on 21-Dec-2015
217 views
TRANSCRIPT
![Page 1: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/1.jpg)
Object Oriented Design
![Page 2: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/2.jpg)
Goals
Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental
OpenGL functionality
![Page 3: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/3.jpg)
The makings of the glutplane
Assumption: runtime environment is set up Windows: GL4Java*.dlls installed Mac: GL4Java*.zips installed in MRJClasses
Find file “glutplane.java” and “glutplane.html”
Install compile/link time environment Windows: add GL4Java.jar to classpath Mac: add GL4Java*.zips to project
![Page 4: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/4.jpg)
Tools
Basic level tools Javac (part of Sun’s JDK) Jikes: http://www.research.ibm.com/jikes/
IDEs Jbuilder (Windows, OS X) CodeWarrior (Windows, OS X, OS 9, …)
![Page 5: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/5.jpg)
Modify source
Edit “glutplane.java” Replace 3 calls to add_plane(); with 20 calls
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
glutplane.class glutplane$planeobj.class glutplane$glutplaneCanvas.class
Test applet on server email URL referring to html file.
![Page 6: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/6.jpg)
More information
Provided by the Game Engine builders http://schenkc.freeshell.org/classes/csci4448
/contra/installation.html
Chris Schenk: [email protected] Luke Swanson: [email protected]
![Page 7: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/7.jpg)
Top Down Requirement Analysis
Collect what the different applications/games need to have from the Game Engine
Danger: Getting carried away Creating specification that cannot be
implemented (in time, within budget, …)
![Page 8: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/8.jpg)
Requirement for Game engine
Camera aimed at character Multiple cameras
Shapes Aggregate shapes Rotation of shapes and camera Collision detection IIII Clipping Physics II
Particles Text Infinite backgrounds (repetitive textures, sky domes, …) Foreground/messages/score keeping
![Page 9: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/9.jpg)
Camera Control
Multiple cameras Switching between cameras: no gui
Camera tracking (stay on object) zoom Multiple views at the same time Independent control of camera
![Page 10: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/10.jpg)
Shapes
Box, sphere, circle, rectangle, plane, line, point, cylinder, triangle strip,
Single / aggregate shapes Rotation Move in scene Add textures to shape Loading models
Load .obj files
![Page 11: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/11.jpg)
Collision Detection iii
Detect collision of shapes and groups of shapes
Approximation with spheres Cubes
![Page 12: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/12.jpg)
Clipping
no
![Page 13: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/13.jpg)
Physics
Particles Airplanes, skis, bikes Simple gravity (would be nice)
![Page 14: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/14.jpg)
Text
no
![Page 15: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/15.jpg)
Backgrounds
Flat but repetitive Sky domes, Sky boxes
![Page 16: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/16.jpg)
Information panels
Score keeper Output message Dialogs (hard)
Use OpenGL, Swing or AWT? Menus (hard)
Use OpenGL, Swing or AWT?
![Page 17: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/17.jpg)
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: Feature oriented: contrast between cool and necessary
functions
![Page 18: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/18.jpg)
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
![Page 19: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/19.jpg)
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
![Page 20: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/20.jpg)
DISPLAY
Refactor display method into preDisplay:
low level initializations that most applications would need anyway, e.g, clearing buffer.
Translating, rotating individual objects
mainDisplay: leave this to application to specialize postDisplay:
Cleanup, error handling Buffer swapping (to implement double buffering)
![Page 21: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/21.jpg)
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)
![Page 22: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/22.jpg)
Produce new application with middleware stuff
removed
![Page 23: Object Oriented Design. Goals Feedback homework 8 Top Down Design: analyzing the requirements Bottom Up Design: refactoring fundamental OpenGL functionality](https://reader035.vdocument.in/reader035/viewer/2022062714/56649d615503460f94a43491/html5/thumbnails/23.jpg)
Homework PROJECT:
Finish game proposal document Email to Alex & Andri Due: November 12
READING: OpenGL Red book chapter 3; Viewing http://fly.cc.fer.hr/~unreal/theredbook/ Due: November 12