envymycar a multi-player car racing game for teaching computer graphics fabio ganovelli massimiliano...
TRANSCRIPT
![Page 1: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/1.jpg)
eNVyMyCara Multi-player Car Racing Game
for Teaching Computer Graphics
Fabio Ganovelli Massimiliano CorsiniVisual Computing Lab, ISTI - PISA
![Page 2: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/2.jpg)
Before starting...
meet:
SoftOGLhow to make your students hate you
![Page 3: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/3.jpg)
2006:: appointed contract professor at University Of Siena for the course of Fundamental of Computer Graphics
7 weeks 42 hours (middle term test and lab included) 9 students
Pisa
Siena
![Page 4: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/4.jpg)
Possible Course Program
Introduction (history, uses, trends...)
general notions (rendering paradigms, hardware...)
tranformations
rasterization
lighting and texture mapping
final project: simple projects using OpenGL...
I could have done this way...still...
![Page 5: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/5.jpg)
![Page 6: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/6.jpg)
![Page 7: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/7.jpg)
Course project:
SoftOGL.sf.netImplementing a working OpenGL-like graphics API
benefit: to make the students gain a solid understanding ofCG algorithms
![Page 8: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/8.jpg)
namespace softogl{ namespace impl{ // DDA segment rasterization // void DDASegmentRasterization(Segment2d s,int size=1){ // .................implementation.................. // } // Bresehnam segment rasterization // void BresenhamSegmentRasterization(Segment2d s,int siz = 1){ // .................implementation.................. // } // Polygon Filling // void PolygonFilling(Polygon2d p){ // .................implementation................. // } // }// end impl namespace sdk{ // ...}// end sdk};
students:iplementation
me: environmentand SDK tools
![Page 9: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/9.jpg)
![Page 10: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/10.jpg)
SoftOGL
first day, Feb 27, 2006
![Page 11: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/11.jpg)
last day, April 9, 2006
![Page 12: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/12.jpg)
Mistakes
programming skills :(
little sense of achievement :(
way too much work for the number of credits given by the CG course :(
![Page 13: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/13.jpg)
2007:: My collegue Massimiliano was appointed contract professor at University Of Ferrara
Pisa
Siena
Ferrara
![Page 14: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/14.jpg)
Goals of the course project
Give them a reachable target
Generate cooperation and competition between students
Make them learn some CG
Set the students in a common framework without too much specialized tasks
Do not burden them with non-CG problems
![Page 15: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/15.jpg)
![Page 16: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/16.jpg)
yeah..
![Page 17: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/17.jpg)
eNVyMyCar.sf.net
a Multi-player Car Racing Game for
Teaching Computer Graphics
![Page 18: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/18.jpg)
Concept
A software framework implementing a simple multi-player car-racing game over a LAN
Student's task: implement a client for the game:
RENDER the scene interactively
take the user input
doesn't it remind you something?...
![Page 19: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/19.jpg)
Goals of the course project
Give them a reachable target
Generate cooperation and competition between students
Make them learn some CG
Set the students in a common framework without too much specialized tasks
Do not burden them with non-CG problems
![Page 20: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/20.jpg)
Envy factor
At any moment, a client may send a snapshot of its view to all the others connected
NVMC_Server
![Page 21: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/21.jpg)
Goals of the course project
Give them a reachable target
Generate cooperation and competition between students
Make them learn some CG
Set the students in a common framework without too much specialized tasks
Do not burden them with non-CG problems
![Page 22: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/22.jpg)
Elements of the SceneStatic
The street
The buildings
The trees
Tunnels...
Dynamic (state)
The cars
sun position
p0
p0
p0
p1
p2
p3
p4
p5 p
6
p7
![Page 23: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/23.jpg)
\
NVMC Architecture
![Page 24: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/24.jpg)
#include <game_client.h>extern NvmcClient cli;
void draw_scene(){cli.UpdateScene();
/* .....*/
cli.UpdateScreenshots();}
void process_event(....){switch(..) {
case ... : cli.Command(COMMAND_INCREASE_SPEED); break;case ... : cli.Command(COMMAND_DECREASE_SPEED); break;case ... : cli.Command(COMMAND_TURN_LEFT); break;case ... : cli.Command(COMMAND_TURN_RIGHT); break;case ... : cli.Command(COMMAND_BRAKE); break;case ... : cli.Command(SEND_SCREENSHOT);break;
}}int launch_viewer(){......}
![Page 25: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/25.jpg)
making a circuit
NVMC provides a simple code to convert a bitmap in a circuit
![Page 26: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/26.jpg)
Implementation
the simpler the better:
C++
VCG for geometric concepts (vcg.sf.net)
QT for networking and multi threading
whatever you/they like for GUI (sdl -glut -qt)
used with: Windows ( .net), Mac (xcode), Linux (eclipse/Kdevelop)
![Page 27: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/27.jpg)
Goals of the course project
Give them a reachable target
Generate cooperation and competition between students
Make them learn some CG
Set the students in a common framework without too much specialized tasks
Do not burden them with non-CG problems
![Page 28: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/28.jpg)
Incremental learning
Basic features (the minimum required)
geometric transformations
lighting
texturing terrain and buildings
rollingsteering
putting on its place
scale place the carin its current position
![Page 29: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/29.jpg)
Make it interesting
The students are given a list of possible features to implement, e.g.:
impostors for the trees
motion blurring for speed
lens flares
dynamic reflections on the car
projective texturing for the car lights
Each feature brings some points
![Page 30: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/30.jpg)
Encourage clean code
code must be modular: if student A includes features written by student B it is a bonus for both
Q: How do you know who did it first?
A1: trust them
source code is open: envymycar.sf.net
CVS repository
A2: have a look to the commit timestamps
![Page 31: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/31.jpg)
Goals of the course project
Give them a reachable target
Generate cooperation and competition between students
Make them learn some CG
Set the students in a common framework without too much specialized tasks
Do not burden them with non-CG problems
![Page 32: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/32.jpg)
Conclusion
NVMC was used in 2 courses in 2006 and in one course in 2007 (just finished)
The feedback of the 39 students of these courses was very satisfactory (after the usual it's-too-much-work default complaint)
problems can be in the background knowledge of c++ and the bit of Stl they need to know.
![Page 33: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/33.jpg)
Future Work
Implementation is quite poor:
no collision detection
only flat circuits
...other things we can put there having time..
Set up a public NVMC server for students of different campus to show off
![Page 34: ENVyMyCar a Multi-player Car Racing Game for Teaching Computer Graphics Fabio Ganovelli Massimiliano Corsini Visual Computing Lab, ISTI - PISA](https://reader036.vdocuments.site/reader036/viewer/2022062500/56649cc55503460f9498e228/html5/thumbnails/34.jpg)
Thanks!
http://envymycar.sf.net
thanks to:all our students who worked with nvmcRenata Otfinoswka for all the drawings