<AR GAME> Oxygen Poor
- Amelia Zhu
- Jun 16, 2021
- 2 min read
Development and design 2
Set up interactive marine ecology in AR

Part 1 --- AR Foundation Plane Tracking
Learning Reference
- Track a specific flat area
- Run AR program after 'Project setting'
- Learned the role and usage of prefabs in unity
Tutorial
- AR Foundation Plane Tracking
- AR Foundation Plane Tracking - Hiding Tracked Planes
Steps
- First, install the AR plugin---- AR Foundation,AR Kit.
- Add AR Session Origin, AR Session,
Change the label of AR Camera to MainCamera.
- Add Component: AR Plane Manager - Delection Mode.
I choose to only detect the horizontal plane.


Debug
- Need to change Package name, Camera Usage Description, Artichitecture (ARM64) in Player Setting.
Part 2 --- Changing Plane Material
Learning Reference
- Learn to replace Material in Mesh Render, so that the generated plane has the
effect of seabed sand.
Tutorial
- ARFoundation Changing Plane Material
Steps


First find the Mesh Collider in the AR Default Plane, and add the sand texture material I found myself to Materials.
Test

Part 3 --- Multiple Object Placement
Learning Reference
- Learn how to generate multiple models on the tested plane by tapping the
screen.
- Create a script, and then call the spawn object.
- Adjust the position and size of the model.
Tutorial
- AR Foundation Object Placement
- AR Foundation Multiple Object Placement
Steps
- Make 5 water plant models and adjust the size of the models.
- Turn the model into a prefab and compare the scale of the model.
- Add a material shader to the water plant model.
- Create spawn object script.
- Multiple model placement + UI button.


I tried to connect the nodes by myself and made a dynamic shader with aquatic plants swaying, but the dynamic effect was not good.

So I chose to adjust the shader parameters of the existing material.
I made five models as prefabs and placed them in the AR environment to simulate marine ecology.

Create a spawnobject script and set Max Prefab Spawn Count and Placeable Prefab in unity.

I encountered a problem during the test and the model could not be placed on a horizontal surface correctly. So I put the model back into the maya file and re-modified the coordinate origin and size of the model.

Test
The test result was successful !
Kommentarer