如何为 Vuforia/Unity 创建 AR 标记? [英] How do I create an AR marker for Vuforia / Unity?
问题描述
这是我知道的一个可怕的基本问题(!)但是我如何创建 AR 标记并将其导入 Unity?我知道我打算通过 Vuforia 标记管理器页面来完成.我已经创建了一个目标数据库并下载了该数据库,但是如何让标记在 Unity 中显示?
This is a horribly basic question I know (!) but how do I create and import an AR marker into Unity? I know I am meant to do it through the Vuforia Marker Manager page. I have created a Target Database and I have downloaded the database, but how do I get the marker to display in Unity?
另外:目标数据库到底是什么?这是标记"的另一个名称吗?
Also: what exactly is a Target Database? Is that another name for 'marker'?
推荐答案
要具体回答您的问题,是的,您的标记就是您的目标.
To answer your question specifically, yes your Marker is your Target.
所以你需要做的是:
转到许可证管理器.
添加许可证密钥
选择 None 作为您的许可证计划.
Go to License Manager.
Add a License Key
choosing None as your License plan.
现在转到目标管理器.创建一个 Database
并从下拉列表中为其添加许可证.
Now go to Target Manager. Create a Database
and add the license for it from the drop down.
添加目标,然后从您的计算机中选择要作为标记的图像,然后上传.
Add Target, and select from your computer the Image that you want to be the Marker, and upload it.
一旦目标状态更改为活动,您可以单击下载数据库并确保单击 For UnityEditor.这会下载一个 .unitypackage
Once the status of the Target changes to active you can click Download Database and make sure you click For UnityEditor. This downloads a .unitypackage
现在在 Unity 中,转到 Assets
>Import New Assets...
并找到您下载的 .unitypackage
Now inside Unity, go to Assets
>Import New Assets...
and locate to the .unitypackage
you downloaded
这就是您导入数据库的方式.
This is how you import your database.
如果你还没有导入 Vuforia 包 Unity Extension 那么你只需从下载部分下载并导入通过Assets
>Import Package
> Custom Package
If you haven't Imported the Vuforia package Unity Extension then you simply need to download it from the Downloads section and Import it through the
Assets
>Import Package
>Custom Package
现在理想情况下,要使用 AR,您可以使用
AR 相机
,它位于Qualcomm Augmented Reality
中的Assets
栏中代码>><代码>预制件代码>.将ARCamera
拖到您的场景中.Now ideally to work with AR, you would use the
AR Camera
, which is located in yourAssets
Bar inQualcomm Augmented Reality
>Prefabs
. DragARCamera
onto your scene.在
Hierarchy
中选择AR Camera
后,查看Inspector
选项卡.您将看到数据集加载行为
.在它下面你应该看到你导入的.unitypakage
的名称.检查名称并使其Active
.With the
AR Camera
selected in theHierarchy
look at theInspector
tab. You'll seeData Set Load Behavior
. Under that you SHOULD see the name of the.unitypakage
you imported ealier. Check the name as well as make itActive
.现在在
Qualcomm Augmented Reality
>Prefabs
中,您还应该看到Image Target
.也将其拖到屏幕上.Now in
Qualcomm Augmented Reality
>Prefabs
you should also seeImage Target
. Drag that onto the screen as well.在
Hierarchy
中选择ImageTarget
查看Inspector
应该有Image Target Behaviour
With the
ImageTarget
selected inHierarchy
look at theInspector
there should beImage Target Behaviour
如下填写
Type: Predefined Data Set: <Name of imported .unitypackage> Image Target: <Name of Picture uploaded into the Database>
现在您可以根据您的应用要求处理图像目标.
Now you may work around the Image Target as per your app requirement.
注意:在许可证管理器中,单击许可证名称并你会看到一个字母数字代码.复制该代码,并在
AR Camera
的Inspector,在QCAR Behaviour>App License Key
下粘贴代码.必须这样做才能让您的应用在您的 > 设备上运行.NOTE: In the License Manager, click on the Name of the License and you'll see a Alpha-numeric code. Copy that code, and within the Inspector of the
AR Camera
, underQCAR Behaviour>App License Key
paste the code in. This must be done in order for your app to work on your > device.希望对你有帮助.请随时问我是否有任何问题.
Hope this helps you. Please feel free to ask me if anything.
这篇关于如何为 Vuforia/Unity 创建 AR 标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!