Blender Modelling

Blender Modelling
Unity introduction
& Leap Motion Controller
Renato Mainetti
Jacopo Essenziale
Lab 05
Unity 3D Game Engine
Official Unity 3D Tutorials
Interface Overview
Project panel
Inspector panel
Scene View:
qwert ->
Left mouse click = PAN
Right mouse click = Look around like FPS
Alt + Left = Orbit around your looking point
Alt + Right = Zoom
wer = position - rotation - scale
Center-Pivot, Global-Local
Focus to an object: dbl-click in hierarchy or press f
Several display mode (Shaded,wireframe, etc…)
Search scene, fade out all the other objects
Light on, sky and audio preview
Perspective 3D view to Ortho
Game View:
• Active when play button is pressed
• When in play mode every change is not saved
• Paused and stepping forward frame by frame
• Aspect ratio and resolution (to test deploy platforms)
Hierarchy Panel:
• If the parent is the world, RTS relatively to the world
• If it’s child, RTS relatively to it’s parent
• Create button is the mirror of game object – create other
• Search like the one in the hierarchy view
• Search could be filtered by type: t:Light, t:AudioSource
Project Panel:
• Mirror of the Asset folder
• Used to organize all the assets
• New object could be imported(into the folder or by drag
and drop) or created by right click mouse
• Search for assets
• Thumbnail using the zoom slider
• Filter by type, groups, it is also possible to add your own
Inspector Panel:
• Contextual
• Static flag is used for static object in the scene (used to
bake light, evaluate navigation path, etc.)
• Tag (find objects by code)
• Layer (render, collsion, etc.)
• Property specific to the current selected object
(drag, click, reset)
• Lock object properties
Asset store:
Game Object:
• Populate the Unity scene (visible in the hierarchy)
• Game object are made up by several components that could be
added through menu component add, or through the add
component button in the inspector
• Every game object (also an empty) has a transform component
• The game object could be activated/deactivated
• Component could be added to the game object
• Component could also be copied and pasted to another game
• Add a plane
• Add a terrain collider to the plane
• Add a cube
• The default cube already has a box collider attached
• Add a Rigid Body component (Physics)
• Run the scene
Import Blender models into Unity3D:
Blender models could be imported into Unity 3D:
• You can export the model from Blender using the .fbx format
• You can drag the .blend file into the Assets folder (blender required)
Unity uses blender to auto export an fbx.
Two languages could be used as scripting language in
• C# (most used – the preferred ones)
• JS
• Scripts are mainly used to implement the game
• They could also be used to customize the editor or to
create for example PCG.
• A script could be attached to a game object dragging it
over the inspector or using the component add menu
• Two important methods:
• Start() -> called when the object is initialized
• Update() -> called once per frame
• How to move a cube?
Void Update()
transform.Translate(new Vector3(1.0f, 0.0f, 0.0f));
• Two important methods:
• Start() -> called when the object is
• Update() -> called once per frame
• How to move a cube, fps independent way?
Void Update()
transform.Translate(new Vector3(Time.deltaTime, 0.0f, 0.0f));
UI: a simple score viewer:
• To store a game object into the project we could
create a prefab
• To create a prefab simply drag the game object
from the scene view to the asset folder
• The prefab could then be instantiated runtime or
added again to the scene
Leap Motion Controller
An Hand Tracking Device
• It allow us to track the position of the user hand in
real-time, pretty much like kinect do with our body.
• It’s specialized in hand tracking, we can get the
position of each bone of our fingers!
• It’s very fast! (up to 300 fps, consider that kinect 2
RGB camera works at 30fps).
• It’s simple (both in design and ease of use).
• It’s cheap! You can get one for 70€!
Inside the leap
• 3 Infrared (IR) leds
• 2 IR wide angle cameras
Thanks to the wide angle lenses of
the camera the leap motion is able
to monitor an imaginary interaction
box of 60 w x 60 h x 60 d cm.
How does it work?
Leds light up the scene with IR light (outside human visible
spectrum), both cameras capture the image.
The intersection of the binocular cameras field of view
creates a shape of an inverted pyramid which defines our
interaction area
The real magic happen here…
• Hardware just send simple raw images to Leap
Motion runtime service through the USB cable
• Images are processed using CV algorithms to
reconstruct 3d position of what the camera sees.
• Techniques are pretty similar to the ones seen last
time in MOCAP: we got two images, we try to
detect the same point in both of them and then we
triangulate to detect position.
• Software also tries to infer occluded objects
• Some filtering is used to guarantee data coherence
between frames.
SDK + Unity Assets
• Leap Motion provides an easy to use SDK to access
controller data within your applications
• Supported languages:
• C++
• C#
• Objective C
• Java
• Python
• JavaScript
• Some useful assets for game engines are also
provided, we’ll have a look at them in a moment!
• Supported game engines:
• Unity
• Unreal Engine
• Requirements:
• Leap motion runtime installed
• Unity project created, Leap .unitypackage imported
• DEMO#1 our goal:
• Let’s build our first leap controller, we want to detect the
position of the tip of one finger and move a cube in a
Unity scene with it.
• Keep in mind:
Gestures Recognition
• 4 basic gestures in leap motion, divided in two
• Discrete:
• ScreenTapGesture
• KeyTapGesture
• Continuos:
• CircleGesture
• SwipeGesture
Let’s see a couple examples…
Leap Motion Unity Assets
Leap Motion SDK also contain a unity package with a
lot of ready to use stuff we can integrate in our
games without bothering about writing our own
• Hand Controllers
• Hand Models
• Grasping utilities
• ....
Let’s make our own little game without writing any leap related
Something about the user
• We should not forget that the emotional part
makes a game/story fascinating
• We are going to create a little game with a very
simple mechanic.
• The player impersonate an assembly line workman
• He should grab bad pieces leaving on the line the
good ones.
• A surveillance camera is active…someone is
watching us…
Leap motion and VR
• Leap motion can also be used vertically and
mounted on an Head Mounted Display (HMD) such
as the Oculus Rift
• Orion SDK (now in BETA)
are thought with VR in
• You can try this
combination for your
final project in the lab!
Future of leap motion
• Interaction engine
• Android VR, embedding the
leap motion in visors
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF