SlideShare a Scribd company logo
Sapienza – University of Rome
MSc in Engineering in Computer Science
Course of Interactive Graphics
R. Falconi – F. Guidi – C. Navarra
Star Wars video game developed in
Three.js and WebGL
2
Summary
1. Environments .............................................................................................................................3
a. Frameworks ............................................................................................................................3
b. Tools.........................................................................................................................................3
2. Models.........................................................................................................................................4
a. Imported models....................................................................................................................4
b. Simple models ........................................................................................................................4
c. Hierarchical models...............................................................................................................4
3. Shadows and lights....................................................................................................................5
a. Shadows...................................................................................................................................5
b. Directional light......................................................................................................................5
c. Lambert material....................................................................................................................6
4. Textures.......................................................................................................................................7
5. Animations..................................................................................................................................7
6. Business logic .............................................................................................................................8
a. Start Screen..............................................................................................................................8
b. Game’s world..........................................................................................................................8
c. World’s population................................................................................................................9
d. Game’s player .....................................................................................................................9
7. User interaction and manual..................................................................................................10
a. How to use this manual ......................................................................................................10
b. User interactions...................................................................................................................10
c. Getting started......................................................................................................................10
d. Play the game....................................................................................................................11
3
1. Environments
a. Frameworks
As environments, it has been used three.js and WebGL.
Three.js is a cross-browser JavaScript library used to create and display animated 3D
computer graphics in a web browser.
Three.js uses WebGL.
WebGL (Web Graphics Library) is a JavaScript API for rendering interactive graphics within
any compatible web browser without the use of plug-ins.
b. Tools
• Brackets coding
Brackets is a modern text editor that makes it easy to design in the browser
• Dropbox file organizations
Dropbox is a modern workspace designed to reduce busywork-so you can focus on
the things that matter
• Microsoft Office documentation
Office is a suite of tools, including word processor, spreadsheet and a presentation
• Skype calls
Skype is a software that provides video chat and voice calls
• GitHub version control
GitHub brings together the world's largest community of developers to discover,
share, and build better software
• LinkedIn and SlideShare sharing
LinkedIn and SlideShare let you manage your professional identity
4
2. Models
a. Imported models
From clara.io we imported a 3D JSON model of the X-Wing, a famous spaceship of the
Star Wars universe.
Figure 1: X-Wing
b. Simple models
We created a simple three.js model to represent rocks, which is a tetrahedron.
Figure 2: a rock made with three.js
c. Hierarchical models
BB-8 droid: a sphere, a semi-sphere and four cylinders.
Figure 3: BB-8 droid hierarchical model without textures on it
5
3. Shadows and lights
a. Shadows
PCFSoftShadowMap filters shadow maps using the Percentage-Closer Soft Shadows (PCSS)
algorithm using renderer.shadowMap.type = THREE.PCFSoftShadowMap.
Figure 4: light and shadow map on the scene
b. Directional light
It is a light that gets emitted in a specific direction. This light will behave as though it is
infinitely far away, and the rays produced from it are all parallel.
The common use case for this is to simulate daylight; the sun is far enough away that its
position can be infinite, and all light rays coming from it are parallel.
6
Figure 5: directional light example. The Sun is so far that its light rays are parallel
c. Lambert material
For the BB-8 model, it has been used the Lambert Material: shading is calculated using
a Gouraud shading model. This calculates shading per vertex and interpolates the results
over the polygon's faces.
It allows to obtain a soft degradation from light points to shadow points.
Figure 6: soft degradation from light points to shadow points
7
4. Textures
In the visual arts, texture is the perceived surface quality of a work of art. It is an element of
two-dimensional and three-dimensional designs and is distinguished by its perceived
visual and physical properties.
Figure 7: head texture
Figure 8: body texture
5. Animations
Animation is a dynamic standard in which images or objects are manipulated to appear as
moving images. Three.js allows the creation of Graphical Processing Unit (GPU)-accelerated
3D animations using the JavaScript language as part of a website without relying on
proprietary browser plugins.
8
Figure 9: BB-8 droid with textures, running and jumping
6. Business logic
a. Start Screen
The start screen is a star field with the model of the X-Wing flying in it. The stars are
generated casually through a loop where the coordinates x and y are assigned randomly,
while the z position matches the iteration variable of the loop. Once the button “Start” is
clicked, the Animation Frame of the start screen is deleted and the game scene is drawn,
where a new Animation Frame is created.
b. Game’s world
The entire world game is a whole and enormous sphere, which rotating gives to the observer
the sensation of moving on it. The sphere is generated with THREE.SphereGeometry, it is
not a real sphere but a geometric solid composed using many triangles and characterized
by some parameters: ray, longitudinal segments, latitudinal segments, phi and theta.
It has been decided not to use many triangles to make the world not perfectly rounded and
spherical, giving the sensation of a non-perfect and more natural surface. Also, because we
are zooming on it, it should be very difficult to make such a big world perfectly spherical,
while BB-8 was easier because of its smallness and distance from camera.
Phi and theta are at their maximum values because the world sphere need to be a complete
world, while these parameters lets a sphere to be not completed (such as a hemisphere).
9
Instead of a monochromatic background that gives the sensation of a flat and less natural
world, it has been applied as background an image with the same style of the world sphere,
giving the sensation to reach it and it lets the users to see a beautiful panorama
(remembering also that Jakku has two Suns!).
c. World’s population
World is populated with rocks. Rocks, as anticipated before, are three.js models which
represent a tetrahedron. They have a collision logic that lets them to be attached to the
world’s surface and let the game ends when the player, moving BB-8, collides on a rock.
Another logic that characterize rocks is the spawn: rocks casually spawn with a random
position on the world’s surface and with a random dimension, making the game more
difficult and less predictable.
d. Game’s player
The game has a player, which is the user interacting with BB-8 droid. BB-8 droid is a
hierarchical model (as described before) and it stands on the same y axis even if it seems to
move forward. BB-8 can move only on the z axis jumping and falling down simulating
world’s gravity and it can move on the x axis, trying to avoid rocks and the consequential
game over.
10
7. User interaction and manual
a. How to use this manual
This software is a challenging video game, addressed to those who want to test their
personal skills. Users can use this easy-to-read and portable manual wherever they want, at
home, in the office, at a remote job site or even in the car (if you’re not driving!). Users can
start reading this manual from “Getting started” section skipping this introduction. This
manual also doesn’t need expertise or knowledge to be used, thanks to its simple language
and its full-provided steps and instructions, also, it doesn’t include high technical language
to help those who don’t have technical background.
b. User interactions
User interaction researches the design and use of computer technology, focused on the
interfaces between people (users) and computers.
In our video game, the user can take the control of BB-8 droid and move it using keyboard’s
arrows; it will be discussed in the next chapter.
Figure 10: a user interacting with computer
c. Getting started
To start the video game, users can either navigate to the GitHub page () or download the
repository. If it’s chosen the second method, users have to open a terminal in the folder
containing all the project and type:
$ python -m http.server
11
To start a simple http server using Python 3.x, or:
$ python -m SimpleHTTPServer
For Python 2.x. Now just go to “localhost:8000” using any browser and the game will start.
Note: you should clear your browser’s caches sometimes, or your browser could not be
supported. If you found any trouble, try to clear your caches and to use Google Chrome or
Safari.
d. Play the game
At this point the software should be running and you should be ready to play it.
In the browser, just click on START button and here you go! The video game will start.
You will impersonate BB-8 droid trying to escape from the imperial army, running for your
life while avoiding rocks jumping (by pressing ↑ arrow) and moving left (← arrow) or
moving right (→ arrow).
12
8. In-game screenshots
Figure 11: main menu
Figure 12: playing the game it is possible to see the game and the user interface
13
Figure 13: end of the game menu, where you can start again a new run

More Related Content

What's hot

CSC103 Gaming Overview (for Everyone)
CSC103 Gaming Overview (for Everyone)CSC103 Gaming Overview (for Everyone)
CSC103 Gaming Overview (for Everyone)
Richard Homa
 
Computer Game Graphics
Computer Game GraphicsComputer Game Graphics
Computer Game Graphics
WildOakForrest
 
Advanced techniques for development of 2D Windows 8 games
Advanced techniques for development of 2D Windows 8 gamesAdvanced techniques for development of 2D Windows 8 games
Advanced techniques for development of 2D Windows 8 games
Microsoft Schweiz
 
Unity 3D game engine seminar
Unity 3D game engine  seminarUnity 3D game engine  seminar
Unity 3D game engine seminar
NikhilThorat15
 
ANIMATION SEQUENCE
ANIMATION SEQUENCEANIMATION SEQUENCE
ANIMATION SEQUENCE
KABILESH RAMAR
 
3D Space Shooting Game
3D Space Shooting Game3D Space Shooting Game
3D Space Shooting Game
Giancarlo Fleuri
 
The Basics of Unity - The Game Engine
The Basics of Unity - The Game EngineThe Basics of Unity - The Game Engine
The Basics of Unity - The Game Engine
OrisysIndia
 
Presentation on Virtual Reality
Presentation on Virtual RealityPresentation on Virtual Reality
Presentation on Virtual Reality
Ahsan Raja
 
Digital graphics (urtak)
Digital graphics (urtak)Digital graphics (urtak)
Digital graphics (urtak)
francocolumbu
 
3D Movie Presentation
3D Movie Presentation3D Movie Presentation
3D Movie Presentation
erAbhinavSinha
 
Animation
AnimationAnimation
Animation
Vasu Mathi
 
Academy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. EnvironmentAcademy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. Environment
Binary Studio
 
Animation
AnimationAnimation
Animation
Purvi Sankhe
 
Unity 3d
Unity 3dUnity 3d
PRESENTATION ON Game Engine
PRESENTATION ON Game EnginePRESENTATION ON Game Engine
PRESENTATION ON Game Engine
Diksha Bhargava
 
Ani mation
Ani mationAni mation
Computer animation
Computer animationComputer animation
Computer animation
shusrusha
 
2d pixel art
2d pixel art2d pixel art
2d pixel art
JohnLongworth
 
Unity 3d Basics
Unity 3d BasicsUnity 3d Basics
Unity 3d Basics
Chaudhry Talha Waseem
 
Computer Game Graphics
Computer Game GraphicsComputer Game Graphics
Computer Game Graphics
WildOakForrest
 

What's hot (20)

CSC103 Gaming Overview (for Everyone)
CSC103 Gaming Overview (for Everyone)CSC103 Gaming Overview (for Everyone)
CSC103 Gaming Overview (for Everyone)
 
Computer Game Graphics
Computer Game GraphicsComputer Game Graphics
Computer Game Graphics
 
Advanced techniques for development of 2D Windows 8 games
Advanced techniques for development of 2D Windows 8 gamesAdvanced techniques for development of 2D Windows 8 games
Advanced techniques for development of 2D Windows 8 games
 
Unity 3D game engine seminar
Unity 3D game engine  seminarUnity 3D game engine  seminar
Unity 3D game engine seminar
 
ANIMATION SEQUENCE
ANIMATION SEQUENCEANIMATION SEQUENCE
ANIMATION SEQUENCE
 
3D Space Shooting Game
3D Space Shooting Game3D Space Shooting Game
3D Space Shooting Game
 
The Basics of Unity - The Game Engine
The Basics of Unity - The Game EngineThe Basics of Unity - The Game Engine
The Basics of Unity - The Game Engine
 
Presentation on Virtual Reality
Presentation on Virtual RealityPresentation on Virtual Reality
Presentation on Virtual Reality
 
Digital graphics (urtak)
Digital graphics (urtak)Digital graphics (urtak)
Digital graphics (urtak)
 
3D Movie Presentation
3D Movie Presentation3D Movie Presentation
3D Movie Presentation
 
Animation
AnimationAnimation
Animation
 
Academy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. EnvironmentAcademy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. Environment
 
Animation
AnimationAnimation
Animation
 
Unity 3d
Unity 3dUnity 3d
Unity 3d
 
PRESENTATION ON Game Engine
PRESENTATION ON Game EnginePRESENTATION ON Game Engine
PRESENTATION ON Game Engine
 
Ani mation
Ani mationAni mation
Ani mation
 
Computer animation
Computer animationComputer animation
Computer animation
 
2d pixel art
2d pixel art2d pixel art
2d pixel art
 
Unity 3d Basics
Unity 3d BasicsUnity 3d Basics
Unity 3d Basics
 
Computer Game Graphics
Computer Game GraphicsComputer Game Graphics
Computer Game Graphics
 

Similar to Bb 8 run - a star wars video game

3D - The Basics
3D - The Basics 3D - The Basics
3D - The Basics
hamza_123456
 
HA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The Basics
HA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The BasicsHA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The Basics
HA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The Basics
hamza_123456
 
HA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The Basics
HA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The BasicsHA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The Basics
HA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The Basics
hamza_123456
 
Lecture1
Lecture1Lecture1
Lecture1
Mobeen Mustafa
 
What is 3 d modeling unit 66
What is 3 d modeling   unit 66What is 3 d modeling   unit 66
What is 3 d modeling unit 66
Richard Marshall
 
3D Technology
3D Technology 3D Technology
3D Technology
Shashiprabha Rathnayake
 
Class[4][19th jun] [three js-camera&light]
Class[4][19th jun] [three js-camera&light]Class[4][19th jun] [three js-camera&light]
Class[4][19th jun] [three js-camera&light]
Saajid Akram
 
Java ME - 08 - Mobile 3D Graphics
Java ME - 08 - Mobile 3D GraphicsJava ME - 08 - Mobile 3D Graphics
Java ME - 08 - Mobile 3D Graphics
Andreas Jakl
 
Task 6
Task 6Task 6
3D modelig presentation (text) 371 SE
3D modelig presentation (text) 371 SE3D modelig presentation (text) 371 SE
3D modelig presentation (text) 371 SE
guest1460e5
 
CUDA by Example : Constant Memory and Events : Notes
CUDA by Example : Constant Memory and Events : NotesCUDA by Example : Constant Memory and Events : Notes
CUDA by Example : Constant Memory and Events : Notes
Subhajit Sahu
 
427lects
427lects427lects
427lects
Praveen Kumar
 
Advanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics APIAdvanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics API
Tomi Aarnio
 
ARENA - Dynamic Run-time Map Generation for Multiplayer Shooters [Full Text]
ARENA - Dynamic Run-time  Map Generation for Multiplayer Shooters [Full Text]ARENA - Dynamic Run-time  Map Generation for Multiplayer Shooters [Full Text]
ARENA - Dynamic Run-time Map Generation for Multiplayer Shooters [Full Text]
Anand Bhojan
 
Ha4 constraints
Ha4   constraintsHa4   constraints
Ha4 constraints
JordanSmith96
 
3 d in games
3 d in games3 d in games
3 d in games
JordanSmith96
 
1604.08848v1
1604.08848v11604.08848v1
1604.08848v1
Markus Höll
 
Introduction to three.js & Leap Motion
Introduction to three.js & Leap MotionIntroduction to three.js & Leap Motion
Introduction to three.js & Leap Motion
Lee Trout
 
Photosynth - a 3d photo experience!
Photosynth - a 3d photo experience!Photosynth - a 3d photo experience!
Photosynth - a 3d photo experience!
hewie
 
Steam presentation deux 3 d prints from photographs
Steam presentation deux  3 d prints from photographsSteam presentation deux  3 d prints from photographs
Steam presentation deux 3 d prints from photographs
Scott Eastellerson
 

Similar to Bb 8 run - a star wars video game (20)

3D - The Basics
3D - The Basics 3D - The Basics
3D - The Basics
 
HA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The Basics
HA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The BasicsHA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The Basics
HA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The Basics
 
HA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The Basics
HA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The BasicsHA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The Basics
HA5 – COMPUTER ARTS BLOG ARTICLE – 3D: The Basics
 
Lecture1
Lecture1Lecture1
Lecture1
 
What is 3 d modeling unit 66
What is 3 d modeling   unit 66What is 3 d modeling   unit 66
What is 3 d modeling unit 66
 
3D Technology
3D Technology 3D Technology
3D Technology
 
Class[4][19th jun] [three js-camera&light]
Class[4][19th jun] [three js-camera&light]Class[4][19th jun] [three js-camera&light]
Class[4][19th jun] [three js-camera&light]
 
Java ME - 08 - Mobile 3D Graphics
Java ME - 08 - Mobile 3D GraphicsJava ME - 08 - Mobile 3D Graphics
Java ME - 08 - Mobile 3D Graphics
 
Task 6
Task 6Task 6
Task 6
 
3D modelig presentation (text) 371 SE
3D modelig presentation (text) 371 SE3D modelig presentation (text) 371 SE
3D modelig presentation (text) 371 SE
 
CUDA by Example : Constant Memory and Events : Notes
CUDA by Example : Constant Memory and Events : NotesCUDA by Example : Constant Memory and Events : Notes
CUDA by Example : Constant Memory and Events : Notes
 
427lects
427lects427lects
427lects
 
Advanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics APIAdvanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics API
 
ARENA - Dynamic Run-time Map Generation for Multiplayer Shooters [Full Text]
ARENA - Dynamic Run-time  Map Generation for Multiplayer Shooters [Full Text]ARENA - Dynamic Run-time  Map Generation for Multiplayer Shooters [Full Text]
ARENA - Dynamic Run-time Map Generation for Multiplayer Shooters [Full Text]
 
Ha4 constraints
Ha4   constraintsHa4   constraints
Ha4 constraints
 
3 d in games
3 d in games3 d in games
3 d in games
 
1604.08848v1
1604.08848v11604.08848v1
1604.08848v1
 
Introduction to three.js & Leap Motion
Introduction to three.js & Leap MotionIntroduction to three.js & Leap Motion
Introduction to three.js & Leap Motion
 
Photosynth - a 3d photo experience!
Photosynth - a 3d photo experience!Photosynth - a 3d photo experience!
Photosynth - a 3d photo experience!
 
Steam presentation deux 3 d prints from photographs
Steam presentation deux  3 d prints from photographsSteam presentation deux  3 d prints from photographs
Steam presentation deux 3 d prints from photographs
 

More from Roberto Falconi

River Trail: A Path to Parallelism in JavaScript
River Trail: A Path to Parallelism in JavaScriptRiver Trail: A Path to Parallelism in JavaScript
River Trail: A Path to Parallelism in JavaScript
Roberto Falconi
 
Biometric Systems - Automate Video Streaming Analysis with Azure and AWS
Biometric Systems - Automate Video Streaming Analysis with Azure and AWSBiometric Systems - Automate Video Streaming Analysis with Azure and AWS
Biometric Systems - Automate Video Streaming Analysis with Azure and AWS
Roberto Falconi
 
Biometric Systems - Automate Video Streaming Analysis with Azure and AWS
Biometric Systems - Automate Video Streaming Analysis with Azure and AWSBiometric Systems - Automate Video Streaming Analysis with Azure and AWS
Biometric Systems - Automate Video Streaming Analysis with Azure and AWS
Roberto Falconi
 
Black-Box attacks against Neural Networks - technical project presentation
Black-Box attacks against Neural Networks - technical project presentationBlack-Box attacks against Neural Networks - technical project presentation
Black-Box attacks against Neural Networks - technical project presentation
Roberto Falconi
 
Black-Box attacks against Neural Networks - technical project report
Black-Box attacks against Neural Networks - technical project reportBlack-Box attacks against Neural Networks - technical project report
Black-Box attacks against Neural Networks - technical project report
Roberto Falconi
 
SUOMI - UCD approach to build an IoT smart guide for spa
SUOMI - UCD approach to build an IoT smart guide for spaSUOMI - UCD approach to build an IoT smart guide for spa
SUOMI - UCD approach to build an IoT smart guide for spa
Roberto Falconi
 
Kalypso: She who hides. Encryption and decryption web app.
Kalypso: She who hides. Encryption and decryption web app.Kalypso: She who hides. Encryption and decryption web app.
Kalypso: She who hides. Encryption and decryption web app.
Roberto Falconi
 
Game ratings predictor
Game ratings predictorGame ratings predictor
Game ratings predictor
Roberto Falconi
 
Malware analysis
Malware analysisMalware analysis
Malware analysis
Roberto Falconi
 
Venice boats classification
Venice boats classificationVenice boats classification
Venice boats classification
Roberto Falconi
 
Visual Analytics: Traffic Collisions in Italy
Visual Analytics: Traffic Collisions in ItalyVisual Analytics: Traffic Collisions in Italy
Visual Analytics: Traffic Collisions in Italy
Roberto Falconi
 
Visual Analytics: Traffic Collisions in Italy
Visual Analytics: Traffic Collisions in ItalyVisual Analytics: Traffic Collisions in Italy
Visual Analytics: Traffic Collisions in Italy
Roberto Falconi
 
SUOMI - Web and mobile app for spa users, using STM32 IoT, Microsoft Azure Cl...
SUOMI - Web and mobile app for spa users, using STM32 IoT, Microsoft Azure Cl...SUOMI - Web and mobile app for spa users, using STM32 IoT, Microsoft Azure Cl...
SUOMI - Web and mobile app for spa users, using STM32 IoT, Microsoft Azure Cl...
Roberto Falconi
 
Game Ratings Predictor - machine learning software to predict video games co...
Game Ratings Predictor  - machine learning software to predict video games co...Game Ratings Predictor  - machine learning software to predict video games co...
Game Ratings Predictor - machine learning software to predict video games co...
Roberto Falconi
 
House Temperature Monitoring using AWS IoT And Raspberry Pi
House Temperature Monitoring using AWS IoT And Raspberry PiHouse Temperature Monitoring using AWS IoT And Raspberry Pi
House Temperature Monitoring using AWS IoT And Raspberry Pi
Roberto Falconi
 

More from Roberto Falconi (15)

River Trail: A Path to Parallelism in JavaScript
River Trail: A Path to Parallelism in JavaScriptRiver Trail: A Path to Parallelism in JavaScript
River Trail: A Path to Parallelism in JavaScript
 
Biometric Systems - Automate Video Streaming Analysis with Azure and AWS
Biometric Systems - Automate Video Streaming Analysis with Azure and AWSBiometric Systems - Automate Video Streaming Analysis with Azure and AWS
Biometric Systems - Automate Video Streaming Analysis with Azure and AWS
 
Biometric Systems - Automate Video Streaming Analysis with Azure and AWS
Biometric Systems - Automate Video Streaming Analysis with Azure and AWSBiometric Systems - Automate Video Streaming Analysis with Azure and AWS
Biometric Systems - Automate Video Streaming Analysis with Azure and AWS
 
Black-Box attacks against Neural Networks - technical project presentation
Black-Box attacks against Neural Networks - technical project presentationBlack-Box attacks against Neural Networks - technical project presentation
Black-Box attacks against Neural Networks - technical project presentation
 
Black-Box attacks against Neural Networks - technical project report
Black-Box attacks against Neural Networks - technical project reportBlack-Box attacks against Neural Networks - technical project report
Black-Box attacks against Neural Networks - technical project report
 
SUOMI - UCD approach to build an IoT smart guide for spa
SUOMI - UCD approach to build an IoT smart guide for spaSUOMI - UCD approach to build an IoT smart guide for spa
SUOMI - UCD approach to build an IoT smart guide for spa
 
Kalypso: She who hides. Encryption and decryption web app.
Kalypso: She who hides. Encryption and decryption web app.Kalypso: She who hides. Encryption and decryption web app.
Kalypso: She who hides. Encryption and decryption web app.
 
Game ratings predictor
Game ratings predictorGame ratings predictor
Game ratings predictor
 
Malware analysis
Malware analysisMalware analysis
Malware analysis
 
Venice boats classification
Venice boats classificationVenice boats classification
Venice boats classification
 
Visual Analytics: Traffic Collisions in Italy
Visual Analytics: Traffic Collisions in ItalyVisual Analytics: Traffic Collisions in Italy
Visual Analytics: Traffic Collisions in Italy
 
Visual Analytics: Traffic Collisions in Italy
Visual Analytics: Traffic Collisions in ItalyVisual Analytics: Traffic Collisions in Italy
Visual Analytics: Traffic Collisions in Italy
 
SUOMI - Web and mobile app for spa users, using STM32 IoT, Microsoft Azure Cl...
SUOMI - Web and mobile app for spa users, using STM32 IoT, Microsoft Azure Cl...SUOMI - Web and mobile app for spa users, using STM32 IoT, Microsoft Azure Cl...
SUOMI - Web and mobile app for spa users, using STM32 IoT, Microsoft Azure Cl...
 
Game Ratings Predictor - machine learning software to predict video games co...
Game Ratings Predictor  - machine learning software to predict video games co...Game Ratings Predictor  - machine learning software to predict video games co...
Game Ratings Predictor - machine learning software to predict video games co...
 
House Temperature Monitoring using AWS IoT And Raspberry Pi
House Temperature Monitoring using AWS IoT And Raspberry PiHouse Temperature Monitoring using AWS IoT And Raspberry Pi
House Temperature Monitoring using AWS IoT And Raspberry Pi
 

Recently uploaded

如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
NishanthaBulumulla1
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 

Recently uploaded (20)

如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 

Bb 8 run - a star wars video game

  • 1. Sapienza – University of Rome MSc in Engineering in Computer Science Course of Interactive Graphics R. Falconi – F. Guidi – C. Navarra Star Wars video game developed in Three.js and WebGL
  • 2. 2 Summary 1. Environments .............................................................................................................................3 a. Frameworks ............................................................................................................................3 b. Tools.........................................................................................................................................3 2. Models.........................................................................................................................................4 a. Imported models....................................................................................................................4 b. Simple models ........................................................................................................................4 c. Hierarchical models...............................................................................................................4 3. Shadows and lights....................................................................................................................5 a. Shadows...................................................................................................................................5 b. Directional light......................................................................................................................5 c. Lambert material....................................................................................................................6 4. Textures.......................................................................................................................................7 5. Animations..................................................................................................................................7 6. Business logic .............................................................................................................................8 a. Start Screen..............................................................................................................................8 b. Game’s world..........................................................................................................................8 c. World’s population................................................................................................................9 d. Game’s player .....................................................................................................................9 7. User interaction and manual..................................................................................................10 a. How to use this manual ......................................................................................................10 b. User interactions...................................................................................................................10 c. Getting started......................................................................................................................10 d. Play the game....................................................................................................................11
  • 3. 3 1. Environments a. Frameworks As environments, it has been used three.js and WebGL. Three.js is a cross-browser JavaScript library used to create and display animated 3D computer graphics in a web browser. Three.js uses WebGL. WebGL (Web Graphics Library) is a JavaScript API for rendering interactive graphics within any compatible web browser without the use of plug-ins. b. Tools • Brackets coding Brackets is a modern text editor that makes it easy to design in the browser • Dropbox file organizations Dropbox is a modern workspace designed to reduce busywork-so you can focus on the things that matter • Microsoft Office documentation Office is a suite of tools, including word processor, spreadsheet and a presentation • Skype calls Skype is a software that provides video chat and voice calls • GitHub version control GitHub brings together the world's largest community of developers to discover, share, and build better software • LinkedIn and SlideShare sharing LinkedIn and SlideShare let you manage your professional identity
  • 4. 4 2. Models a. Imported models From clara.io we imported a 3D JSON model of the X-Wing, a famous spaceship of the Star Wars universe. Figure 1: X-Wing b. Simple models We created a simple three.js model to represent rocks, which is a tetrahedron. Figure 2: a rock made with three.js c. Hierarchical models BB-8 droid: a sphere, a semi-sphere and four cylinders. Figure 3: BB-8 droid hierarchical model without textures on it
  • 5. 5 3. Shadows and lights a. Shadows PCFSoftShadowMap filters shadow maps using the Percentage-Closer Soft Shadows (PCSS) algorithm using renderer.shadowMap.type = THREE.PCFSoftShadowMap. Figure 4: light and shadow map on the scene b. Directional light It is a light that gets emitted in a specific direction. This light will behave as though it is infinitely far away, and the rays produced from it are all parallel. The common use case for this is to simulate daylight; the sun is far enough away that its position can be infinite, and all light rays coming from it are parallel.
  • 6. 6 Figure 5: directional light example. The Sun is so far that its light rays are parallel c. Lambert material For the BB-8 model, it has been used the Lambert Material: shading is calculated using a Gouraud shading model. This calculates shading per vertex and interpolates the results over the polygon's faces. It allows to obtain a soft degradation from light points to shadow points. Figure 6: soft degradation from light points to shadow points
  • 7. 7 4. Textures In the visual arts, texture is the perceived surface quality of a work of art. It is an element of two-dimensional and three-dimensional designs and is distinguished by its perceived visual and physical properties. Figure 7: head texture Figure 8: body texture 5. Animations Animation is a dynamic standard in which images or objects are manipulated to appear as moving images. Three.js allows the creation of Graphical Processing Unit (GPU)-accelerated 3D animations using the JavaScript language as part of a website without relying on proprietary browser plugins.
  • 8. 8 Figure 9: BB-8 droid with textures, running and jumping 6. Business logic a. Start Screen The start screen is a star field with the model of the X-Wing flying in it. The stars are generated casually through a loop where the coordinates x and y are assigned randomly, while the z position matches the iteration variable of the loop. Once the button “Start” is clicked, the Animation Frame of the start screen is deleted and the game scene is drawn, where a new Animation Frame is created. b. Game’s world The entire world game is a whole and enormous sphere, which rotating gives to the observer the sensation of moving on it. The sphere is generated with THREE.SphereGeometry, it is not a real sphere but a geometric solid composed using many triangles and characterized by some parameters: ray, longitudinal segments, latitudinal segments, phi and theta. It has been decided not to use many triangles to make the world not perfectly rounded and spherical, giving the sensation of a non-perfect and more natural surface. Also, because we are zooming on it, it should be very difficult to make such a big world perfectly spherical, while BB-8 was easier because of its smallness and distance from camera. Phi and theta are at their maximum values because the world sphere need to be a complete world, while these parameters lets a sphere to be not completed (such as a hemisphere).
  • 9. 9 Instead of a monochromatic background that gives the sensation of a flat and less natural world, it has been applied as background an image with the same style of the world sphere, giving the sensation to reach it and it lets the users to see a beautiful panorama (remembering also that Jakku has two Suns!). c. World’s population World is populated with rocks. Rocks, as anticipated before, are three.js models which represent a tetrahedron. They have a collision logic that lets them to be attached to the world’s surface and let the game ends when the player, moving BB-8, collides on a rock. Another logic that characterize rocks is the spawn: rocks casually spawn with a random position on the world’s surface and with a random dimension, making the game more difficult and less predictable. d. Game’s player The game has a player, which is the user interacting with BB-8 droid. BB-8 droid is a hierarchical model (as described before) and it stands on the same y axis even if it seems to move forward. BB-8 can move only on the z axis jumping and falling down simulating world’s gravity and it can move on the x axis, trying to avoid rocks and the consequential game over.
  • 10. 10 7. User interaction and manual a. How to use this manual This software is a challenging video game, addressed to those who want to test their personal skills. Users can use this easy-to-read and portable manual wherever they want, at home, in the office, at a remote job site or even in the car (if you’re not driving!). Users can start reading this manual from “Getting started” section skipping this introduction. This manual also doesn’t need expertise or knowledge to be used, thanks to its simple language and its full-provided steps and instructions, also, it doesn’t include high technical language to help those who don’t have technical background. b. User interactions User interaction researches the design and use of computer technology, focused on the interfaces between people (users) and computers. In our video game, the user can take the control of BB-8 droid and move it using keyboard’s arrows; it will be discussed in the next chapter. Figure 10: a user interacting with computer c. Getting started To start the video game, users can either navigate to the GitHub page () or download the repository. If it’s chosen the second method, users have to open a terminal in the folder containing all the project and type: $ python -m http.server
  • 11. 11 To start a simple http server using Python 3.x, or: $ python -m SimpleHTTPServer For Python 2.x. Now just go to “localhost:8000” using any browser and the game will start. Note: you should clear your browser’s caches sometimes, or your browser could not be supported. If you found any trouble, try to clear your caches and to use Google Chrome or Safari. d. Play the game At this point the software should be running and you should be ready to play it. In the browser, just click on START button and here you go! The video game will start. You will impersonate BB-8 droid trying to escape from the imperial army, running for your life while avoiding rocks jumping (by pressing ↑ arrow) and moving left (← arrow) or moving right (→ arrow).
  • 12. 12 8. In-game screenshots Figure 11: main menu Figure 12: playing the game it is possible to see the game and the user interface
  • 13. 13 Figure 13: end of the game menu, where you can start again a new run