未加星标

How to develop augmented reality apps with Vuforia for Windows 10

字体大小 | |
[系统(windows) 所属分类 系统(windows) | 发布者 店小二05 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏

Augmented Reality is a way to connect virtual objects with the real world, making it possible to naturally interact with them by use of mobile devices like phones, tablets or newmixed reality deviceslike HoloLens.

Vuforia is one of the most popular Augmented Reality platforms for developers, and Microsoft partnered with Vuforia to bring their application to the Universal windows Platform (UWP).

Today, we will show you how to create a new Unity project and develop a real AR experience from scratch for devices running Windows 10.


How to develop augmented reality apps with Vuforia for Windows 10

You can download the source for this application here , but I encourage you to follow the steps and build this yourself.

As we’ve noted, augmented reality is the creation of a connection between the real world around you and a virtual world. One of the ways to make this connection is to use real objects like cards or magazines, and then connect them with virtual objects rendered on a digital interface.

What are we going to develop?

This article consists of two parts. In Part 1, we will get you up and running with Vuforia, an augmented reality SDK. This includes creating an account, configuring it and getting the SDK. In Part 2, we will develop an app that detects the front cover of a boating magazine, then render the boat on the front cover in 3D. You can then look around the boat and see it from all different angles.

Part 1: Getting started with Vuforia 6

The first thing we need is an account at https://developer.vuforia.com/ .

This is needed so we can get the free license key as well as a place to upload our markers. A marker can be any image, and is used by Vuforia to connect a real world object with our virtual world. In this article, we will use one marker an image of the font cover of a magazine.

You can download this front cover here :


How to develop augmented reality apps with Vuforia for Windows 10

1) Creating a license

After logging in click Develop, then Add License Key:


How to develop augmented reality apps with Vuforia for Windows 10

This will take you to a form where you can set the details of this license. They can be changed and removed later.

Fill it out like this, using your own application name:


How to develop augmented reality apps with Vuforia for Windows 10

2) Creating our markers

Now that we have a license, we can go ahead and create our markers. All of the markers can be added to a single database. Still in the Develop tab, click Target Manager and Add Database:


How to develop augmented reality apps with Vuforia for Windows 10

Fill out the form that pops up. It is needed to create a database for our markers. This database will be downloaded and added to your app locally on the device itself so select Device as the database type:


How to develop augmented reality apps with Vuforia for Windows 10

Once created, click the MagazineCovers entry in the database list to open it:


How to develop augmented reality apps with Vuforia for Windows 10

Now we are ready to add the targets. In the MagazineCover database view, Click Add Target:


How to develop augmented reality apps with Vuforia for Windows 10

A new form will show, where you will need to select the image you want to use, its width and a name. Select the magazine front cover I provided earlier, set the width to 8.5 and name it cover1. Click Add to upload it and generate a marker:


How to develop augmented reality apps with Vuforia for Windows 10

Once uploaded, you will see it in the database view:


How to develop augmented reality apps with Vuforia for Windows 10

Done! Next, we will create a new Unity project and add the Vuforia SDK to it.

3) Creating a new Unity Project

If you don’t have Unity yet, you can go ahead and download it here: http://unity3d.com/ . A free personal license is available.

Start Unity, and from the project creation wizard, ensure 3D is selected and name the project “MagAR”:


How to develop augmented reality apps with Vuforia for Windows 10

Then click Create project.

4) Downloading the Vuforia SDK

When the project is created, we need to import the Vuforia SDK for Unity package. It can be downloaded from here (take the latest version): https://developer.vuforia.com/downloads/sdk


How to develop augmented reality apps with Vuforia for Windows 10

Once downloaded, you can simply double-click the packaged file to import it to your solution:


How to develop augmented reality apps with Vuforia for Windows 10

Once extracted, a popup like this will show. Click Import to add the Vuforia SDK to your project. Your solution should look something like this:


How to develop augmented reality apps with Vuforia for Windows 10
5) Adding our Marker Database to our project

Now that we have the Vuforia SDK installed, the last thing we need to do is to add the marker database we created earlier to our project.

Go back to the Vuforia Developer portal, and click the Download Database (All) button from your MagazineCover database:


How to develop augmented reality apps with Vuforia for Windows 10

Select the Editor as the development platform and click Download:


How to develop augmented reality apps with Vuforia for Windows 10

Once compiled and downloaded, you can just open the Unity package file to import it to your project:


How to develop augmented reality apps with Vuforia for Windows 10

You can see from the import dialogue that we got the cover marker, as well as the database itself. Click Import and you are all set to start developing!

Your solution should look something like this:


How to develop augmented reality apps with Vuforia for Windows 10
Part 2: Developing the app!

Now that we have the Vuforia SDK installed as well as the markers we need, the fun can begin.

Vuforia comes with a set of drag and drop assets. You can take a look at them in the Vuforia/Prefrabs folder as seen below:


How to develop augmented reality apps with Vuforia for Windows 10

Vuforia uses a special camera called ARCamera, highlighted above, to enable tracking of markers. Every Vuforia project will need this. This special camera has a lot of settings and configuration possibilities (which we’ll take a look at shortly), and will be able to detect real world objects using, in this case, the front cover of a magazine. Vuforia will then place a virtual anchor on the cover so we can get its virtual position and orientation for use in our virtual world.

Another thing we will need is the target itself. This is the prefab named ImageTarget, and it is also configurable. Let’s go ahead with the development.

1) Adding the ARCamera to our scene and configuring it

a) Add camera

From the Vuforia/Prefabs folder, drag and drop the ARCamera prefab into your scene to add it. You can delete the GameObject called Main Camera from the scene since we want to use the ARCamera as our view into the scene instead:

本文系统(windows)相关术语:三级网络技术 计算机三级网络技术 网络技术基础 计算机网络技术

主题: WindowsUnityUW
分页:12
转载请注明
本文标题:How to develop augmented reality apps with Vuforia for Windows 10
本站链接:http://www.codesec.net/view/482268.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(windows) | 评论(0) | 阅读(46)