Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to achieve Egret 3D effect

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "how to achieve Egret 3D effect". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

One: resources

Ⅰ, Egret3D official document: https://developer.egret.com/cn/docs/3d/docs/guide/getting-started-introduction/

Ⅱ, install 3D editor (formerly called paper, now hand in Egret Pro)

Address: http://developer.egret.com/cn/docs/3d/

①, make sure the 3D editor is as follows

②, download and install the paper editor

③, the following icon appears after installation

Two: create a project

Ⅰ: equipped with Egret 5.3.x version library, (this is the latest).

①, the pressurized version library is as follows:

②, open the Egret Launcher software, and switch to install the local version, as follows:

③, drag the extracted version folder (egret-core-5.3.x) into the Egret Launcher workspace, as follows

Ⅱ: open the Egret Pro (Paper) editor

①, create texture (create textures folder)

Important: need to create pictures in windows Explorer, will automatically generate texture-related files. Dragging is not supported yet. This is a bug.

②, create materials (create materials folder)

Name the name my_test.mat.json

Edit the material as follows:

③, create a cube in the default scene with the following attributes:

The structure of ④ and scenes is as follows:

Third, run the result

Generally speaking, having a simple 3 D editor is really much better than Laya. However, there are still many problems to be optimized in Egret Pro software. I believe it will be improved in the near future.

Add--

①, simple script

Export default class Cube extends paper.Behaviour {/ / public constructor () {/ / super (); / / this.onStart (); / /} onStart (): void {let $meshFilter: egret3d.MeshFilter = this.entity.getComponent (egret3d.MeshFilter) as egret3d.MeshFilter; / / $meshFilter.mesh = egret3d.DefaultMeshes.CUBE RES.getResAsync ("Assets/textures/icon.png", (value: egret3d.Texture, key: string): void = > {const $texture: egret3d.Texture = RES.getRes ("Assets/textures/icon.png") as egret3d.Texture; let $meshRender: egret3d.MeshRenderer = this.entity.getComponent (egret3d.MeshRenderer) as egret3d.MeshRenderer; ($meshRender.material as egret3d.Material). SetTexture ("map", $texture) }, this);}}

②, pay attention to the registration script Cube (custom)

③, create a new cube binding custom script Cube

④, run as follows

This is the end of the content of "how to achieve Egret 3D effects". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report