EasyAR 3D Object Tracking¶
Introduction¶
3D Tracking is aiming to detect and track 3D objects in natural scenes.
EasyAR now detect and track objects with rich textures. Our tracking method enables you to use only the 3D model of the object to setup trackers without any other complex configurations or registration steps beforehand. Also, there is no need to upload your model file or any other data to EasyAR or other websites.
How to Get an OBJ format Model¶
Export from existing models
Use modeling tools like 3Ds Max or Maya, and some other tools to import existing FBX or other models and export to OBJ format.
Make new models from scratch
Use modeling tools like 3Ds Max or Maya to build some 3D models, and export to OBJ format.
Scan real world objects using and generate 3D models using some 3D reconstruction tools
Use tools like ReMake to generate models and import into modeling tools, export to OBJ format.Optionally refine model using modeling tools like 3Ds Max or Maya.
Preparation¶
First step to use 3D Tracking is, of course, preparing the 3D model of your target object. The 3D model should be in Wavefront OBJ format and should be shipped with the corresponding material file and at least one texture map file in JPEG or PNG format. For more details about the model format, you can go to 3D Model Specification session for further reading. Bellows are some examples and counterexamples for a quick start.
The model should have rich textures.
The first one can be detected and tracked by EasyAR. EasyAR do not detect or track the second one because there is little texture.
The model can have different shapes.
These two objects can all be detected and tracked by EasyAR.
The model file should not refer an absolute path.
The second model cannot be loaded into tracker because EasyAR cannot find the file in absolute path.
The filename and path in model file should not have spaces.
The model file should use UTF-8 encoding.
Positive orientation of face normal is defined in the right-hand rule.
The shaded face of the second cubic have negative orientation and will be considered as invisible by EasyAR. If you look from the inner side, you will see something like the third cubic. Any negative oriented faces should be avoided.
Setup¶
After the 3D model of your target object has been prepared, you can use it like using images for image tracking in EasyAR.
Continue with EasyAR Sense Samples¶
You can reference HelloARObjectTracking sample for different platforms.
Also, you may want to reference HelloAR and HelloARTarget samples for different target usages. Although those samples use ImageTarget, you can easily change targets to ObjectTarget.
Here are introductions for how to use those samples for different platforms.
Continue with EasyAR Sense Packages¶
You would need a Pro edition of EasyAR 2.0 or later.
Here are introductions for how to use the EasyAR Sense packages for different platforms.
API Reference¶
Unity Plugin Reference¶
3D Model Specification¶
Supported file format¶
Wavefront obj (.obj)
Minimal requirements of the model file¶
At least an OBJ file (.obj) with its MTL material file (.mtl) and the corresponding texture map is needed, and arrange in the same category.
Texture map file can be in .jpg or .png format.
The filename and path in model file should not have spaces.
The model file should use UTF-8 encoding.
Minimal requirements of OBJ (.obj) file¶
Geometric vertex, formatted by (x, y, z [, w]) coordinates. w is optional and defaults to 1.0. Vertex colors are not required, and will be ignored if there exists any after x y and z.
Texture coordinates, formatted by (u, v [,w]) coordinates. w is optional and defaults to 0. Normally u and v should vary between 0 and 1, while values less than 0 or larger than 1 will be supported as REPEAT mode, which means the integer part of the coordinate will be ignored and a repeating pattern is formed. (i.e. same as GL_REPEAT in OpenGL)
Face elements, list of both vertex and texture indices, are required. Polygons such as quadrilaterals having more than three vertices are supported.
Referencing materials are required, and at least one external MTL material file should be referenced within the OBJ file. Absolute path of the material file is forbid, and a relative path is preferred.
Tag specifies the material name for the elements following it is required. The material name should match a named material definition in the referencing external MTL file.
Minimal requirements of MTL (.mtl) file¶
At least one material is defined within the MTL file.
Texture maps are required. Most of the case, the ambient texture map and/or the diffuse texture map should be specified. Absolute path of the texture map is forbid, and a relative path is preferred.
Option parameters of texture map statements will be ignored.