Luckily, the program does everything automatically. All you need to do is:
1. Add the motion tracking function. In the left panel in the "Scene" block, activate the "Add Object" function. Find the "Face tracker" item in the menu and click "Insert". You will see how the coordinate axes appear in the center of the face. Now the program tracks all human movements in the frame.
2. on the face, right-click the faceTracker0 object in the Scene panel and select Add, then Face Mesh. As a result, the program will automatically select the face in the frame and make a checkerboard mask out of peru number data it. At this stage, you can stretch the mask by dragging the axis arrows, as well as change some parameters in the Inspector panel (for example, uncheck the Eyes or Mouth parameter so that the mask completely covers the eyes or mouth, respectively).
You can see how it looks by clicking “Test on Device” and “Send” next to Facebook Camera or Instagram Camera in Spark AR. When the mask is uploaded to the server, you will receive a notification and you will see yourself in “chess reality” in the corresponding application. But you won’t stop there, will you?
3. Select the material. Go to the faceMesh0 option in the Scene block. In the Inspector panel, there is a Materials item, which we talked about in the second lesson. Select the Create New Material item so that material0 appears in the Assets panel. Click on it and try changing the settings in the Inspector panel. For example, change the Color.
In this workspace you will see other options – various textures (i.e. images that cover objects), 3D models and scripts. There are a lot of options, so it makes sense to try them out yourself. For example, the “Shader Type” option affects how the mask will look. By default, the “Standard” option is set, which is suitable for realistic simulation of a 3D effect. You can choose “Blended” – to mix textures and colors, “Flat” (then the object will not react to lighting), “Retouching” – to retouch the face, “Face Paint” – to paint on the skin.
4. Change the texture. You can upload any image by clicking on “Choose File From Computer” next to “Texture” in the same settings. The image will automatically stretch to the entire mask. The main thing is that it looks good with the shader type you have chosen. You already know how to check this in the application.
5. Publish your mask. To do this, go back to the last paragraph of the second lesson.
Display the mask on the face. To display the mask
-
- Posts: 265
- Joined: Tue Jan 07, 2025 4:46 am