2

In the third phase of the HMS Core Online Codelabs Challenge, developers generate a 3D modeling application demo by learning and using the 3D modeling service developed by HMS Core, and then use the demo to complete the modeling of a real object around them. In the submitted works, the editor found that the original shoes, street scenes, figures, and toys can all be modeled in 3D! What else can you think of? After reading the following works, you may be inspired.

1.1 3D Modeling Figures, Shoes, Street View Series (with zero-based complete implementation tutorial)

Posts: [HMS Core Challenge Phase 3] 3D Modeling Technology Application - [Figures] [Shoes] [Street View Series] - Complete Implementation Tutorial with Zero Basics*-Huawei Developer Forum (huawei.com)

3D modeling applications:

·Work "Family Portrait" display:

(The figures above, street view seats, fire hydrants and other models are all made with HMS Core 3D modeling service )


GIF demo

· implementation process:

HUAWEI HMS Core integration preparation

3D Modeling Service HMS Core Official Guide

3D modeling service Codelabs

3D modeling service practical lesson video

1.2 3D modeling doll

Work Post: [HMS Core Challenge Phase 3] 3D Modeling Living Room Toys-Huawei Developer Forum (huawei.com)

At the HDC Developers Conference in 2021, I tried Codelabs live and experienced many innovative features that Huawei has opened up for developers. Later, I found out that codelabs is doing 3D modeling challenges online. I was very interested and decided to start learning.

According to the activity requirements, I summarize the following steps:

1. Android Studio runs the sample project and installs it on the phone

After first downloading the sample project, it was opened and run successfully with Android Studio, but the message "Data Processing Location not set" was displayed when uploading to the mobile phone. Therefore, please refer to Hms Core official account reply: "Before developing an application, you need to configure relevant information in AppGallery Connect" ( https://developer.huawei.com/consumer/cn/doc/development/graphics-Guides/config- agc-0000001142925473?ha_source=hms1 )

According to the official website document: first register the developer, create the application, generate the signature certificate fingerprint, configure the signature certificate fingerprint, open related services, set the default data processing location, and set the data retention period. Then modify the example project: update the package in AndroidManifest.xml, update the applicaionId in the application-level build.gradle, then rename the relevant folder of the example project (set to the same as the created application ID), recompile, and then run it on the phone. Upload and download models now.

2. Use the app to shoot 3D objects and generate 3D models online

All beginnings are hard! When I first started shooting with my mobile phone, I encountered difficulties: because there was no stable turntable tool, I shot a dozen times with my hands (holding the mobile phone and turning around the object), and the result indicated that the modeling failed, or the built model was unsightly. :

Change makes it pass, change makes it stagnate. The process of uploading--online modeling--downloading the model each time takes about 5~10 minutes, so I looked at the description of the activity and found that the volume of the modeled object should be larger than 15 x 15 x 15cm. I decided to re-select the appropriate object and try again. . At the same time, I thought that the rotating office chair is not a natural turntable? It's too late, it's too late, so I stood up quickly, put a box on the chair to raise the bottom, use a whiteboard as the bottom and a white wall as the back on the top, just pieced together a "stage", and fixed the shooting position of the mobile phone. The hand-cranked office chair rotation mode starts to work.

The effect of is obviously much better. With the increase of shooting times, I have gradually mastered some key points:

  • Each time you fix a camera angle to shoot a circle, the rotation speed should be uniform.
  • The maximum number of shots and uploads is 200. In order to make these pictures effective, press pause after each shot, adjust the new shooting angle and then continue.
  • The modeling effect of transparent and translucent objects is not good, and it is easy to blur.
  • Before shooting at each angle, it is best to fine-tune the lighting position to make the shooting effect better.
  • If there is an occlusion structure inside the object, it is difficult to completely photograph it, and it needs to be avoided as much as possible.
  • When shooting the bottom, you need to put the object sideways (leak out of the bottom). At this time, you must pay attention that the object placed on the side cannot be deformed (there will be ghosting). If there is no guarantee that there will be no deformation, it is best to find a way to fix its shape.

Later, I also bought an electric turntable, and the filming rate increased rapidly;

[](https://oscimg.oschina.net/oscnet/up-d04e1b0556964dce3b6384894c5ce86f243.gif)

3. Export the 3D model file and run it on the phone

The last step is to run the generated model on the mobile phone. The exported model has two formats, obj and gltf, which are supported by mainstream 3D applications. Just find a 3D interface or a 3D engine to access it.

I chose Unity (faster), created a new blank project, created a background hdr, placed a table in the middle, added a table texture, adjusted the camera angle, and added a light source. Then put all the files exported by the model obj into the project, drag them in one by one, and place them on the desktop. In order to add some dynamic effects, I also added automatic rotation components to each model, and finally completed the family portrait of the work:

For 3D modeling services, please go to the official website:
https://developer.huawei.com/consumer/cn/hms/huawei-3d-modeling?ha_source=hms1
Service Demo DEMO:
https://github.com/HMS-Core/hms-3d-modeling-demo?ha_source=hms1
Refer to the development guidance document to quickly complete basic data reporting:
Android SDK Integration Documentation
https://developer.huawei.com/consumer/cn/doc/development/graphics-Guides/introduction-0000001143077297?ha_source=hms1

(released with developer authorization)

Learn more >>

Visit Huawei Developer Alliance official website
Get development guidance document
Huawei Mobile Services Open Source Warehouse Address: GitHub , Gitee

us and know the latest technical information of HMS Core for the first time~


HarmonyOS_SDK
596 声望11.7k 粉丝

HarmonyOS SDK通过将HarmonyOS系统级能力对外开放,支撑开发者高效打造更纯净、更智能、更精致、更易用的鸿蒙原生应用,和开发者共同成长。