上传需要识别的图片或者物体
首先进入Vuforia AR官网注册一个号,随后选择Develop创建一一把Key,创建好后如下图。








创建好后我们可以看到有些是能用有些事不能用的

关于识别Cuboid和Cylinder类型的我们创建出后点进创建好的物体需要给其贴图才能使用

3D Object的识别
这个的话就需要下载一个扫描三维物体的工具了。





随后再把这个文件传输到高通官网上就行了。这样我们需要识别的图片或者物体创建出来后我们可以选择需要的导出成(.unitypackage)文件就行了。


识别图片或者物体
需要识别的图片或者物体上传后我们下载Vuforia AR 的SDK

导入SDK到U3D中,随后我们找到这几个预制物一个AR摄像机,另一个是你想识别物体的类型,例如我们想识别图片那我们就将ImageTarget和Ar摄像机放入Hierarchy中。

然后我们选择摄像机找到Vuforia Behaviou脚本点击进入Open Vuforia configuration,然后操作如下

然后选择ImageTarget设置参数。

这样我们就能识别图片或者3D物体了

下面给AR添加阴影,将下面的Shader材质赋给Plane.
Shader "FX/Matte Shadow" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
}
SubShader {
Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
LOD 200
Blend Zero SrcColor
CGPROGRAM
#pragma surface surf ShadowOnly alphatest:_Cutoff
fixed4 _Color;
struct Input {
float2 uv_MainTex;
};
inline fixed4 LightingShadowOnly (SurfaceOutput s, fixed3 lightDir, fixed atten)
{
fixed4 c;
c.rgb = s.Albedo*atten;
c.a = s.Alpha;
return c;
}
void surf (Input IN, inout SurfaceOutput o)
{
fixed4 c = _Color;
o.Albedo = c.rgb;
o.Alpha = 1;
}
ENDCG
}
Fallback "Transparent/Cutout/VertexLit"
}
网友评论
https://developer.vuforia.com/forum/object-recognition/upload-ob-file-why-rating-na