Module -5 :
*5.1 Overview of Virtual Reality (VR):
Virtual Reality (VR) is a computer-generated simulation of a three-
dimensional environment that can be interacted with in a seemingly real or
physical way by a person using special electronic equipment, such as a helmet
with a screen inside or gloves fitted with sensors. Here’s an overview of the
key aspects of VR:
Key Components of VR
1. Hardware:
o Headsets (HMDs): These are worn on the head and provide the
visual and auditory experience. Examples include Oculus Rift, HTC
Vive, and PlayStation VR.
o Controllers: Handheld devices that allow users to interact with
the VR environment. They track the position and movement of the
user’s hands.
o Sensors: Track the position and movement of the user’s body and
the VR headset to adjust the VR environment accordingly.
Examples include base stations and inside-out tracking systems.
o Computing Devices: PCs, gaming consoles, or standalone devices
that process the VR experience.
2. Software:
o VR Applications: These include games, simulations, training
programs, and other interactive experiences.
o Development Platforms: Software like Unity and Unreal Engine
used to create VR content.
o APIs and SDKs: Provide the necessary tools and libraries for
developing VR applications.
Types of VR
1. Non-Immersive VR: Simulates a virtual environment but allows for
minimal interaction. It’s often experienced through a computer screen
rather than a VR headset.
2. Semi-Immersive VR: Provides a more immersive experience than non-
immersive VR, often using large screens or multiple projections. It’s
common in flight simulators.
3. Fully Immersive VR: Offers the most immersive experience using
HMDs, sensors, and controllers, creating a fully engaging virtual
environment.
Applications of VR
1. Gaming and Entertainment: The most well-known application,
providing immersive gaming experiences and interactive media.
2. Training and Education: Used for simulations in medical training,
flight simulation, military training, and vocational education.
3. Healthcare: For pain management, therapy, rehabilitation, and surgical
training.
4. Real Estate and Architecture: Allows for virtual tours of buildings and
spaces before they are built.
5. Social Interaction: Virtual meeting spaces and social VR platforms
where users can interact with each other in a virtual environment.
6. Retail and Marketing: Virtual showrooms and immersive marketing
experiences.
7. Tourism: Virtual tours of landmarks and historical sites.
Benefits of VR
1. Immersive Experience: Provides a sense of presence and immersion
that is unmatched by other media.
2. Enhanced Learning: Offers interactive and engaging ways to learn and
train.
3. Remote Interaction: Enables virtual presence and interaction,
reducing the need for physical travel.
4. Safe Environment: Allows for training and simulations in a risk-free
environment.
Challenges and Limitations
1. Technical Limitations: High-quality VR requires significant computing
power and high-resolution displays.
2. Cost: High-end VR systems can be expensive.
3. Health Concerns: Extended use of VR can cause eye strain, motion
sickness, and other health issues.
4. Content Development: Creating high-quality VR content is complex
and time-consuming.
5. User Acceptance: Some users may be hesitant to adopt VR technology.
Future of VR
The future of VR looks promising with advancements in technology making it
more accessible and affordable. Innovations in areas like eye-tracking, haptic
feedback, and wireless systems are expected to enhance the VR experience
further. Additionally, the integration of VR with other technologies like
artificial intelligence and augmented reality will likely lead to new and
exciting applications.
*5.2 Design principles of VR
1. User Comfort and Safety
Minimize Motion Sickness: Avoid sudden movements, keep frame
rates high (90 FPS or above), and ensure smooth transitions to reduce
nausea.
Maintain a Comfortable Field of View (FOV): Use a natural FOV to
prevent discomfort and maintain immersion.
Consider User Physiology: Account for the user’s physical limits; avoid
prolonged use of VR that can cause strain or discomfort.
Provide Clear Boundaries: Use visual or physical boundaries to
prevent users from walking into real-world obstacles.
2. Natural Interaction
Intuitive Controls: Design controls that mimic real-world interactions,
making use of hand tracking and gesture recognition when possible.
Haptic Feedback: Use haptic feedback in controllers to enhance the
sense of touch and interaction within the VR environment.
Consistent Input Methods: Ensure input methods are consistent and
easy to learn across different experiences.
3. Immersive Environment Design
High-Quality Graphics: Use high-resolution textures and detailed
models to create a believable environment.
Realistic Lighting and Shadows: Implement dynamic lighting and
shadows to enhance realism.
Spatial Audio: Use 3D audio to provide spatial awareness and improve
immersion. Sounds should come from their actual source in the virtual
environment.
4. User-Centered Design
Accessibility: Make the experience accessible to a wide range of users,
including those with disabilities.
Customizability: Allow users to adjust settings like movement speed,
comfort options, and audio levels to suit their preferences.
Clear Objectives and Feedback: Provide clear goals and immediate
feedback to guide users through the experience.
Examples of Good VR Design
Tilt Brush by Google: Intuitive painting in a 3D space with natural
controls and immediate visual feedback.
[Link]
Beat Saber: Combines rhythm-based gameplay with simple, responsive
controls and a clear, engaging objective.
[Link]
Job Simulator by Owlchemy Labs: Uses humor and exaggerated
interactions to create a fun, accessible experience with intuitive
controls.
[Link]
*5.3 Example how Meta Verse connect with Unity
Demo 1 : Spheres and cubes – XR Hand Interaction
[Link]
nual/[Link]
1. Install OpenXR, XR Interaction Toolkit, XR Hands, XR plugin management
from Unity Registry
2. Package Manager Toolkit -> XR Interaction Toolkit -> Samples -> Import
Starter Asset and Hands Interaction Demo
4. Switch Build settings to Android
5. Builder Setting -> Player Setting -> XR Plugin Management
6. Enable OpenXR in Android and PC
7. Fix bugs in Project Validation
8. OpenXR -> Check In Hand tracking Subsystem + Meta Hand Tracking Aim
Hand both in PC and Android.
9. In Android covert render mode to single pass/ multi view and for PC
convert it to Multipass
10. Add 3D Object -> Plane + 7 Cubes
11. Create two Materials Ground and Red
12. Load XR Interaction Hands Setup Prefab from Assets/XR Interaction
Toolkit/Hands Interaction
13. Download Meta Quest Link Software
14. Create 3D objects(spheres) and add materials. Add Rigid body component
to the cubes and XR grabable for XR hand interaction.
[Link] cubes fall due to rigid body whereas the spheres don’t.
Demo 2: Zombie shooting
1. Create empty game object and change the icon to diamond
# Edit [Link] script
using UnityEngine;
public class Bullet : MonoBehaviour
{
[SerializeField] private float speed = 5f;
private void Start() => Destroy(gameObject, 10f);
void Update()
{
[Link]([Link]*speed*[Link]);
}
}
# Edit [Link] script
using UnityEngine;
public class Gun : MonoBehaviour
{
[SerializeField] private GameObject _bulletPrefab;
[SerializeField] private Transform _spawnPoint;
public void Fire()
{
GameObject _bullet = Instantiate(_bulletPrefab, _spawnPoint.position,
_spawnPoint.rotation);
Destroy(_bullet, 15f);
}
}
#Edit [Link] Script
using UnityEngine;
using [Link];
public class Zombie : MonoBehaviour
{
[SerializeField] private Transform _target;
[SerializeField] private NavMeshAgent _agent;
[SerializeField] private Animator _animator;
[SerializeField] private bool _isZombieDeath = false;
[SerializeField] private int _bulletHitCount = 0;
private void Awake()
{
_target =[Link]("Player").transform ;
_agent = GetComponent<NavMeshAgent>();
_animator = GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
if (!_isZombieDeath)
{
_agent.SetDestination(_target.position);
//SetDestination
if (_agent.remainingDistance <= _agent.stoppingDistance)
{
if (!_agent.hasPath || _agent.[Link] == 0f)
_animator.SetBool("attack",true);
}
else
_animator.SetBool("attack",false);
}
}
private void OnTriggerEnter(Collider other)
{
if ([Link]("Bullet"))
{
_bulletHitCount++;
Destroy([Link]);
if(_bulletHitCount >= 3)
{
_isZombieDeath = true;
_animator.SetBool("attack",false);
_animator.SetBool("death",true);
}
}
}
}
#Edit ZombieSpawnManager script
using UnityEngine;
public class ZombieSpawnManager : MonoBehaviour
{
[SerializeField] private Transform[] _zombieSpawnPos;
[SerializeField] private GameObject _zombiePrefab;
// Start is called before the first frame update
void Start() => InvokeRepeating(nameof(ZombieSpawn), 1f, 3f);
private void ZombieSpawn()
{
int _index = [Link](0, _zombieSpawnPos.Length);
GameObject _Zombie = Instantiate(_zombiePrefab,
_zombieSpawnPos[_index].position, [Link]);
_Zombie.[Link](transform);
Destroy(_Zombie, 40f);
}
}
#Screenshots below
# Apply same build settings for both android and PC setup from XR Plugin
management
# Add XR Grab Interactable
# Activate the [Link] Script
*5.4 VR Architecture
The architecture of Virtual Reality (VR) systems involves multiple
components working together to create immersive and interactive
experiences. The key elements of VR architecture include hardware,
software, and human interaction components.
1. Hardware Components
VR Headsets: Devices like Oculus Rift, HTC Vive, and PlayStation VR
that provide immersive visual and audio experiences.
Input Devices: Controllers, haptic gloves, and motion trackers that
allow users to interact with the VR environment.
Computing Devices: Powerful computers or gaming consoles that
process VR data and render 3D environments.
Sensors: Devices like cameras and infrared sensors that track user
movements and interactions.
Output Devices: Speakers, headphones, and display screens that
deliver audio-visual output.
2. Software Components
VR Engine: Software like Unity or Unreal Engine that powers the
creation and rendering of VR environments.
Simulation Software: Tools that simulate real-world physics and
behaviors within the VR environment.
Content Creation Tools: Software used for modeling, animating, and
texturing 3D assets (e.g., Blender, Maya).
Middleware: APIs and libraries that provide additional functionalities
such as physics simulation (e.g., NVIDIA PhysX) and haptic feedback.
3. Human Interaction Components
User Interface (UI): Elements that allow users to navigate and interact
with the VR environment, such as menus and dashboards.
Human-Computer Interaction (HCI): Techniques and designs focused
on improving the interaction between users and VR systems, including
gesture recognition and voice command
5.5 Types of VR Headsets
VR headsets can be categorized based on their functionality, hardware
requirements, and use cases. Here are the main types of VR headsets:
1. Tethered VR Headsets
2. Stand-Alone (Wireless) VR Headsets
3. Mobile VR Headsets
4. Mixed Reality (MR) Headsets
1. Tethered VR Headsets
These headsets are connected to a PC or gaming console via cables. They offer
high performance and immersive experiences due to the powerful hardware
they rely on.
Examples:
o Oculus Rift S: Known for its high resolution and accurate tracking
with external sensors.
o HTC Vive: Offers room-scale tracking and high-quality displays,
along with handheld controllers.
o PlayStation VR: Connects to PlayStation consoles and offers an
extensive library of VR games.
2. Stand-Alone (Wireless) VR Headsets
These headsets do not require a connection to a PC or console. They have
built-in processors, batteries, and storage, making them portable and
convenient.
Examples:
o Oculus Quest 2: Features built-in tracking and controllers,
offering a high-quality VR experience without the need for a PC.
o Pico Neo 3: Provides similar features to the Oculus Quest 2, with
standalone capabilities and built-in tracking.
o HTC Vive Focus: Aimed at enterprise use, it offers high-resolution
displays and inside-out tracking.
3. Mobile VR Headsets
These headsets use a smartphone as the display and processing unit. They are
less powerful but more affordable and accessible.
Examples:
o Google Cardboard: A low-cost VR solution that uses a cardboard
viewer and a smartphone.
o Samsung Gear VR: Designed for Samsung smartphones, offering
a more refined experience with a built-in touchpad and sensors.
o Google Daydream View: Supports a range of smartphones with a
comfortable design and a dedicated controller.
4. Mixed Reality (MR) Headsets
These headsets blend VR with augmented reality (AR), allowing users to
interact with virtual objects in the real world.
Examples:
o Microsoft HoloLens: An advanced MR headset that overlays
digital content onto the real world using transparent lenses.
o Magic Leap One: Aimed at developers and enterprise users, it
offers a high-quality MR experience with spatial computing
capabilities.
5.6 VR Controllers and its types/VR Interaction
1. Motion Controllers
Examples: Oculus Touch Controllers, HTC Vive Controllers
2. Handheld Controllers
Examples:
Valve Index Controllers (Knuckles)
Samsung Gear VR Controller
3. Haptic Gloves
Examples: Manus VR Gloves: Designed for enterprise and
development use, providing finger tracking and haptic feedback.
4. Body Tracking Suits
Examples:
Teslasuit: A full-body haptic suit with motion tracking, haptic feedback,
and biometrics for a fully immersive experience.
5. Gesture-Based Controllers
Example:
Leap Motion Controller: Attaches to VR headsets and tracks
hand movements with high precision, allowing for natural
interactions.