Unity basis: AR (Augmented Reality) learning

Copyright notice:

  • This article Original starting in the following website:
  1. Blog Park "excellent dream maker culture" in space: https: //www.cnblogs.com/raymondking123
  2. Excellent dream maker culture official blog: https: //91make.top
  3. Excellent game dream maker culture lecture: https: //91make.ke.qq.com
  4. "Excellent dream maker culture" of micro-channel public number: umaketop
  • You are free to reprint, but must include the full copyright notice!

WITH

  • AR applications
    • // input scanning and video presentation is an image
    • Scanning and 3d show
  • AR Equipment:
    - Scan: mobile phone camera
    - show: mobile phone screen
  • MR equipment:
    -hololens
    • Scan: Glasses
    • Show: the holographic projection on glasses
  • AR software SDK:
    -voforia
    -FasyAr
    -HiAr // we learn

  • unity in a special folder
    -Editor of unity menu to expand
    -Resource resources dynamically loaded
    all the ins -Plugins
    -StreamingAssets downloaded from a network resource

  • upload image
  • Packaged into Atlas (HIAR completion)
  • Atlas (unity package) After downloading the package
  • The atlas as a plug-Import unity
  • You can also create empty directly on the site of application, in order to obtain Appkey and Secret, and use the plug-in built-in picture resources, location in Assets \ Editor \ HiAR \ ImageIargetTexures \ Sample (ctrl + o need to preview files in the directory, unity can not directly preview)

  • Import SDK
  • Creating HiARCamera
  • FIG ImageTarget // add identification preform
  • Set Image Target in Image Target Atlas Behaviour use the Target Group, and we need to identify the set of images Image Target
  • After identifying the objects we add to the performance in the Image Target

  • When the image is identified, it dynamically adjusted according to the position of Image Target angle and position of the display image, this time as the position of the child node corresponding to the position also changes accordingly, to achieve the effect of AR

  • Add Animation Add Video player and other things in the Image Target can play display

  • Multi FIG identification:
  • In checking MultiTarget HI AR Engine Behaviour and you can specify up recognizable imageTarget
  • Then select the image to be identified and forms you can create multiple ImageTarget

  • Dynamic loading:
  • Use TargetDynamic components
  • Identify an external load (local or network file download)
  • Use AddTmageTarget in TargetDynamic assembly () dynamically loaded image resource
  • Such as:
void OnGUI()
{
if (GUI.Button(new Rect(30, 30, 200, 80), "Add Key"))
{
AddTmageTarget(System.IO.path.Combine(Application.streamingAssetsPath, "HiAR/sample"), "e58931", 854, 480);
}
}
  • Then dynamically loaded image can be recognized as a pattern recognition, then after the operation of the real-time identification OnDynamicReco callbacks (provided that a new child node TargetDynamic cube assembly can move along) // TargetDynamic itself an Image Target

  • // set the center point of the taget fixed to one position, so that the downward direction of gravity always
  • Select Image Target Behaviour in Center pointer, which may become the center ImageTarget, perpendicular to gravity, in the unity would not be identified as the moving picture, in some scenarios used in applications requiring physical (e.g., ball bounce Landing , video player, etc.)

  • Tu Tu music:
  • Add a scene we want to show (a fish fish) in ImageTarget, designated ImageTarget identified Pictures
  • Add in the fish HiAR / HiARPaint (set shader), add Hi AR Paint script and specify the current Material for the Fish material // This step is equivalent to a child painting as part of a shader, and then as the fish of meterial

  • the shader is drawn on the image portion attached to the model as a texture

Guess you like

Origin www.cnblogs.com/raymondking123/p/11531729.html