hi in this video we'll be going over an
introduction to virtual reality and
using a frame so first what is virtual
reality virtual reality is a believable
interactive 3d computer-generated
environment that mimics interacting with
a physical environment so unlike other
computer created environments virtual
reality places the user inside of an
experience instead of viewing a
two-dimensional screen in front of them
users are immersed in a 3d world that
they can interact with virtual reality
has been around for some time but
recently this technology has been made
more affordable and accessible to a
larger number of people VR is now
accessible with smartphones so anyone
who has access to this piece of
technology can actually experience
virtual reality aside from being a cool
piece of technology there are actually a
lot of practical applications ways that
VR is used in different industries when
pilots are first learning to fly they
will often start in a flight simulator
so this is a small pot that looks and
feels like the inside of a real plane in
this simulator a pilot can practice
dealing with stressful situations like
bad weather or engine failure and this
prepares them to stay safe when they
encounter these issues in real life in a
similar vein virtual reality can also be
used to train medical professionals so
doctors can practice treating patients
in a VR world where no patient's life is
at stake and if they make a mistake
nobody dies this is great for training
because people can be exposed to these
high-stress situations without any
real-world consequences like the death
of a patient or a plane crash
so those are some awesome applications
of VR today we'll be getting started
with our own VR programs using a frame a
frame is a web framework for building
virtual reality experiences it runs a
JavaScript library for graphics and it's
based on HTML so this makes it really
easy to get started all you really need
is a
plain HTML file a frame uses the
structure of HTML to create 3d elements
in a vr world so here's the code behind
the red sphere in my BR world you can
see that my code is using the structure
of HTML with opening tags and closing
tags now let's talk about using a frame
so when you're in an A Frame world you
can navigate around using the keys W a s
and D to walk around and you can look
around and change your perspective by
grabbing the screen with the mouse let's
actually take a look so this is the code
HS editor where you'll be viewing and
writing your own a frame world's we'll
talk more about different parts of the
editor in a little bit but right now
let's just talk about viewing and moving
around in our a frame world so if you
click this green Run code button you
will render your a frame worlds you can
see and move around your a frame world
in this little viewer but if we actually
want to get a better experience we can
click the see HTML in new window and
this is going to open up a tab so we can
see our world in the full screen now I
can grab the screen to change my
perspective so just rotate up and down I
can also use the W key to walk forward I
can use the S key to walk backwards I
can use the a key to walk left and I can
walk click D to walk right and that's
how you move around in your a frame
world it's important when using a frame
to have an understanding of the 3d
coordinate system since this is how we
know where to place and look for objects
you're probably familiar with the 2d
plane which uses the coordinates x and y
on a flat surface in 3d we had a third
dimension that comes out of the surface
with the coordinate Z
so if you need help remembering the
positive direction of each dimension you
can use the first three fingers on your
right hand to remember so you want to
make an L with your index finger and
thumb and then you want your middle
finger to point out towards you so then
the positive x-direction is to the right
where your thumb is pointing your index
finger is pointing in the positive
y-direction so up and then your middle
finger is pointing in the positive z
direction so actually out of the screen
and towards you it's especially
important to know this because the users
viewpoint in the 3d world is determined
by the location of the camera so by
default the camera is set at the center
of the world at 0 0 0 and it's facing
the negative Z direction so it's facing
into the screen this is important to
note because if we play something in the
positive z area it's not going to be in
our view because it's going to be behind
our camera so that's a general overview
of a frame now let's get started
actually looking at some VR worlds