Please enable JavaScript to use CodeHS

Introduction to Virtual Reality

Virtual Reality is a rapidly growing technology with applications in several different fields. In this short course, students will learn how to build their very own virtual reality worlds using HTML and the A-Frame JavaScript library. Students can view their VR creations on the computer, through phones, or through an Oculus Rift. Get ready to be blown away by what you create!


Units: 7
Contact Hours: 20

By the Numbers

Contact Hours 20
Lessons 21
Videos 24
Exercises 46
Challenges 8
Offline Handouts 6


Unit Description
Getting Started: This unit introduces students to virtual reality and the A-Frame library. Students will create their first virtual reality world!
Advanced Shapes: In this unit, students are introduced to boxes, cones, and cylinders. Students will also learn where to find out more information about the shapes that A-Frame provides.
Animation: In this unit, students will learn how to add animations to the objects in their VR worlds. They will learn how to program shapes to move, change color, rotate, and disappear.
Interaction: In this unit students will learn how to add interactions so that viewers can interact with objects in virtual reality.
360˚ Images: In this unit, students will learn to work with 360˚ images and videos in their VR worlds. Students will learn the steps to add an image from a 360˚ camera, as well as an image or video sourced online. Students will create their own worlds using 360˚ images, and will gain practice citing their sources when using images captured by others.
Next Steps: This unit discusses next steps students can take to further explore virtual reality development with a A-Frame. Topics include viewing your creation in a VR device, using the A-Frame documentation and inspector to keep learning, as well as links to more tutorials and training.
Final Project: In this unit, students will combine the skills they've learned to brainstorm and create their own virtual reality final project.


Click on a demo to test it out.

The Great Pyramids

Light Speed Ahead!

Bouncing Balls


Here are a few examples of teacher resources and materials to use in the Introduction to Virtual Reality course


The entirely web-based curriculum is made up of a series of learning modules that cover the basics of creating virtual reality worlds in A-Frame. Classes can complete the entire mini-course, or individual lessons in the form of playlists. Each lesson should take a single one-hour class period. Every lesson is made up of short video tutorials, example programs, quizzes, programming exercises, challenge problems, and unit tests. Students write and run programs in the browser using the CodeHS editor.

Programming Environment: Students write and run virtual reality programs in the browser using the CodeHS editor. They will use Mozilla’s A-Frame library to build VR experiences in HTML. These experiences will be hosted on the CodeHS website so that they can keep a running portfolio of their creative projects, and easily share their programs with the world.

Who is it for?

This course is meant to be a first time introduction to virtual reality, and does not require students to come in with any programming experience.

This course involves some challenging content with 3D coordinates, so it is more suitable for high school students who have had geometry. Middle school students can complete the earlier playlists, and should continue on to the full course if they feel comfortable.

This mini-course can be taught as a standalone course or alongside one of our other computer science courses.