SlideShare a Scribd company logo
1 of 13
Download to read offline
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 GraphicsWildOakForrest
 
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 gamesMicrosoft Schweiz
 
Unity 3D game engine seminar
Unity 3D game engine  seminarUnity 3D game engine  seminar
Unity 3D game engine seminarNikhilThorat15
 
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 EngineOrisysIndia
 
Presentation on Virtual Reality
Presentation on Virtual RealityPresentation on Virtual Reality
Presentation on Virtual RealityAhsan Raja
 
Digital graphics (urtak)
Digital graphics (urtak)Digital graphics (urtak)
Digital graphics (urtak)francocolumbu
 
Academy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. EnvironmentAcademy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. EnvironmentBinary Studio
 
PRESENTATION ON Game Engine
PRESENTATION ON Game EnginePRESENTATION ON Game Engine
PRESENTATION ON Game EngineDiksha Bhargava
 
Computer animation
Computer animationComputer animation
Computer animationshusrusha
 
Computer Game Graphics
Computer Game GraphicsComputer Game Graphics
Computer Game GraphicsWildOakForrest
 

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

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 Basicshamza_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 Basicshamza_123456
 
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 66Richard Marshall
 
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 GraphicsAndreas Jakl
 
3D modelig presentation (text) 371 SE
3D modelig presentation (text) 371 SE3D modelig presentation (text) 371 SE
3D modelig presentation (text) 371 SEguest1460e5
 
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 : NotesSubhajit Sahu
 
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 APITomi 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
 
Introduction to three.js & Leap Motion
Introduction to three.js & Leap MotionIntroduction to three.js & Leap Motion
Introduction to three.js & Leap MotionLee 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 photographsScott 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 JavaScriptRoberto 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 AWSRoberto 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 AWSRoberto 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 presentationRoberto 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 reportRoberto 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 spaRoberto 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
 
Venice boats classification
Venice boats classificationVenice boats classification
Venice boats classificationRoberto Falconi
 
Visual Analytics: Traffic Collisions in Italy
Visual Analytics: Traffic Collisions in ItalyVisual Analytics: Traffic Collisions in Italy
Visual Analytics: Traffic Collisions in ItalyRoberto Falconi
 
Visual Analytics: Traffic Collisions in Italy
Visual Analytics: Traffic Collisions in ItalyVisual Analytics: Traffic Collisions in Italy
Visual Analytics: Traffic Collisions in ItalyRoberto 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 PiRoberto 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

WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!WSO2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2
 
WSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million PeopleWSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million PeopleWSO2
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2
 
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...WSO2
 

Recently uploaded (20)

WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid Environments
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
 
WSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million PeopleWSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million People
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
 

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