WO2023092950A1 - Material processing method and apparatus for virtual scenario, and electronic device, storage medium and computer program product - Google Patents

Material processing method and apparatus for virtual scenario, and electronic device, storage medium and computer program product Download PDF

Info

Publication number
WO2023092950A1
WO2023092950A1 PCT/CN2022/091009 CN2022091009W WO2023092950A1 WO 2023092950 A1 WO2023092950 A1 WO 2023092950A1 CN 2022091009 W CN2022091009 W CN 2022091009W WO 2023092950 A1 WO2023092950 A1 WO 2023092950A1
Authority
WO
WIPO (PCT)
Prior art keywords
entity
material image
target
virtual
texture
Prior art date
Application number
PCT/CN2022/091009
Other languages
French (fr)
Chinese (zh)
Inventor
郑聪瑶
卞荣辉
Original Assignee
上海商汤智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Publication of WO2023092950A1 publication Critical patent/WO2023092950A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts

Definitions

  • the first virtual physical entity generated based on the first material image is not bound to the first texture entity, the first virtual physical entity can be used together with the first texture entity, or the first virtual physical entity can be used alone , or, the first virtual physical entity can be used together with other texture entities other than the first texture entity, or, the first texture entity can be used together with other virtual physical entities other than the first virtual physical entity, so as to improve the flexibility in the use of material.
  • the method further includes:
  • a first virtual physical entity corresponding to the first material image is generated.
  • the extracting the contour information of the first material image includes:
  • the first material image can be accurately extracted. Outline information of the material image.
  • the extracting the contour information of the first material image includes:
  • the first acquisition part is configured to acquire the first material image of the user-defined virtual scene
  • the extraction part is configured to extract the outline information of the first material image based on the material generation code input by the user;
  • the device further includes:
  • the target entity includes any of the following:
  • the apparatus further includes: a second adding part configured to add custom material in the virtual scene based on the initialization code input by the user and the target entity.
  • the device further includes:
  • the device further includes:
  • the determination part is configured to determine the status information of the custom material presented in the virtual scene through the physics engine.
  • the generating part is configured as:
  • the extraction part is configured as:
  • a computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented.
  • Fig. 3 shows a schematic diagram of a texture entity in a material processing method for a virtual scene provided by an embodiment of the present disclosure.
  • the computer processing device 300 generates a code based on the material input by the user, and extracts the contour information of the first material image; based on the contour information, generates a first virtual physical entity corresponding to the first material image; and/or, based on the contour information and the first material image , to generate the first texture entity corresponding to the first material image.
  • the generation of materials is completed through user programming, and the way of material generation is closely integrated with programming teaching content, so that the absorption of programming knowledge can be promoted through the process of material generation.
  • step S11 a first material image of a user-defined virtual scene is acquired.
  • the extracting the contour information of the first material image includes: in response to the first material image not being scalable vector graphics (Scalable Vector Graphics, SVG), extracting the Vertex information of the first material image; extracting contour information of the first material image based on the vertex information.
  • the information of some or all vertices of the first material image may be extracted.
  • the vertex information may include the coordinates of the vertex and the like.
  • the first virtual physical entity may have first identification information, and the first identification information may be used to uniquely identify the first virtual physical entity;
  • the first texture entity may have second identification information, and the second identification information may be used to uniquely identify the first virtual physical entity.
  • a texture entity may be used to uniquely identify the first virtual physical entity.
  • the identification information of the first virtual physical entity is first identification information
  • the identification information of the first texture entity is second identification information.
  • the material adding code includes the first identification information
  • the first virtual physical entity may be acquired according to the first identification information.
  • the target entity includes a target virtual physical entity
  • the target virtual physical entity is the first virtual physical entity.
  • the material adding code includes first identification information and second identification information
  • the first virtual physical entity may be obtained according to the first identification information
  • the first texture entity may be obtained according to the second identification information.
  • the target entity includes a target virtual physical entity and a target texture entity
  • the target virtual physical entity is the first virtual physical entity
  • the target texture entity is the first texture entity.
  • the target entity includes any of the following: the first virtual physical entity and the first texture entity; the first virtual physical entity; the first virtual physical entity and the first texture entity Two texture entities, wherein the second texture entity is generated based on the second material image; a second virtual physical entity and the first texture entity, wherein the second virtual physical entity is generated based on the third material image.
  • the second material image is different from the first material image
  • the third material image is different from the first material image.
  • the second material image and the third material image may be the same or different.
  • the second texture entity is different from the first texture entity, and the second virtual physical entity is different from the first virtual physical entity.
  • the initialization code includes an initialization size
  • adding a custom material in the virtual scene based on the initialization code input by the user and the target entity includes: responding to the initialization size and the target entity
  • the size of the target entity is different, the size of the target entity is adjusted to the initial size, and then added to the virtual scene.
  • the size of the custom material can be flexibly set.
  • the coordinates of the i-th vertex a i of the target entity can be recorded as ( xi ,y i ), where 1 ⁇ i ⁇ n. Since the reference coordinate systems of the virtual physical entity and the textured entity are different, in order to paste the target textured entity on the surface of the target virtual physical entity, it is necessary to align the target textured entity with the target virtual physical entity.
  • the minimum x coordinate x min of the target entity can be obtained; by traversing the y coordinates of all vertices in the set A, the minimum y coordinate y min of the target entity can be obtained.
  • the coordinates of the upper left corner of the target entity can be recorded as (x min , y min ).
  • the contour information of any target entity includes contour information of at least two convex polygons, a similar method may be used to calculate each convex polygon separately.
  • the rotation interface and position interface can be packaged according to the physics engine and/or the rendering engine.
  • the rotation interface can be named rotate and the position interface can be named position.
  • the interaction mode of the custom material can be flexibly set based on the interaction mode code input by the user, so as to solve the problem that the material in the virtual scene cannot interact or the interaction mode is fixed.
  • the setting of the interactive mode of the custom material in the virtual scene is completed through user programming, and the setting method of the interactive mode of the custom material is closely integrated with the programming teaching content, so that programming can be promoted through the setting process of the interactive mode of the custom material knowledge absorption.
  • the method for processing materials of a virtual scene provided by the embodiments of the present disclosure can be applied to application scenarios such as programming education, educational games, educational basic platforms, and virtual scenes.
  • the material processing method of the virtual scene provided by the embodiment of the present disclosure can be applied to the webpage (World Wide Web, Web) end, and can also be applied to the personal computer (Personal Computer, PC) end software or mobile end software, etc., which is not limited here. .
  • the attributes of the first virtual physical entity may include outline attributes, and the attribute values of the outline attributes of the first virtual physical entity may include coordinates of vertices of the first virtual physical entity.
  • the attributes of the first texture entity may include outline attributes and image attributes, the attribute value of the outline attribute of the first texture entity may include the coordinates of each vertex of the first texture entity, and the attribute value of the image attribute of the first texture entity is the first material image.
  • the target entity may be acquired based on identification information in the material addition code in response to the material addition code input by the user. For example, in the case that the material adding code includes first identification information and second identification information, the first virtual physical entity may be obtained according to the first identification information, and the first texture entity may be obtained according to the second identification information.
  • Example 3 Using the virtual scene material processing method provided by the embodiment of the present disclosure, the homework completed by the students can be converted into new course preset content. For example, students S 1 , S 2 and S 3 respectively use codes to create three different virtual scenes, and all three copies of codes can be converted into teaching scenes for teachers. There is no need to package and migrate the entire project, just use the code directly.
  • Example 4 The teacher needs to create interactive teaching content, and students are expected to write algorithms spontaneously according to the content. They can use the virtual scene material processing method provided by the disclosed embodiment to create virtual scenes and dynamic levels that meet the requirements, and open some interfaces and control resources. For students, inspire students to write algorithms to complete the teaching levels.
  • the present disclosure also provides a material processing device for a virtual scene, electronic equipment, a computer-readable storage medium, and a computer program product, all of which can be used to implement any material processing method for a virtual scene provided in the present disclosure, corresponding technical solutions and The technical effects can be found in the corresponding records in the method section.
  • the device further includes:
  • the second acquiring part is configured to add a code based on the material input by the user to acquire a target entity, wherein the target entity includes at least a target virtual physical entity;
  • the initialization information in the initialization code includes an initialization size and an initialization position; the second adding part is configured to include a target virtual physical entity and a target texture entity when the target entity includes Next, based on the initialization size, adjust the size of the target virtual physical entity and the target texture entity to obtain a size-transformed target virtual physical entity and a size-transformed target texture entity; based on the initialization position, align all The size-transformed target virtual physical entity and the size-transformed target texture entity; the aligned size-transformed target virtual physical entity and the size-transformed target texture entity are added to the virtual scene.
  • the device further includes:
  • the virtual scene material processing method provided by the embodiment of the present disclosure can reduce the cost of virtual scene production.
  • An embodiment of the present disclosure also provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium, or may be a volatile computer-readable storage medium.
  • An embodiment of the present disclosure also proposes a computer program, including computer readable codes.
  • a processor in the electronic device executes the above method.
  • the multimedia component 808 includes a screen providing an output interface between the electronic device 800 and the user.
  • the screen may include a liquid crystal display (Liquid Crystal Display, LCD) and a touch panel (Touch Panel, TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or slide action, but also detect duration and pressure associated with the touch or slide operation.
  • the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.
  • the communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices.
  • the electronic device 800 can access wireless networks based on communication standards, such as wireless networks (Wi-Fi), second generation mobile communication technology (The 2nd Generation Mobile Communication Technology, 2G), third generation mobile communication technology (The 3rd Generation Mobile Communication Technology, 3G), the fourth generation mobile communication technology (The 4th Generation Mobile Communication Technology, 4G), the long-term evolution of general mobile communication technology (Long Term Evolution, LTE), the fifth generation mobile communication technology (The 5th Generation Mobile Communication Technology, 5G) or their combination.
  • the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it may be connected to an external computer (for example, using Internet Service Provider to connect via the Internet).
  • LAN Local Area Network
  • WAN Wide Area Network
  • Internet Service Provider for example, using Internet Service Provider to connect via the Internet.
  • FPGA field programmable gate arrays
  • PLA Programmable Logic Array
  • the computer program product can be realized by hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) and the like.

Abstract

Provided in the embodiments of the present disclosure are a material processing method and apparatus for a virtual scenario, and an electronic device, a storage medium and a computer program product. The method comprises: acquiring a first material image of a virtual scenario which is self-defined by a user; on the basis of a material generation code that is input by the user, extracting contour information of the first material image; on the basis of the contour information, generating a first virtual physical entity corresponding to the first material image; and/or on the basis of the contour information and the first material image, generating a first map entity corresponding to the first material image.

Description

虚拟场景的素材处理方法及装置、电子设备、存储介质和计算机程序产品Material processing method and device for virtual scene, electronic device, storage medium and computer program product
相关申请的交叉引用Cross References to Related Applications
本公开基于申请号为202111393782.6、申请日为2021年11月23日、发明名称为“虚拟场景的素材处理方法及装置、电子设备和存储介质”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。This disclosure is based on the Chinese patent application with the application number 202111393782.6, the filing date is November 23, 2021, and the title of the invention is "Virtual scene material processing method and device, electronic equipment and storage medium", and requires the Chinese patent application Priority, the entire content of the Chinese patent application is hereby incorporated by reference into this disclosure.
技术领域technical field
本公开涉及但不限于计算机技术领域,尤其涉及一种虚拟场景的素材处理方法及装置、电子设备、存储介质和计算机程序产品。The present disclosure relates to but not limited to the field of computer technology, and in particular relates to a material processing method and device for virtual scenes, electronic equipment, storage media and computer program products.
背景技术Background technique
编程教育是一个重度依赖于电子设备的教学领域,其离不开建造多样的虚拟场景作为教学工具,丰富教学内容。虚拟场景逐渐成为编程教育中打破限制的利器,虽然教与学都存在于机房,但无限制的虚拟世界为学生和老师提供了充满想象力的新可能。Programming education is a teaching field that relies heavily on electronic equipment, and it is inseparable from the construction of various virtual scenes as teaching tools to enrich teaching content. The virtual scene has gradually become a powerful tool to break the limitations in programming education. Although teaching and learning exist in the computer room, the unlimited virtual world provides students and teachers with new possibilities full of imagination.
然而,虚拟场景的建设往往需要特定的美术、技术支持,从设计到完成一个虚拟场景需要不容小觑的成本投入。However, the construction of a virtual scene often requires specific art and technical support, and the cost investment from design to completion of a virtual scene cannot be underestimated.
发明内容Contents of the invention
本公开实施例提供了一种虚拟场景的素材处理方法及装置、电子设备、存储介质和计算机程序产品。Embodiments of the present disclosure provide a material processing method and device for a virtual scene, an electronic device, a storage medium, and a computer program product.
根据本公开实施例的一方面,提供了一种虚拟场景的素材处理方法,包括:According to an aspect of an embodiment of the present disclosure, a material processing method for a virtual scene is provided, including:
获取用户自定义的虚拟场景的第一素材图像;Acquiring the first material image of the user-defined virtual scene;
基于所述用户输入的素材生成代码,提取所述第一素材图像的轮廓信息;extracting contour information of the first material image based on the material generation code input by the user;
基于所述轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体;和/或,基于所述轮廓信息和所述第一素材图像,生成所述第一素材图像对应的第一贴图实体。Based on the outline information, generate a first virtual physical entity corresponding to the first material image; and/or, based on the outline information and the first material image, generate a first texture corresponding to the first material image entity.
通过获取用户自定义的虚拟场景的第一素材图像,基于所述用户输入的素材生成代码,提取所述第一素材图像的轮廓信息,基于所述轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体,和/或,基于所述轮廓信息和所述第一素材图像,生成所述第一素材图像对应的第一贴图实体,由此通过用户编程的方式完成素材的生成,素材生成的方式与编程教学内容紧密结合,从而能够通过素材生成过程促进编程知识的吸收。另外,通过生成用户自定义的第一素材图像对应的第一虚拟物理实体和/或第一贴图实体,能够基于一个素材图像获得能够独立使用的虚拟物理实体和/或贴图实体,从而能够提高在虚拟场景中使用素材的灵活性。与相关技术中采用“设计-美术-技术”的流程制作虚拟场景的素材的方式相比,本公开实施例提供的虚拟场景的素材处理方法能够降低虚拟场景制作成本。By acquiring the first material image of the user-defined virtual scene, based on the material generation code input by the user, extracting the outline information of the first material image, and based on the outline information, generating a corresponding image of the first material image The first virtual physical entity, and/or, based on the outline information and the first material image, generate a first texture entity corresponding to the first material image, thereby completing the generation of the material through user programming, and the material The generation method is closely combined with the programming teaching content, so that the absorption of programming knowledge can be promoted through the material generation process. In addition, by generating the first virtual physical entity and/or the first texture entity corresponding to the user-defined first material image, a virtual physical entity and/or texture entity that can be used independently can be obtained based on a material image, thereby improving Flexibility in using material in virtual sets. Compared with the method in the related art that adopts the process of "design-art-technology" to produce virtual scene materials, the virtual scene material processing method provided by the embodiment of the present disclosure can reduce the cost of virtual scene production.
在一种可能的实现方式中,在所述生成所述第一素材图像对应的第一虚拟物理实体和所述生成所述第一素材图像对应的第一贴图实体之后,所述方法还包括:In a possible implementation manner, after generating the first virtual physical entity corresponding to the first material image and the generating the first texture entity corresponding to the first material image, the method further includes:
基于所述用户输入的素材添加代码,获取目标实体,其中,所述目标实体至少包括目标虚拟物理实体;Adding a code based on the material input by the user to obtain a target entity, wherein the target entity includes at least a target virtual physical entity;
基于所述目标实体,在所述虚拟场景中添加自定义素材。Based on the target entity, add custom material in the virtual scene.
在该实现方式中,基于所述用户输入的素材添加代码,获取目标实体,并基于所述目标实体,在所述虚拟场景中添加自定义素材,由此通过用户编程的方式在虚拟场景中完成素材 的添加,素材添加的方式与编程教学内容紧密结合,从而能够通过素材添加过程促进编程知识的吸收。In this implementation, the code is added based on the material input by the user to obtain the target entity, and based on the target entity, a custom material is added to the virtual scene, thereby completing the process in the virtual scene through user programming. The addition of materials and the way of adding materials are closely integrated with the programming teaching content, so that the absorption of programming knowledge can be promoted through the process of adding materials.
在一种可能的实现方式中,所述目标实体包括以下任意一项:In a possible implementation manner, the target entity includes any of the following:
所述第一虚拟物理实体和所述第一贴图实体;the first virtual physical entity and the first texture entity;
所述第一虚拟物理实体;said first virtual physical entity;
所述第一虚拟物理实体和第二贴图实体,其中,所述第二贴图实体基于第二素材图像生成;The first virtual physical entity and the second texture entity, wherein the second texture entity is generated based on a second material image;
第二虚拟物理实体和所述第一贴图实体,其中,所述第二虚拟物理实体基于第三素材图像生成。The second virtual physical entity and the first texture entity, wherein the second virtual physical entity is generated based on a third material image.
根据该实现方式,基于第一素材图像生成的第一虚拟物理实体与第一贴图实体不绑定,第一虚拟物理实体可以与第一贴图实体一起使用,或者,第一虚拟物理实体可以单独使用,或者,第一虚拟物理实体可以与第一贴图实体以外的其他贴图实体一起使用,或者,第一贴图实体可以与第一虚拟物理实体以外的其他虚拟物理实体一起使用,从而能够提高在虚拟场景中使用素材的灵活性。According to this implementation, the first virtual physical entity generated based on the first material image is not bound to the first texture entity, the first virtual physical entity can be used together with the first texture entity, or the first virtual physical entity can be used alone , or, the first virtual physical entity can be used together with other texture entities other than the first texture entity, or, the first texture entity can be used together with other virtual physical entities other than the first virtual physical entity, so as to improve the flexibility in the use of material.
在一种可能的实现方式中,所述在所述生成所述第一素材图像对应的第一虚拟物理实体和所述生成所述第一素材图像对应的第一贴图实体之后,所述方法还包括:In a possible implementation manner, after the generating the first virtual physical entity corresponding to the first material image and the generating the first texture entity corresponding to the first material image, the method further include:
基于所述用户输入的初始化代码和所述目标实体,在所述虚拟场景中添加自定义素材。Adding custom materials in the virtual scene based on the initialization code input by the user and the target entity.
在该实现方式中,基于所述用户输入的初始化代码和所述目标实体,在所述虚拟场景中添加自定义素材,由此通过用户编程的方式完成虚拟场景中自定义素材的初始化,自定义素材的初始化方式与编程教学内容紧密结合,从而能够通过自定义素材的初始化过程促进编程知识的吸收。In this implementation, based on the initialization code input by the user and the target entity, a custom material is added to the virtual scene, thereby completing the initialization of the custom material in the virtual scene through user programming, and customizing The initialization method of the material is closely combined with the programming teaching content, so that the absorption of programming knowledge can be promoted through the initialization process of the custom material.
在一种可能的实现方式中,所述初始化代码中的初始化信息包括初始化尺寸和初始化位置;所述基于所述用户输入的初始化代码和所述目标实体,在所述虚拟场景中添加自定义素材,包括:在所述目标实体包括目标虚拟物理实体和目标贴图实体的情况下,基于所述初始化尺寸,调整所述目标虚拟物理实体和所述目标贴图实体的尺寸,得到尺寸变换后的目标虚拟物理实体和尺寸变换后的目标贴图实体;基于所述初始化位置,对齐所述尺寸变换后的目标虚拟物理实体和所述尺寸变换后的目标贴图实体;将对齐后的所述尺寸变换后的目标虚拟物理实体和所述尺寸变换后的目标贴图实体,添加在所述虚拟场景中。In a possible implementation manner, the initialization information in the initialization code includes an initialization size and an initialization position; and adding a custom material in the virtual scene based on the initialization code input by the user and the target entity , including: when the target entity includes a target virtual physical entity and a target texture entity, based on the initial size, adjusting the size of the target virtual physical entity and the target texture entity to obtain a size-transformed target virtual The physical entity and the size-transformed target texture entity; based on the initial position, align the size-transformed target virtual physical entity and the size-transformed target texture entity; align the size-transformed target The virtual physical entity and the target texture entity after size transformation are added in the virtual scene.
根据该实现方式,能够通过用户编程的方式完成虚拟场景中自定义素材的尺寸和位置的初始化,自定义素材的尺寸和位置的初始化方式与编程教学内容紧密结合,从而能够通过自定义素材的初始化过程促进编程知识的吸收,并且能够对齐目标虚拟物理实体和目标贴图实体,进而能够将对齐后的目标虚拟物理实体和目标贴图实体添加在所述虚拟场景中。According to this implementation method, the initialization of the size and position of the custom material in the virtual scene can be completed through user programming. The process promotes the absorption of programming knowledge, and can align the target virtual physical entity and the target texture entity, and then add the aligned target virtual physical entity and target texture entity in the virtual scene.
在一种可能的实现方式中,在所述虚拟场景中添加自定义素材之后,所述方法还包括:In a possible implementation manner, after adding custom materials in the virtual scene, the method further includes:
基于所述用户输入的交互方式代码,设置所述自定义素材的交互方式。Based on the interaction mode code input by the user, the interaction mode of the custom material is set.
在该实现方式中,能够基于用户输入的交互方式代码灵活地设置自定义素材的交互方式,从而能够解决虚拟场景中素材不能交互或交互方式固化的问题。In this implementation, the interaction mode of the custom material can be flexibly set based on the interaction mode code input by the user, thereby solving the problem that the material in the virtual scene cannot be interacted with or the interactive mode is fixed.
在一种可能的实现方式中,在所述虚拟场景中添加自定义素材之后,所述方法还包括:In a possible implementation manner, after adding custom materials in the virtual scene, the method further includes:
通过物理引擎,确定所述自定义素材在所述虚拟场景中呈现的状态信息。The state information of the custom material presented in the virtual scene is determined through a physics engine.
根据该实现方式,通过物理引擎确定自定义素材在所述虚拟场景中呈现的状态信息,由此在虚拟场景中添加自定义素材之后,能够即时确定自定义素材的物理效果,使自定义素材遵从物理原则运动,用户不需要对虚拟场景中的不同素材进行碰撞处理,无需设定动作规则,从而能够提高虚拟场景设定的便捷性。According to this implementation, the physical engine determines the status information of the custom material presented in the virtual scene, so that after the custom material is added to the virtual scene, the physical effect of the custom material can be determined immediately, so that the custom material complies with The physical principle of movement, the user does not need to collide with different materials in the virtual scene, and does not need to set action rules, which can improve the convenience of virtual scene setting.
在一种可能的实现方式中,所述基于所述轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体,包括:In a possible implementation manner, the generating the first virtual physical entity corresponding to the first material image based on the outline information includes:
在所述轮廓信息包括曲线段的情况下,将所述曲线段调整为线段,得到调整后的轮廓信息;When the contour information includes a curve segment, adjusting the curve segment to a line segment to obtain adjusted contour information;
基于所述调整后的轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体。Based on the adjusted outline information, a first virtual physical entity corresponding to the first material image is generated.
在该实现方式中,通过在所述轮廓信息包括曲线段的情况下,将所述曲线段调整为线段,得到调整后的轮廓信息,并基于所述调整后的轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体,由此能够降低碰撞计算的复杂度。In this implementation manner, when the contour information includes a curve segment, the curve segment is adjusted to a line segment to obtain adjusted contour information, and the first contour information is generated based on the adjusted contour information. The first virtual physical entity corresponding to the material image can reduce the complexity of collision calculation.
在一种可能的实现方式中,所述提取所述第一素材图像的轮廓信息,包括:In a possible implementation manner, the extracting the contour information of the first material image includes:
响应于所述第一素材图像不为可缩放的矢量图形SVG,提取所述第一素材图像的顶点信息;Extracting vertex information of the first material image in response to the fact that the first material image is not a scalable vector graphics SVG;
基于所述顶点信息,提取所述第一素材图像的轮廓信息。Based on the vertex information, outline information of the first material image is extracted.
在该实现方式中,通过响应于第一素材图像不为SVG,提取第一素材图像的顶点信息,并基于所述顶点信息,提取第一素材图像的轮廓信息,由此能够准确地提取第一素材图像的轮廓信息。In this implementation, by extracting the vertex information of the first material image in response to the fact that the first material image is not SVG, and extracting the outline information of the first material image based on the vertex information, the first material image can be accurately extracted. Outline information of the material image.
在一种可能的实现方式中,所述提取所述第一素材图像的轮廓信息,包括:In a possible implementation manner, the extracting the contour information of the first material image includes:
响应于所述第一素材图像为SVG,提取所述第一素材图像的路径信息;Extracting path information of the first material image in response to the first material image being SVG;
基于所述路径信息,确定所述第一素材图像的轮廓信息。Based on the path information, contour information of the first material image is determined.
基于该实现方式,在第一素材图像为SVG的情况下,能够快速、准确地提取第一素材图像的轮廓信息。Based on this implementation manner, when the first material image is an SVG, the outline information of the first material image can be extracted quickly and accurately.
根据本公开实施例的一方面,提供了一种虚拟场景的素材处理装置,包括:According to an aspect of an embodiment of the present disclosure, a virtual scene material processing device is provided, including:
第一获取部分,被配置为获取用户自定义的虚拟场景的第一素材图像;The first acquisition part is configured to acquire the first material image of the user-defined virtual scene;
提取部分,被配置为基于所述用户输入的素材生成代码,提取所述第一素材图像的轮廓信息;The extraction part is configured to extract the outline information of the first material image based on the material generation code input by the user;
生成部分,被配置为基于所述轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体;和/或,基于所述轮廓信息和所述第一素材图像,生成所述第一素材图像对应的第一贴图实体。The generating part is configured to generate a first virtual physical entity corresponding to the first material image based on the outline information; and/or generate the first material based on the outline information and the first material image The first texture entity corresponding to the image.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
第二获取部分,被配置为基于所述用户输入的素材添加代码,获取目标实体,其中,所述目标实体至少包括目标虚拟物理实体;The second acquiring part is configured to add a code based on the material input by the user to acquire a target entity, wherein the target entity includes at least a target virtual physical entity;
第一添加部分,被配置为基于所述目标实体,在所述虚拟场景中添加自定义素材。The first adding part is configured to add custom material in the virtual scene based on the target entity.
在一种可能的实现方式中,所述目标实体包括以下任意一项:In a possible implementation manner, the target entity includes any of the following:
所述第一虚拟物理实体和所述第一贴图实体;the first virtual physical entity and the first texture entity;
所述第一虚拟物理实体;said first virtual physical entity;
所述第一虚拟物理实体和第二贴图实体,其中,所述第二贴图实体基于第二素材图像生成;The first virtual physical entity and the second texture entity, wherein the second texture entity is generated based on a second material image;
第二虚拟物理实体和所述第一贴图实体,其中,所述第二虚拟物理实体基于第三素材图像生成。The second virtual physical entity and the first texture entity, wherein the second virtual physical entity is generated based on a third material image.
在一种可能的实现方式中,所述装置还包括:第二添加部分,被配置为基于所述用户输入的初始化代码和所述目标实体,在所述虚拟场景中添加自定义素材。In a possible implementation manner, the apparatus further includes: a second adding part configured to add custom material in the virtual scene based on the initialization code input by the user and the target entity.
在一种可能的实现方式中,所述初始化代码中的初始化信息包括初始化尺寸和初始化位置;所述第二添加部分,被配置为在所述目标实体包括目标虚拟物理实体和目标贴图实体的情况下,基于所述初始化尺寸,调整所述目标虚拟物理实体和所述目标贴图实体的尺寸,得到尺寸变换后的目标虚拟物理实体和尺寸变换后的目标贴图实体;基于所述初始化位置,对齐所述尺寸变换后的目标虚拟物理实体和所述尺寸变换后的目标贴图实体;将对齐后的所述尺寸变换后的目标虚拟物理实体和所述尺寸变换后的目标贴图实体,添加在所述虚拟场景中。In a possible implementation manner, the initialization information in the initialization code includes an initialization size and an initialization position; the second adding part is configured to include a target virtual physical entity and a target texture entity when the target entity includes Next, based on the initialization size, adjust the size of the target virtual physical entity and the target texture entity to obtain a size-transformed target virtual physical entity and a size-transformed target texture entity; based on the initialization position, align all The size-transformed target virtual physical entity and the size-transformed target texture entity; the aligned size-transformed target virtual physical entity and the size-transformed target texture entity are added to the virtual scene.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
设置部分,被配置为基于所述用户输入的交互方式代码,设置所述自定义素材的交互方式。The setting part is configured to set the interaction mode of the custom material based on the interaction mode code input by the user.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
确定部分,被配置为通过物理引擎,确定所述自定义素材在所述虚拟场景中呈现的状态 信息。The determination part is configured to determine the status information of the custom material presented in the virtual scene through the physics engine.
在一种可能的实现方式中,所述生成部分,被配置为:In a possible implementation manner, the generating part is configured as:
在所述轮廓信息包括曲线段的情况下,将所述曲线段调整为线段,得到调整后的轮廓信息;When the contour information includes a curve segment, adjusting the curve segment to a line segment to obtain adjusted contour information;
基于所述调整后的轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体。Based on the adjusted outline information, a first virtual physical entity corresponding to the first material image is generated.
在一种可能的实现方式中,所述提取部分,被配置为:In a possible implementation manner, the extraction part is configured as:
响应于所述第一素材图像不为可缩放的矢量图形SVG,提取所述第一素材图像的顶点信息;Extracting vertex information of the first material image in response to the fact that the first material image is not a scalable vector graphics SVG;
基于所述顶点信息,提取所述第一素材图像的轮廓信息。Based on the vertex information, outline information of the first material image is extracted.
在一种可能的实现方式中,所述提取部分,被配置为:In a possible implementation manner, the extraction part is configured as:
响应于所述第一素材图像为SVG,提取所述第一素材图像的路径信息;Extracting path information of the first material image in response to the first material image being SVG;
基于所述路径信息,确定所述第一素材图像的轮廓信息。Based on the path information, contour information of the first material image is determined.
根据本公开实施例的一方面,提供了一种电子设备,包括:一个或多个处理器;用于存储可执行指令的存储器;其中,所述一个或多个处理器被配置为调用所述存储器存储的可执行指令,以执行上述方法。According to an aspect of the embodiments of the present disclosure, there is provided an electronic device, including: one or more processors; a memory for storing executable instructions; wherein, the one or more processors are configured to call the Executable instructions stored in the memory to perform the above method.
根据本公开实施例的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。According to an aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented.
根据本公开实施例的一方面,提供了一种计算机程序产品,所述计算机程序产品包括计算机程序或指令,在所述计算机程序或指令在电子设备上运行的情况下,使得所述电子设备执行上述方法。According to an aspect of an embodiment of the present disclosure, a computer program product is provided, the computer program product includes a computer program or an instruction, and when the computer program or instruction is run on an electronic device, the electronic device is caused to execute the above method.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。The accompanying drawings here are incorporated into the description and constitute a part of the present description. These drawings show embodiments consistent with the present disclosure, and are used together with the description to explain the technical solution of the present disclosure.
图1A示出本公开实施例提供的虚拟场景的素材处理方法的执行系统的架构示意图。FIG. 1A shows a schematic diagram of an architecture of a system for executing a material processing method for a virtual scene provided by an embodiment of the present disclosure.
图1B示出本公开实施例提供的虚拟场景的素材处理方法的流程示意图。FIG. 1B shows a schematic flowchart of a material processing method for a virtual scene provided by an embodiment of the present disclosure.
图2示出本公开实施例提供的虚拟场景的素材处理方法中的虚拟物理实体的示意图。FIG. 2 shows a schematic diagram of a virtual physical entity in a material processing method for a virtual scene provided by an embodiment of the present disclosure.
图3示出本公开实施例提供的虚拟场景的素材处理方法中的贴图实体的示意图。Fig. 3 shows a schematic diagram of a texture entity in a material processing method for a virtual scene provided by an embodiment of the present disclosure.
图4示出本公开实施例提供的虚拟场景的素材处理装置的框图。Fig. 4 shows a block diagram of a material processing device for a virtual scene provided by an embodiment of the present disclosure.
图5示出本公开实施例提供的一种电子设备800的框图。FIG. 5 shows a block diagram of an electronic device 800 provided by an embodiment of the present disclosure.
图6示出本公开实施例提供的另一电子设备1900的框图。FIG. 6 shows a block diagram of another electronic device 1900 provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features, and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numbers in the figures indicate functionally identical or similar elements. While various aspects of the embodiments are shown in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as superior or better than other embodiments.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元 素。The term "and/or" in this article is just an association relationship describing associated objects, which means that there can be three relationships, for example, A and/or B can mean: A exists alone, A and B exist simultaneously, and there exists alone B these three situations. In addition, the term "at least one" herein means any one of a variety or any combination of at least two of the more, for example, including at least one of A, B, and C, which may mean including from A, Any one or more elements selected from the set formed by B and C.
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的细节。本领域技术人员应当理解,没有某些细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。In addition, in order to better illustrate the present disclosure, numerous details are given in the following specific embodiments. It will be understood by those skilled in the art that the present disclosure may be practiced without certain of the details. In some instances, methods, means, components and circuits that are well known to those skilled in the art have not been described in detail so as to obscure the gist of the present disclosure.
虽然相关技术中的一些编程平台已经开放了用户自定义虚拟场景的素材的方式,但通常是通过UI(User Interface,用户界面)点击上传素材,或者通过交互工具绘制素材。这种用户自定义素材的方式与编程教学内容剥离,起不到促进编程知识吸收的效果。Although some programming platforms in related technologies have opened the way for users to customize the materials of virtual scenes, they usually click to upload materials through UI (User Interface, user interface), or draw materials through interactive tools. This method of user-defined materials is separated from the programming teaching content, which does not have the effect of promoting the absorption of programming knowledge.
本公开实施例提供了一种虚拟场景的素材处理方法及装置、电子设备、存储介质和计算机程序产品,通过获取用户自定义的虚拟场景的第一素材图像,基于所述用户输入的素材生成代码,提取所述第一素材图像的轮廓信息,基于所述轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体,和/或,基于所述轮廓信息和所述第一素材图像,生成所述第一素材图像对应的第一贴图实体,由此通过用户编程的方式完成素材的生成,素材生成的方式与编程教学内容紧密结合,从而能够通过素材生成过程促进编程知识的吸收。另外,通过生成用户自定义的第一素材图像对应的第一虚拟物理实体和/或第一贴图实体,能够基于一个素材图像获得能够独立使用的虚拟物理实体和/或贴图实体,从而能够提高在虚拟场景中使用素材的灵活性。与相关技术中采用“设计-美术-技术”的流程制作虚拟场景的素材的方式相比,本公开实施例提供的虚拟场景的素材处理方法能够降低虚拟场景制作成本。Embodiments of the present disclosure provide a material processing method and device for a virtual scene, an electronic device, a storage medium, and a computer program product, by obtaining the first material image of a user-defined virtual scene, and generating a code based on the material input by the user , extracting contour information of the first material image, generating a first virtual physical entity corresponding to the first material image based on the contour information, and/or, based on the contour information and the first material image, The first texture entity corresponding to the first material image is generated, thereby completing the material generation through user programming. The material generation method is closely combined with the programming teaching content, so that the absorption of programming knowledge can be promoted through the material generation process. In addition, by generating the first virtual physical entity and/or the first texture entity corresponding to the user-defined first material image, a virtual physical entity and/or texture entity that can be used independently can be obtained based on a material image, thereby improving Flexibility in using material in virtual sets. Compared with the method in the related art that adopts the process of "design-art-technology" to produce virtual scene materials, the virtual scene material processing method provided by the embodiment of the present disclosure can reduce the cost of virtual scene production.
图1A示出本公开实施例提供的虚拟场景的素材处理方法的执行系统10的架构示意图。如图1A所示,计算机处理设备300通过网络200连接素材图像获取设备100。网络200可以是广域网或者局域网,又或者是二者的组合。计算机处理设备300和素材图像获取设备100在物理上可以是分立的,也可以是一体的。素材图像获取设备100可以通过网络200将获取的用户自定义的虚拟场景的第一素材图像发送或存储至计算机处理设备300。计算机处理设备300基于用户输入的素材生成代码,提取第一素材图像的轮廓信息;基于轮廓信息,生成第一素材图像对应的第一虚拟物理实体;和/或,基于轮廓信息和第一素材图像,生成第一素材图像对应的第一贴图实体。这样,通过用户编程的方式完成素材的生成,素材生成的方式与编程教学内容紧密结合,从而能够通过素材生成过程促进编程知识的吸收。另外,通过生成用户自定义的第一素材图像对应的第一虚拟物理实体和/或第一贴图实体,能够基于一个素材图像获得能够独立使用的虚拟物理实体和/或贴图实体,从而能够提高在虚拟场景中使用素材的灵活性。与相关技术中采用“设计-美术-技术”的流程制作虚拟场景的素材的方式相比,本公开实施例提供的虚拟场景的素材处理方法能够降低虚拟场景制作成本。FIG. 1A shows a schematic diagram of an architecture of a system 10 for executing a material processing method for a virtual scene provided by an embodiment of the present disclosure. As shown in FIG. 1A , the computer processing device 300 is connected to the material image acquisition device 100 through the network 200 . The network 200 may be a wide area network or a local area network, or a combination of both. The computer processing device 300 and the material image acquisition device 100 may be physically separate or integrated. The material image acquiring device 100 may send or store the acquired first material image of the user-defined virtual scene to the computer processing device 300 through the network 200 . The computer processing device 300 generates a code based on the material input by the user, and extracts the contour information of the first material image; based on the contour information, generates a first virtual physical entity corresponding to the first material image; and/or, based on the contour information and the first material image , to generate the first texture entity corresponding to the first material image. In this way, the generation of materials is completed through user programming, and the way of material generation is closely integrated with programming teaching content, so that the absorption of programming knowledge can be promoted through the process of material generation. In addition, by generating the first virtual physical entity and/or the first texture entity corresponding to the user-defined first material image, a virtual physical entity and/or texture entity that can be used independently can be obtained based on a material image, thereby improving Flexibility in using material in virtual sets. Compared with the method in the related art that adopts the process of "design-art-technology" to produce virtual scene materials, the method for processing virtual scene materials provided by the embodiments of the present disclosure can reduce the production cost of virtual scenes.
图1B示出本公开实施例提供的虚拟场景的素材处理方法的流程示意图。在一种可能的实现方式中,所述虚拟场景的素材处理方法可以由终端设备或服务器或其它电子设备执行。其中,终端设备可以是用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备或者可穿戴设备等。在一些可能的实现方式中,所述虚拟场景的素材处理方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。如图1B所示,所述虚拟场景的素材处理方法包括步骤S11至步骤S13。FIG. 1B shows a schematic flowchart of a material processing method for a virtual scene provided by an embodiment of the present disclosure. In a possible implementation manner, the material processing method for the virtual scene may be executed by a terminal device or a server or other electronic devices. Wherein, the terminal device may be user equipment (User Equipment, UE), mobile device, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (Personal Digital Assistant, PDA), handheld device, computing device, vehicle-mounted device or Wearable equipment etc. In some possible implementation manners, the method for processing the material of the virtual scene may be implemented by calling a computer-readable instruction stored in a memory by a processor. As shown in FIG. 1B , the material processing method of the virtual scene includes step S11 to step S13.
在步骤S11中,获取用户自定义的虚拟场景的第一素材图像。In step S11, a first material image of a user-defined virtual scene is acquired.
在步骤S12中,基于所述用户输入的素材生成代码,提取所述第一素材图像的轮廓信息。In step S12, based on the material generation code input by the user, outline information of the first material image is extracted.
在步骤S13中,基于所述轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体;和/或,基于所述轮廓信息和所述第一素材图像,生成所述第一素材图像对应的第一贴图实体。In step S13, based on the outline information, a first virtual physical entity corresponding to the first material image is generated; and/or, based on the outline information and the first material image, the first material image is generated The corresponding first texture entity.
本公开实施例中的用户可以是使用或者设计虚拟场景的任意用户。例如,在编程教育的应用场景中,用户可以是学生或者老师。A user in the embodiments of the present disclosure may be any user who uses or designs a virtual scene. For example, in the application scenario of programming education, users can be students or teachers.
第一素材图像可以表示用户自定义的任一素材图像。素材图像可以表示用于作为虚拟场景的素材的图像。素材图像可以为二维图像或者三维图像。在本公开实施例中,开放用户自定义素材。用户自定义的第一素材图像,可以是用户上传的素材图像,也可以是用户绘制的素材图像。The first material image may represent any user-defined material image. The material image may mean an image used as a material of a virtual scene. The material image may be a two-dimensional image or a three-dimensional image. In the embodiment of the present disclosure, the user-defined material is opened. The user-defined first material image may be a material image uploaded by the user, or a material image drawn by the user.
素材生成代码可以表示用于生成素材的代码。在本公开实施例中,可以响应于用户输入的素材生成代码,触发生成素材的流程。其中,所述生成素材的流程可以包括:“提取所述第一素材图像的轮廓信息”以及“基于所述轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体;和/或,基于所述轮廓信息和所述第一素材图像,生成所述第一素材图像对应的第一贴图实体”。The material generation code may indicate a code for generating the material. In the embodiment of the present disclosure, the process of generating the material may be triggered in response to the material generating code input by the user. Wherein, the process of generating material may include: "extracting contour information of the first material image" and "generating a first virtual physical entity corresponding to the first material image based on the contour information; and/or, Based on the outline information and the first material image, generate a first texture entity corresponding to the first material image.
在本公开实施例中,第一素材图像的轮廓信息,可以为能够表示第一素材图像的轮廓的任意信息。其中,第一素材图像的轮廓可以表示构成第一素材图像的形状的边界或外形线。In this embodiment of the present disclosure, the contour information of the first material image may be any information that can represent the contour of the first material image. Wherein, the outline of the first material image may represent a boundary or an outline of a shape constituting the first material image.
在一种可能的实现方式中,所述提取所述第一素材图像的轮廓信息,包括:响应于所述第一素材图像不为可缩放的矢量图形(Scalable Vector Graphics,SVG),提取所述第一素材图像的顶点信息;基于所述顶点信息,提取所述第一素材图像的轮廓信息。其中,可以提取第一素材图像的部分或所有顶点的信息。例如,可以提取第一素材图像的任意一个顶点的信息;又如,可以提取第一素材图像的所有顶点的信息。其中,顶点信息可以包括顶点的坐标等。In a possible implementation manner, the extracting the contour information of the first material image includes: in response to the first material image not being scalable vector graphics (Scalable Vector Graphics, SVG), extracting the Vertex information of the first material image; extracting contour information of the first material image based on the vertex information. Wherein, the information of some or all vertices of the first material image may be extracted. For example, information of any vertex of the first material image may be extracted; for another example, information of all vertices of the first material image may be extracted. Wherein, the vertex information may include the coordinates of the vertex and the like.
作为该实现方式的一个示例,在第一素材图像不为SVG的情况下,可以提取第一素材图像的左上角顶点的坐标,基于第一素材图像的左上角顶点的坐标,提取第一素材图像的高度和宽度,并将第一素材图像的左上角顶点的坐标、第一素材图像的高度和第一素材图像的宽度作为第一素材图像的轮廓信息。即,在第一素材图像不为SVG的情况下,第一素材图像的轮廓信息可以包括第一素材图像的左上角顶点的坐标、第一素材图像的高度和第一素材图像的宽度。As an example of this implementation, if the first material image is not SVG, the coordinates of the upper-left vertex of the first material image may be extracted, and the first material image may be extracted based on the coordinates of the upper-left vertex of the first material image The height and width of the first material image, and the coordinates of the upper left corner of the first material image, the height of the first material image, and the width of the first material image are used as the outline information of the first material image. That is, if the first material image is not SVG, the outline information of the first material image may include the coordinates of the upper left corner of the first material image, the height of the first material image, and the width of the first material image.
作为该实现方式的另一个示例,在第一素材图像不为SVG的情况下,可以提取第一素材图像的右上角顶点的坐标,基于第一素材图像的右上角顶点的坐标,提取第一素材图像的高度和宽度,并将第一素材图像的右上角顶点的坐标、第一素材图像的高度和第一素材图像的宽度作为第一素材图像的轮廓信息。即,在第一素材图像不为SVG的情况下,第一素材图像的轮廓信息可以包括第一素材图像的右上角顶点的坐标、第一素材图像的高度和第一素材图像的宽度。As another example of this implementation, if the first material image is not SVG, the coordinates of the upper right vertex of the first material image may be extracted, and based on the coordinates of the upper right vertex of the first material image, the first material The height and width of the image, and the coordinates of the upper right corner vertex of the first material image, the height of the first material image, and the width of the first material image are used as the outline information of the first material image. That is, if the first material image is not SVG, the outline information of the first material image may include the coordinates of the upper right corner of the first material image, the height of the first material image, and the width of the first material image.
作为该实现方式的另一个示例,在第一素材图像不为SVG的情况下,可以提取第一素材图像的左下角顶点的坐标,基于第一素材图像的左下角顶点的坐标,提取第一素材图像的高度和宽度,并将第一素材图像的左下角顶点的坐标、第一素材图像的高度和第一素材图像的宽度作为第一素材图像的轮廓信息。即,在第一素材图像不为SVG的情况下,第一素材图像的轮廓信息可以包括第一素材图像的左下角顶点的坐标、第一素材图像的高度和第一素材图像的宽度。As another example of this implementation, if the first material image is not SVG, the coordinates of the lower left vertex of the first material image may be extracted, and based on the coordinates of the lower left vertex of the first material image, the first material The height and width of the image, and the coordinates of the bottom left corner of the first material image, the height of the first material image, and the width of the first material image are used as the outline information of the first material image. That is, if the first material image is not SVG, the outline information of the first material image may include the coordinates of the lower left corner of the first material image, the height of the first material image, and the width of the first material image.
作为该实现方式的另一个示例,在第一素材图像不为SVG的情况下,可以提取第一素材图像的右下角顶点的坐标,基于第一素材图像的右下角顶点的坐标,提取第一素材图像的高度和宽度,并将第一素材图像的右下角顶点的坐标、第一素材图像的高度和第一素材图像的宽度作为第一素材图像的轮廓信息。即,在第一素材图像不为SVG的情况下,第一素材图像的轮廓信息可以包括第一素材图像的右下角顶点的坐标、第一素材图像的高度和第一素材图像的宽度。As another example of this implementation, if the first material image is not SVG, the coordinates of the lower right vertex of the first material image can be extracted, and based on the coordinates of the lower right vertex of the first material image, the first material can be extracted The height and width of the image, and the coordinates of the bottom right vertex of the first material image, the height of the first material image, and the width of the first material image are used as the outline information of the first material image. That is, if the first material image is not SVG, the outline information of the first material image may include the coordinates of the bottom right vertex of the first material image, the height of the first material image, and the width of the first material image.
作为该实现方式的另一个示例,在第一素材图像不为SVG的情况下,可以提取第一素材图像的左上角顶点的坐标、右上角顶点的坐标、左下角顶点的坐标和右下角顶点的坐标,并将第一素材图像的左上角顶点的坐标、右上角顶点的坐标、左下角顶点的坐标和右下角顶点的坐标作为第一素材图像的轮廓信息。即,在第一素材图像不为SVG的情况下,第一素材图像的轮廓信息可以包括第一素材图像的左上角顶点的坐标、右上角顶点的坐标、左下角顶点的坐标和右下角顶点的坐标。As another example of this implementation, if the first material image is not SVG, the coordinates of the upper-left vertex, the coordinates of the upper-right vertex, the coordinates of the lower-left vertex, and the coordinates of the lower-right vertex of the first material image can be extracted. Coordinates, and the coordinates of the upper left vertex, the upper right vertex, the lower left vertex and the lower right vertex of the first material image are used as the outline information of the first material image. That is, when the first material image is not SVG, the outline information of the first material image may include the coordinates of the upper left vertex, the coordinates of the upper right vertex, the coordinates of the lower left vertex and the coordinates of the lower right vertex of the first material image. coordinate.
在该实现方式中,通过响应于第一素材图像不为SVG,提取第一素材图像的顶点信息,并基于所述顶点信息,提取第一素材图像的轮廓信息,由此能够准确地提取第一素材图像的轮廓信息。In this implementation, by extracting the vertex information of the first material image in response to the fact that the first material image is not SVG, and extracting the outline information of the first material image based on the vertex information, the first material image can be accurately extracted. Outline information of the material image.
在一种可能的实现方式中,所述提取所述第一素材图像的轮廓信息,包括:响应于所述 第一素材图像为SVG,提取所述第一素材图像的路径信息;基于所述路径信息,确定所述第一素材图像的轮廓信息。其中,路径信息即为<path>元素。在第一素材图像为SVG的情况下,可以读取第一素材图像的<path>元素,遍历<path>元素中的每一段路径,得到第一素材图像的轮廓信息。基于该实现方式,在第一素材图像为SVG的情况下,能够快速、准确地提取第一素材图像的轮廓信息。In a possible implementation manner, the extracting the outline information of the first material image includes: in response to the fact that the first material image is SVG, extracting the path information of the first material image; information, to determine the contour information of the first material image. Among them, the path information is the <path> element. In the case that the first material image is SVG, the <path> element of the first material image may be read, and each path in the <path> element may be traversed to obtain the outline information of the first material image. Based on this implementation manner, when the first material image is an SVG, the outline information of the first material image can be extracted quickly and accurately.
作为该实现方式的一个示例,在第一素材图像为SVG,第一素材图像为凹多边形的情况下,可以将第一素材图像分割为至少两个凸多边形。由于凹多边形的碰撞计算比凸多边形的碰撞计算复杂得多,因此,在第一素材图像为凹多边形的情况下将第一素材图像分割为凸多边形,由此在将第一素材图像对应的第一虚拟物理实体和/或第一贴图实体作为自定义素材添加到虚拟场景中后,能够降低物理引擎对自定义素材进行碰撞检测计算的复杂度,并有助于提高物理引擎对自定义素材进行碰撞检测的准确性。其中,物理引擎可以在虚拟场景的每帧分别进行碰撞检测。在将第一素材图像分割为至少两个凸多边形之后,第一素材图像的轮廓信息可以包括所述至少两个凸多边形的轮廓信息。As an example of this implementation manner, when the first material image is SVG and the first material image is a concave polygon, the first material image may be divided into at least two convex polygons. Since the collision calculation of concave polygons is much more complicated than that of convex polygons, when the first material image is a concave polygon, the first material image is divided into convex polygons. After a virtual physical entity and/or the first texture entity is added to the virtual scene as a custom material, it can reduce the complexity of the physics engine's collision detection calculation for the custom material, and help improve the physics engine's ability to perform collision detection on the custom material. Accuracy of collision detection. Among them, the physics engine can perform collision detection in each frame of the virtual scene. After the first material image is divided into at least two convex polygons, the contour information of the first material image may include contour information of the at least two convex polygons.
其中,可以采用向量方法(Vector Method)或者旋转法(Rotational Method)等方法,将凹多边形分割为至少两个凸多边形。例如,在向量方法中,对于任意一个多边形,可以计算该多边形的相邻的边向量的叉积,以判断该多边形是否存在凹顶点。在该多边形存在凹顶点的情况下,可以判定该多边形为凹多边形。对于任一凹多边形,可以选取连接凹顶点的一条边,并计算该边的延长线与凹多边形的其他边的交点,从而将原凹多边形分割为两个新的多边形。对于分割得到的每个新的多边形重复以上步骤,直至不再存在凹多边形。Among them, methods such as vector method (Vector Method) or rotation method (Rotational Method) can be used to divide the concave polygon into at least two convex polygons. For example, in the vector method, for any polygon, the cross product of adjacent edge vectors of the polygon can be calculated to determine whether there is a concave vertex in the polygon. If the polygon has a concave vertex, it can be determined that the polygon is a concave polygon. For any concave polygon, you can select an edge connecting the concave vertices, and calculate the intersection point of the extension line of this edge with other edges of the concave polygon, so as to divide the original concave polygon into two new polygons. Repeat the above steps for each new polygon obtained by segmentation until there are no more concave polygons.
本公开实施例中的实体可以表示在时间上有连续性,并且有唯一标识可以来区分的对象。虚拟物理实体可以表示用于作为虚拟场景的物体的实体,虚拟物理实体不包含图案。图2示出本公开实施例提供的虚拟场景的素材处理方法中的虚拟物理实体的示意图,如图2所示,该虚拟物理实体可以表示用于作为虚拟场景的物体的实体,该虚拟物理实体不包含图案。贴图实体可以表示用于贴在虚拟物理实体的表面的实体,即,贴图实体可以用作虚拟物理实体对应的物体的图案。图3示出本公开实施例提供的虚拟场景的素材处理方法中的贴图实体的示意图,如图3所示,该贴图实体可以表示用于贴在图2所示的虚拟物理实体的表面的实体,即该贴图实体可以用作图2所示的虚拟物理实体对应的物体的图案。在第一素材图像为二维图像的情况下,基于第一素材图像生成的第一虚拟物理实体和第一贴图实体也可以是二维的。当然,也可以预先设置基于二维的素材图像生成三维的虚拟物理实体和/或三维的贴图实体的方法,以基于二维的素材图像生成三维的虚拟物理实体和/或三维的贴图实体。The entity in the embodiment of the present disclosure may represent an object that is continuous in time and can be distinguished by a unique identifier. A virtual physical entity may represent an entity for use as an object of a virtual scene, the virtual physical entity not containing a pattern. FIG. 2 shows a schematic diagram of a virtual physical entity in a material processing method for a virtual scene provided by an embodiment of the present disclosure. As shown in FIG. 2 , the virtual physical entity may represent an entity used as an object in a virtual scene, and the virtual physical entity Pattern not included. The texture entity may represent an entity to be pasted on the surface of the virtual physical entity, that is, the texture entity may be used as a pattern of an object corresponding to the virtual physical entity. Fig. 3 shows a schematic diagram of a texture entity in the material processing method of a virtual scene provided by an embodiment of the present disclosure. As shown in Fig. 3, the texture entity may represent an entity used to paste on the surface of the virtual physical entity shown in Fig. 2 , that is, the texture entity can be used as the pattern of the object corresponding to the virtual physical entity shown in FIG. 2 . In the case that the first material image is a two-dimensional image, the first virtual physical entity and the first texture entity generated based on the first material image may also be two-dimensional. Certainly, the method of generating a three-dimensional virtual physical entity and/or a three-dimensional textured entity based on a two-dimensional material image may also be preset, so as to generate a three-dimensional virtual physical entity and/or a three-dimensional textured entity based on a two-dimensional material image.
其中,第一虚拟物理实体可以具有第一标识信息,第一标识信息可以用于唯一标识第一虚拟物理实体;第一贴图实体可以具有第二标识信息,第二标识信息可以用于唯一标识第一贴图实体。Wherein, the first virtual physical entity may have first identification information, and the first identification information may be used to uniquely identify the first virtual physical entity; the first texture entity may have second identification information, and the second identification information may be used to uniquely identify the first virtual physical entity. A texture entity.
在本公开实施例中,基于所述轮廓信息,生成第一虚拟物理实体。其中,基于所述轮廓信息生成的第一虚拟物理实体的属性可以包括轮廓属性,第一虚拟物理实体的轮廓属性可以用于表示第一虚拟物理实体的轮廓。例如,第一虚拟物理实体的轮廓属性的属性值可以包括第一虚拟物理实体的各个顶点的坐标。当然,在第一虚拟物理实体的轮廓包含曲线段的情况下,第一虚拟物理实体的轮廓属性的属性值还可以包括曲线模型。In the embodiment of the present disclosure, based on the outline information, a first virtual physical entity is generated. Wherein, the attributes of the first virtual physical entity generated based on the outline information may include outline attributes, and the outline attributes of the first virtual physical entity may be used to represent the outline of the first virtual physical entity. For example, the attribute value of the outline attribute of the first virtual physical entity may include the coordinates of each vertex of the first virtual physical entity. Certainly, in the case that the outline of the first virtual physical entity includes a curve segment, the attribute value of the outline attribute of the first virtual physical entity may also include a curve model.
在一种可能的实现方式中,所述基于所述轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体,包括:在所述轮廓信息包括曲线段的情况下,将所述曲线段调整为线段,得到调整后的轮廓信息;基于所述调整后的轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体。在该实现方式中,在所述轮廓信息包括曲线段的情况下,可以根据所述曲线段的两个端点的坐标,将所述曲线段调整为线段。例如,可以将连接所述曲线段的两个端点的线段,作为所述曲线段对应的线段。将所述轮廓信息中的曲线段替换为所述曲线段对应的线段,可以得到调整后的轮廓信息。又例如,可以在曲线段上选择部分连接点(包括两个端点),将相邻两个连接点进行连接,可以得到多段线段,该多段线段可作为调整后的轮廓信息。在该实现方式中,通过在所述轮廓信息包括曲线段的情况下,将所述曲线段调整为线段,得到 调整后的轮廓信息,并基于所述调整后的轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体,由此能够降低碰撞计算的复杂度。In a possible implementation manner, the generating the first virtual physical entity corresponding to the first material image based on the contour information includes: when the contour information includes a curve segment, converting the curve to The segment is adjusted into a line segment to obtain adjusted contour information; based on the adjusted contour information, a first virtual physical entity corresponding to the first material image is generated. In this implementation manner, when the contour information includes a curve segment, the curve segment may be adjusted to a line segment according to coordinates of two end points of the curve segment. For example, a line segment connecting two end points of the curve segment may be used as a line segment corresponding to the curve segment. The adjusted contour information can be obtained by replacing the curve segment in the contour information with the line segment corresponding to the curve segment. For another example, some connection points (including two end points) can be selected on the curve segment, and two adjacent connection points can be connected to obtain a polyline segment, which can be used as the adjusted contour information. In this implementation manner, when the contour information includes a curve segment, the curve segment is adjusted to a line segment to obtain adjusted contour information, and the first contour information is generated based on the adjusted contour information. The first virtual physical entity corresponding to the material image can reduce the complexity of collision calculation.
在另一种可能的实现方式中,在所述轮廓信息包括曲线段的情况下,可以保留所述轮廓信息中的曲线段,并根据包含曲线段的所述轮廓信息生成第一素材图像对应的第一虚拟物理实体。在该实现方式中,第一虚拟物理实体的轮廓属性的属性值还可以包括曲线模型。In another possible implementation manner, in the case that the contour information includes curve segments, the curve segments in the contour information may be retained, and the corresponding The first virtual physical entity. In this implementation manner, the attribute value of the outline attribute of the first virtual physical entity may also include a curve model.
在本公开实施例中,基于所述轮廓信息和第一素材图像,生成第一贴图实体。其中,基于所述轮廓信息和第一素材图像生成的第一贴图实体的属性可以包括轮廓属性和图像属性。其中,第一贴图实体的轮廓属性用于表示第一贴图实体的轮廓,第一贴图实体的轮廓与第一素材图像的轮廓相同。例如,在第一素材图像的轮廓不包含曲线段的情况下,可以根据所述轮廓信息确定第一素材图像的各个顶点的坐标,并可以将第一素材图像的各个顶点的坐标作为第一贴图实体的轮廓属性的属性值,即,第一贴图实体的轮廓属性的属性值可以包括第一贴图实体的各个顶点的坐标。又如,在第一素材图像的轮廓包含曲线段的情况下,第一贴图实体的轮廓属性的属性值还可以包括曲线模型。第一贴图实体的图像属性的属性值为第一素材图像。In the embodiment of the present disclosure, based on the outline information and the first material image, a first texture entity is generated. Wherein, the attributes of the first texture entity generated based on the outline information and the first material image may include outline attributes and image attributes. Wherein, the outline attribute of the first texture entity is used to represent the outline of the first texture entity, and the outline of the first texture entity is the same as the outline of the first material image. For example, when the outline of the first material image does not contain curve segments, the coordinates of each vertex of the first material image can be determined according to the outline information, and the coordinates of each vertex of the first material image can be used as the first texture The attribute value of the outline attribute of the entity, that is, the attribute value of the outline attribute of the first texture entity may include the coordinates of each vertex of the first texture entity. As another example, when the outline of the first material image includes a curve segment, the attribute value of the outline attribute of the first texture entity may also include a curve model. The attribute value of the image attribute of the first texture entity is the first material image.
在本公开实施例中,通过生成第一虚拟物理实体和/或第一贴图实体,第一虚拟物理实体与第一贴图实体不绑定,由此可以只使用第一虚拟物理实体而不使用第一贴图实体,或者可以使用其他贴图实体贴在第一虚拟物理实体上,或者可以将第一贴图实体贴在其他虚拟物理实体上。In the embodiment of the present disclosure, by generating the first virtual physical entity and/or the first texture entity, the first virtual physical entity is not bound to the first texture entity, so that only the first virtual physical entity can be used instead of the second texture entity. A texture entity, or other texture entities can be used to paste on the first virtual physical entity, or the first texture entity can be pasted on other virtual physical entities.
在一种可能的实现方式中,在所述生成所述第一素材图像对应的第一虚拟物理实体和所述生成所述第一素材图像对应的第一贴图实体之后,所述方法还包括:基于所述用户输入的素材添加代码,获取目标实体,其中,所述目标实体至少包括目标虚拟物理实体;基于所述目标实体,在所述虚拟场景中添加自定义素材。其中,素材添加代码可以表示用于在虚拟场景中添加素材的代码。目标实体可以仅包括目标虚拟物理实体,或者,目标实体可以包括目标虚拟物理实体和目标贴图实体。素材添加代码可以包括目标实体的标识信息,从而可以根据目标实体的标识信息,获取目标实体。In a possible implementation manner, after generating the first virtual physical entity corresponding to the first material image and the generating the first texture entity corresponding to the first material image, the method further includes: Adding a code based on the material input by the user to obtain a target entity, wherein the target entity includes at least a target virtual physical entity; based on the target entity, adding a custom material in the virtual scene. Wherein, the material adding code may represent a code for adding material in the virtual scene. The target entity may only include the target virtual physical entity, or the target entity may include the target virtual physical entity and the target texture entity. The material adding code may include the identification information of the target entity, so that the target entity can be obtained according to the identification information of the target entity.
在一个示例中,第一虚拟物理实体的标识信息为第一标识信息,第一贴图实体的标识信息为第二标识信息。例如,在素材添加代码包括第一标识信息的情况下,可以根据第一标识信息获取第一虚拟物理实体。在这个例子中,目标实体包括目标虚拟物理实体,目标虚拟物理实体为第一虚拟物理实体。又如,在素材添加代码包括第一标识信息和第二标识信息的情况下,则可以根据第一标识信息获取第一虚拟物理实体,并根据第二标识信息获取第一贴图实体。在这个例子中,目标实体包括目标虚拟物理实体和目标贴图实体,目标虚拟物理实体为第一虚拟物理实体,目标贴图实体为第一贴图实体。In an example, the identification information of the first virtual physical entity is first identification information, and the identification information of the first texture entity is second identification information. For example, in the case that the material adding code includes the first identification information, the first virtual physical entity may be acquired according to the first identification information. In this example, the target entity includes a target virtual physical entity, and the target virtual physical entity is the first virtual physical entity. As another example, if the material adding code includes first identification information and second identification information, the first virtual physical entity may be obtained according to the first identification information, and the first texture entity may be obtained according to the second identification information. In this example, the target entity includes a target virtual physical entity and a target texture entity, the target virtual physical entity is the first virtual physical entity, and the target texture entity is the first texture entity.
在目标实体仅包括目标虚拟物理实体的情况下,可以将所述目标虚拟物理实体作为一个自定义素材;在目标实体包括目标虚拟物理实体和目标贴图实体的情况下,可以将所述目标虚拟物理实体和所述目标贴图实体作为同一个自定义素材。在该实现方式中,基于所述用户输入的素材添加代码,获取目标实体,并基于所述目标实体,在所述虚拟场景中添加自定义素材,由此通过用户编程的方式在虚拟场景中完成素材的添加,素材添加的方式与编程教学内容紧密结合,从而能够通过素材添加过程促进编程知识的吸收。When the target entity only includes the target virtual physical entity, the target virtual physical entity can be used as a custom material; when the target entity includes the target virtual physical entity and the target texture entity, the target virtual physical entity can be used Entity and said target texture entity as the same custom material. In this implementation, the code is added based on the material input by the user to obtain the target entity, and based on the target entity, a custom material is added to the virtual scene, thereby completing the process in the virtual scene through user programming. The addition of materials and the way of adding materials are closely integrated with the programming teaching content, so that the absorption of programming knowledge can be promoted through the process of adding materials.
作为该实现方式的一个示例,所述目标实体包括以下任意一项:所述第一虚拟物理实体和所述第一贴图实体;所述第一虚拟物理实体;所述第一虚拟物理实体和第二贴图实体,其中,所述第二贴图实体基于第二素材图像生成;第二虚拟物理实体和所述第一贴图实体,其中,所述第二虚拟物理实体基于第三素材图像生成。其中,第二素材图像不同于第一素材图像,第三素材图像不同于第一素材图像。第二素材图像与第三素材图像可以相同,也可以不同。第二贴图实体不同于第一贴图实体,第二虚拟物理实体不同于第一虚拟物理实体。可以采用上文中基于第一素材图像生成第一贴图实体的方法,基于第二素材图像生成第二贴图实体;可以采用上文中基于第一素材图像生成第一虚拟物理实体的方法,基于第三素材图像生成第二虚拟物理实体。根据该示例,基于第一素材图像生成的第一虚拟物理实体与第一贴图 实体不绑定,第一虚拟物理实体可以与第一贴图实体一起使用,或者,第一虚拟物理实体可以单独使用,或者,第一虚拟物理实体可以与第一贴图实体以外的其他贴图实体一起使用,或者,第一贴图实体可以与第一虚拟物理实体以外的其他虚拟物理实体一起使用,从而能够提高在虚拟场景中使用素材的灵活性。As an example of this implementation, the target entity includes any of the following: the first virtual physical entity and the first texture entity; the first virtual physical entity; the first virtual physical entity and the first texture entity Two texture entities, wherein the second texture entity is generated based on the second material image; a second virtual physical entity and the first texture entity, wherein the second virtual physical entity is generated based on the third material image. Wherein, the second material image is different from the first material image, and the third material image is different from the first material image. The second material image and the third material image may be the same or different. The second texture entity is different from the first texture entity, and the second virtual physical entity is different from the first virtual physical entity. The above method of generating the first texture entity based on the first material image can be used, and the second texture entity can be generated based on the second material image; the above method of generating the first virtual physical entity based on the first material image can be used, based on the third material image The image generates a second virtual physical entity. According to this example, the first virtual physical entity generated based on the first material image is not bound to the first texture entity, the first virtual physical entity can be used together with the first texture entity, or the first virtual physical entity can be used alone, Or, the first virtual physical entity can be used together with other textured entities other than the first textured entity, or the first textured entity can be used together with other virtual physical entities other than the first virtual physical entity, thereby improving the performance in the virtual scene. Flexibility in working with materials.
在该实现方式中,目标实体只要包括任一虚拟物理实体即可,即,在该实现方式的其他示例中,目标实体也可以既不包括第一虚拟物理实体也不包括第一贴图实体。In this implementation manner, the target entity only needs to include any virtual physical entity, that is, in other examples of this implementation manner, the target entity may also include neither the first virtual physical entity nor the first texture entity.
作为该实现方式的一个示例,素材添加代码可以调用实体添加接口,通过实体添加接口获取目标实体。其中,实体添加接口可以表示用于在虚拟场景中添加实体的接口。实体添加接口可以是根据物理引擎和/或渲染引擎封装的。在一些应用场景中,物理引擎和渲染引擎也可以合并为同一引擎,例如可以称为物理渲染引擎或者物理和渲染引擎。在一个例子中,实体添加接口可以命名为addCraft。As an example of this implementation, the material adding code can call the entity adding interface, and obtain the target entity through the entity adding interface. Wherein, the entity adding interface may represent an interface for adding entities in the virtual scene. The entity adding interface may be encapsulated according to the physics engine and/or the rendering engine. In some application scenarios, the physics engine and the rendering engine can also be combined into one engine, for example, it can be called a physics rendering engine or a physics and rendering engine. In one example, the entity adding interface may be named addCraft.
作为该实现方式的一个示例,所述在所述生成所述第一素材图像对应的第一虚拟物理实体和所述生成所述第一素材图像对应的第一贴图实体之后,所述方法还包括:基于所述用户输入的初始化代码和所述目标实体,在所述虚拟场景中添加自定义素材。在该示例中,初始化代码可以表示用于初始化自定义素材的代码。根据初始化代码,可以确定自定义素材在虚拟场景中的初始化状态。在一个例子中,初始化代码可以调用实体添加接口给入初始化信息。在这个例子中,实体添加接口还可以用于设置自定义素材的初始化信息。As an example of this implementation, after the generating the first virtual physical entity corresponding to the first material image and the generating the first texture entity corresponding to the first material image, the method further includes : Adding a custom material in the virtual scene based on the initialization code input by the user and the target entity. In this example, the initialization code can represent the code used to initialize the custom material. According to the initialization code, the initialization state of the custom material in the virtual scene can be determined. In one example, the initialization code can call the entity addition interface to input initialization information. In this example, the entity adding interface can also be used to set the initialization information of the custom material.
在该示例中,基于所述用户输入的初始化代码和所述目标实体,在所述虚拟场景中添加自定义素材,由此通过用户编程的方式完成虚拟场景中自定义素材的初始化,自定义素材的初始化方式与编程教学内容紧密结合,从而能够通过自定义素材的初始化过程促进编程知识的吸收。In this example, based on the initialization code input by the user and the target entity, a custom material is added to the virtual scene, thereby completing the initialization of the custom material in the virtual scene through user programming, and the custom material The initialization method is closely combined with the programming teaching content, which can promote the absorption of programming knowledge through the initialization process of custom materials.
在一个例子中,所述初始化代码包括以下至少一项初始化信息:初始化尺寸、初始化位置、初始化角度、初始化速度。例如,初始化代码可以调用实体添加接口给入初始化尺寸size=【width,height】、初始化位置position=【x 0,y 0】和初始化角度theta。在这个例子中,基于所述用户输入的包括初始化尺寸、初始化位置、初始化角度、初始化速度中的至少一项初始化信息的初始化代码,以及所述目标实体,在所述虚拟场景中添加自定义素材,由此通过用户编程的方式完成虚拟场景中自定义素材的尺寸、位置、角度、速度中的至少之一的初始化,自定义素材的初始化方式与编程教学内容紧密结合,从而能够通过自定义素材的初始化过程促进编程知识的吸收。 In an example, the initialization code includes at least one of the following initialization information: initialization size, initialization position, initialization angle, and initialization speed. For example, the initialization code can call the entity adding interface to input the initialization size size=[width, height], the initialization position position=[x 0 , y 0 ] and the initialization angle theta. In this example, based on the initialization code input by the user including at least one item of initialization information among initialization size, initialization position, initialization angle, and initialization speed, and the target entity, a custom material is added to the virtual scene , so that the initialization of at least one of the size, position, angle, and speed of the custom material in the virtual scene is completed through user programming. The initialization method of the custom material is closely combined with the programming teaching content, so that the user can The initialization process facilitates the absorption of programming knowledge.
需要说明的是,尽管以初始化尺寸、初始化位置、初始化角度、初始化速度介绍了初始化代码中包含的初始化信息如上,但本领域技术人员能够理解,本公开应不限于此。初始化代码可以包括用于初始化自定义素材的任意信息,例如,初始化代码还可以包括初始化的视觉特效信息等,在此不做限定。It should be noted that, although the initialization information included in the initialization code is described as above in terms of initialization size, initialization position, initialization angle, and initialization speed, those skilled in the art can understand that the present disclosure should not be limited thereto. The initialization code may include any information used to initialize the custom material. For example, the initialization code may also include initialized visual effect information, etc., which is not limited here.
在一个例子中,所述初始化代码包括初始化尺寸;所述基于所述用户输入的初始化代码和所述目标实体,在所述虚拟场景中添加自定义素材,包括:响应于所述初始化尺寸与所述目标实体的尺寸不同,将所述目标实体的尺寸调整至所述初始化尺寸后,添加至所述虚拟场景中。根据上述例子,能够灵活地设置自定义素材的尺寸。In an example, the initialization code includes an initialization size; adding a custom material in the virtual scene based on the initialization code input by the user and the target entity includes: responding to the initialization size and the target entity The size of the target entity is different, the size of the target entity is adjusted to the initial size, and then added to the virtual scene. According to the above example, the size of the custom material can be flexibly set.
在一个例子中,所述初始化代码中的初始化信息包括初始化尺寸和初始化位置;所述基于所述用户输入的初始化代码和所述目标实体,在所述虚拟场景中添加自定义素材,包括:在所述目标实体包括目标虚拟物理实体和目标贴图实体的情况下,基于所述初始化尺寸,调整所述目标虚拟物理实体和所述目标贴图实体的尺寸,得到尺寸变换后的目标虚拟物理实体和尺寸变换后的目标贴图实体;基于所述初始化位置,对齐所述尺寸变换后的目标虚拟物理实体和所述尺寸变换后的目标贴图实体;将对齐后的所述尺寸变换后的目标虚拟物理实体和所述尺寸变换后的目标贴图实体,添加在所述虚拟场景中。In one example, the initialization information in the initialization code includes an initialization size and an initialization position; adding a custom material in the virtual scene based on the initialization code input by the user and the target entity includes: When the target entity includes a target virtual physical entity and a target texture entity, based on the initial size, adjust the size of the target virtual physical entity and the target texture entity to obtain a size-transformed target virtual physical entity and size Transformed target texture entity; based on the initialization position, align the size-transformed target virtual physical entity and the size-transformed target texture entity; align the size-transformed target virtual physical entity and The target texture entity after the size transformation is added in the virtual scene.
例如,初始化尺寸为size,初始化位置position=(x 0,y 0),目标实体的尺寸为size′,则可以根据目标实体的尺寸和初始化尺寸,计算出比例b=size′/size,从而可以根据比例b,将 目标实体的尺寸调整至所述初始化尺寸,得到尺寸变换后的目标实体。尺寸变换后的目标实体的顶点的集合可以记为A={a 1,a 2,...,a n},其中,n表示目标实体的顶点数量。目标实体的第i个顶点a i的坐标可以记为(x i,y i),其中,1≤i≤n。由于虚拟物理实体和贴图实体的参考坐标系不同,为了将目标贴图实体贴在目标虚拟物理实体的表面,需要将目标贴图实体与目标虚拟物理实体对齐。遍历集合A中的所有顶点的x坐标,可以得到目标实体的最小的x坐标x min;遍历集合A中的所有顶点的y坐标,可以得到目标实体的最小的y坐标y min。目标实体的左上角坐标可以记为(x min,y min)。在目标实体包括目标虚拟物理实体和目标贴图实体的情况下,可以将所述目标虚拟物理实体和所述目标贴图实体的位置分别设置为所述初始化位置(x 0,y 0)。根据初始化位置(x 0,y 0)和目标实体的左上角坐标(x min,y min),可以计算目标实体的中心点(pivot点)坐标(x p,y p),其中,x p=x 0-x min,y p=y 0-y min。目标实体的顶点a i的坐标可以更新为a′ i=(x i-x min,y i-y min)。由此能够对齐目标虚拟物理实体和目标贴图实体,并能以初始化尺寸和初始化位置对目标虚拟物理实体和目标贴图实体进行初始化。其中,在任一目标实体的轮廓信息包括至少两个凸多边形的轮廓信息的情况下,可以采用类似的方法对每个凸多边形分别进行计算。 For example, if the initialization size is size, the initialization position is position=(x 0 , y 0 ), and the size of the target entity is size′, then the ratio b=size′/size can be calculated according to the size of the target entity and the initialization size, so that According to the ratio b, the size of the target entity is adjusted to the initialization size to obtain a size-transformed target entity. The set of vertices of the target entity after size transformation can be recorded as A={a 1 , a 2 , . . . , a n }, where n represents the number of vertices of the target entity. The coordinates of the i-th vertex a i of the target entity can be recorded as ( xi ,y i ), where 1≤i≤n. Since the reference coordinate systems of the virtual physical entity and the textured entity are different, in order to paste the target textured entity on the surface of the target virtual physical entity, it is necessary to align the target textured entity with the target virtual physical entity. By traversing the x coordinates of all vertices in the set A, the minimum x coordinate x min of the target entity can be obtained; by traversing the y coordinates of all vertices in the set A, the minimum y coordinate y min of the target entity can be obtained. The coordinates of the upper left corner of the target entity can be recorded as (x min , y min ). When the target entity includes a target virtual physical entity and a target texture entity, the positions of the target virtual physical entity and the target texture entity may be respectively set as the initialization positions (x 0 , y 0 ). According to the initialization position (x 0 , y 0 ) and the coordinates of the upper left corner of the target entity (x min , y min ), the coordinates (x p , y p ) of the center point (pivot point) of the target entity can be calculated, where x p = x 0 −x min , y p =y 0 −y min . The coordinates of the vertex a i of the target entity can be updated as a′ i =(xi −x min , y i −y min ). Therefore, the target virtual physical entity and the target texture entity can be aligned, and the target virtual physical entity and the target texture entity can be initialized with the initial size and initial position. Wherein, in the case that the contour information of any target entity includes contour information of at least two convex polygons, a similar method may be used to calculate each convex polygon separately.
作为该实现方式的另一个示例,所述基于所述目标实体,在所述虚拟场景中添加自定义素材,包括:基于所述目标实体和默认的初始化信息,在所述虚拟场景中添加自定义素材。As another example of this implementation, adding a custom material to the virtual scene based on the target entity includes: adding a custom material to the virtual scene based on the target entity and default initialization information. material.
作为该实现方式的一个示例,在所述虚拟场景中添加自定义素材之后,可以通过第一角度设置接口设置目标虚拟物理实体的角度,和/或,可以通过第二角度设置接口设置目标贴图实体的角度。其中,第一角度设置接口和第二角度设置接口可以是根据物理引擎和/或渲染引擎封装的。第一角度设置接口可以用于设置目标虚拟物理实体的角度,第二角度设置接口可以用于设置目标贴图实体的角度。在一个例子中,第一角度设置接口可以命名为setAngle,第二角度设置接口可以命名为rotation。As an example of this implementation, after adding a custom material in the virtual scene, the angle of the target virtual physical entity can be set through the first angle setting interface, and/or, the target texture entity can be set through the second angle setting interface Angle. Wherein, the first angle setting interface and the second angle setting interface may be packaged according to a physics engine and/or a rendering engine. The first angle setting interface can be used to set the angle of the target virtual physical entity, and the second angle setting interface can be used to set the angle of the target texture entity. In an example, the first angle setting interface may be named setAngle, and the second angle setting interface may be named rotation.
在一个例子中,可以响应于通过第一角度设置接口设置目标虚拟物理实体的角度,调用第二角度设置接口设置目标贴图实体的角度,从而将目标贴图实体与目标虚拟物理实体对齐。在另一个例子中,可以响应于通过第二角度设置接口设置目标贴图实体的角度,调用第一角度设置接口设置目标虚拟物理实体的角度,从而将目标虚拟物理实体与目标贴图实体对齐。In one example, in response to setting the angle of the target virtual physical entity through the first angle setting interface, the second angle setting interface may be called to set the angle of the target texture entity, thereby aligning the target texture entity with the target virtual physical entity. In another example, in response to setting the angle of the target texture entity through the second angle setting interface, the first angle setting interface may be called to set the angle of the target virtual physical entity, so as to align the target virtual physical entity with the target texture entity.
在一个例子中,在第一角度设置接口与第二角度设置接口采用不同的角度单位的情况下,可以在单位换算后进行角度设置。例如,在第一角度设置接口采用弧度(radian),第二角度设置接口采用角度(degree,也称为度)的情况下,可以响应于通过第一角度设置接口设置目标虚拟物理实体的弧度,将弧度转换为角度,并调用第二角度设置接口设置目标贴图实体的角度。In an example, when the first angle setting interface and the second angle setting interface use different angle units, the angle setting can be performed after unit conversion. For example, in the case where the first angle setting interface uses radians and the second angle setting interface uses angles (degree, also referred to as degrees), in response to setting the radian of the target virtual physical entity through the first angle setting interface, Convert radians to angles, and call the second angle setting interface to set the angle of the target texture entity.
作为该实现方式的一个示例,在所述虚拟场景中添加自定义素材之后,所述方法还包括:基于所述用户输入的交互方式代码,设置所述自定义素材的交互方式。其中,交互方式代码可以表示用于设置自定义素材的交互方式的代码。用户针对自定义素材设置的交互方式可以包括点击、拖动、调整尺寸、添加特效等,在此不做限定。例如,可以将旋转接口和位置接口提供给用户,从而供用户代码调用旋转接口和位置接口设置自定义素材的交互方式。其中,旋转接口可以用于在虚拟场景中旋转自定义素材,位置接口可以用于在虚拟场景中设置自定义素材的位置。旋转接口和位置接口可以是根据物理引擎和/或渲染引擎封装的。在一个例子中,旋转接口可以命名为rotate,位置接口可以命名为position。在该示例中,能够基于用户输入的交互方式代码灵活地设置自定义素材的交互方式,从而能够解决虚拟场景中素材不能交互或交互方式固化的问题。另外,通过用户编程的方式完成虚拟场景中自定义素材的交互方式的设置,自定义素材的交互方式的设置方式与编程教学内容紧密结合,从而能够通过自定义素材的交互方式的设置过程促进编程知识的吸收。As an example of this implementation manner, after the custom material is added to the virtual scene, the method further includes: setting an interaction mode of the custom material based on the interaction mode code input by the user. Wherein, the interaction method code may represent a code for setting the interaction method of the custom material. The interaction mode set by the user for the custom material may include clicking, dragging, resizing, adding special effects, etc., which are not limited here. For example, a rotation interface and a position interface can be provided to the user, so that the user code can call the rotation interface and the position interface to set the interaction mode of the custom material. Among them, the rotation interface can be used to rotate the custom material in the virtual scene, and the position interface can be used to set the position of the custom material in the virtual scene. The rotation interface and position interface can be packaged according to the physics engine and/or the rendering engine. In one example, the rotation interface can be named rotate and the position interface can be named position. In this example, the interaction mode of the custom material can be flexibly set based on the interaction mode code input by the user, so as to solve the problem that the material in the virtual scene cannot interact or the interaction mode is fixed. In addition, the setting of the interactive mode of the custom material in the virtual scene is completed through user programming, and the setting method of the interactive mode of the custom material is closely integrated with the programming teaching content, so that programming can be promoted through the setting process of the interactive mode of the custom material knowledge absorption.
作为该实现方式的一个示例,在所述虚拟场景中添加自定义素材之后,所述方法还包括: 通过物理引擎,确定自定义素材在所述虚拟场景中呈现的状态信息。在该示例中,物理引擎可以是预设的,也可以是基于用户代码实现的,在此不做限定。物理引擎可以通过为自定义素材赋予真实的物理属性的方式来计算运动、旋转和碰撞等中的至少之一。根据该示例,通过物理引擎确定自定义素材在所述虚拟场景中呈现的状态信息,由此在虚拟场景中添加自定义素材之后,能够即时确定自定义素材的物理效果,使自定义素材遵从物理原则运动,用户不需要对虚拟场景中的不同素材进行碰撞处理,无需设定动作规则,从而能够提高虚拟场景设定的便捷性。As an example of this implementation manner, after the custom material is added to the virtual scene, the method further includes: using a physics engine, determining status information of the custom material presented in the virtual scene. In this example, the physics engine may be preset or implemented based on user code, which is not limited here. The physics engine can calculate at least one of motion, rotation, collision, etc. by assigning real physical properties to the custom material. According to this example, the state information of the custom material presented in the virtual scene is determined by the physics engine, so that after adding the custom material in the virtual scene, the physical effect of the custom material can be determined immediately, so that the custom material complies with the physical Principle movement, users do not need to collide with different materials in the virtual scene, and do not need to set action rules, which can improve the convenience of virtual scene setting.
本公开实施例提供的虚拟场景的素材处理方法可以应用于编程教育、教育游戏、教育基础平台、虚拟场景等应用场景中。本公开实施例提供的虚拟场景的素材处理方法可以应用于网页(World Wide Web,Web)端,也可以应用于个人计算机(Personal Computer,PC)端软件或者移动端软件等,在此不做限定。The method for processing materials of a virtual scene provided by the embodiments of the present disclosure can be applied to application scenarios such as programming education, educational games, educational basic platforms, and virtual scenes. The material processing method of the virtual scene provided by the embodiment of the present disclosure can be applied to the webpage (World Wide Web, Web) end, and can also be applied to the personal computer (Personal Computer, PC) end software or mobile end software, etc., which is not limited here. .
下面通过一个应用场景说明本公开实施例提供的虚拟场景的素材处理方法。在该应用场景中,可以获取用户自定义的第一素材图像,其中,第一素材图像为SVG。可以基于用户输入的素材生成代码,读取第一素材图像的<path>元素,并遍历<path>元素中的每一段路径,得到第一素材图像的轮廓信息。基于所述轮廓信息,可以生成第一素材图像对应的第一虚拟物理实体;基于所述轮廓信息和第一素材图像,可以生成第一素材图像对应的第一贴图实体。其中,第一虚拟物理实体可以具有第一标识信息,第一贴图实体可以具有第二标识信息。第一虚拟物理实体的属性可以包括轮廓属性,第一虚拟物理实体的轮廓属性的属性值可以包括第一虚拟物理实体的各个顶点的坐标。第一贴图实体的属性可以包括轮廓属性和图像属性,第一贴图实体的轮廓属性的属性值可以包括第一贴图实体的各个顶点的坐标,第一贴图实体的图像属性的属性值为第一素材图像。可以响应于用户输入的素材添加代码,基于素材添加代码中的标识信息,获取目标实体。例如,在素材添加代码包括第一标识信息和第二标识信息的情况下,可以根据第一标识信息获取第一虚拟物理实体,并根据第二标识信息获取第一贴图实体。可以基于用户输入的初始化代码和目标实体,在虚拟场景中添加自定义素材。可以基于用户输入的交互方式代码,设置所述自定义素材的交互方式,并可以通过物理引擎,确定自定义素材在所述虚拟场景中呈现的状态信息。The material processing method for a virtual scene provided by an embodiment of the present disclosure is described below through an application scenario. In this application scenario, a user-defined first material image may be acquired, where the first material image is SVG. The code may be generated based on the material input by the user, read the <path> element of the first material image, and traverse each path in the <path> element to obtain the outline information of the first material image. Based on the outline information, a first virtual physical entity corresponding to the first material image may be generated; based on the outline information and the first material image, a first texture entity corresponding to the first material image may be generated. Wherein, the first virtual physical entity may have first identification information, and the first texture entity may have second identification information. The attributes of the first virtual physical entity may include outline attributes, and the attribute values of the outline attributes of the first virtual physical entity may include coordinates of vertices of the first virtual physical entity. The attributes of the first texture entity may include outline attributes and image attributes, the attribute value of the outline attribute of the first texture entity may include the coordinates of each vertex of the first texture entity, and the attribute value of the image attribute of the first texture entity is the first material image. The target entity may be acquired based on identification information in the material addition code in response to the material addition code input by the user. For example, in the case that the material adding code includes first identification information and second identification information, the first virtual physical entity may be obtained according to the first identification information, and the first texture entity may be obtained according to the second identification information. Custom assets can be added to virtual scenes based on initialization code and target entities entered by the user. The interaction mode of the custom material can be set based on the interaction mode code input by the user, and the state information of the custom material presented in the virtual scene can be determined through the physics engine.
下面通过四个示例介绍本公开实施例提供的虚拟场景的素材处理方法的使用场景。The following uses four examples to introduce usage scenarios of the material processing method for a virtual scene provided by the embodiment of the present disclosure.
示例一:采用本公开实施例提供的虚拟场景的素材处理方法,老师制作虚拟场景的过程可以成为新的编程课程内容。例如,老师添加素材P 1、P 2、P 3、P 4和P 5完成基础的虚拟场景,通过采用本公开实施例提供的虚拟场景的素材处理方法,可以将添加素材P 1、P 2、P 3、P 4和P 5的过程转化为新的编程课程内容。 Example 1: By adopting the material processing method of the virtual scene provided by the embodiment of the present disclosure, the process of making the virtual scene by the teacher can become a new programming course content. For example, the teacher adds materials P 1 , P 2 , P 3 , P 4 and P 5 to complete the basic virtual scene, and by using the material processing method of the virtual scene provided by the embodiment of the present disclosure, the added materials P 1 , P 2 , P 2 , The processes of P 3 , P 4 and P 5 are translated into new programming course content.
示例二:老师根据特定情景制作新的教学内容,希望可以达到交互个性化的同时,让每个学生完成不同的个性化作品。老师可以通过使用本公开实施例提供的虚拟场景的素材处理方法,创作虚拟场景V 0,带领学生在虚拟场景V 0中继续丰富为不同的个性化场景V 1、V 2和V 3Example 2: The teacher creates new teaching content according to specific scenarios, hoping to achieve interactive personalization and let each student complete different personalized works. The teacher can create the virtual scene V 0 by using the material processing method of the virtual scene provided by the embodiment of the present disclosure, and lead the students to continue enriching the virtual scene V 0 into different personalized scenes V 1 , V 2 and V 3 .
示例三:采用本公开实施例提供的虚拟场景的素材处理方法,学生完成的作业可以转换为新的课程预置内容。例如,学生S 1、S 2和S 3分别使用代码创作了三个不同的虚拟场景,该三份代码均可以转换为供老师使用的教学场景。不需要整个项目打包迁移等,直接使用代码即可。 Example 3: Using the virtual scene material processing method provided by the embodiment of the present disclosure, the homework completed by the students can be converted into new course preset content. For example, students S 1 , S 2 and S 3 respectively use codes to create three different virtual scenes, and all three copies of codes can be converted into teaching scenes for teachers. There is no need to package and migrate the entire project, just use the code directly.
示例四:老师需要制作可交互教学内容,希望学生根据内容自发编写算法,可以使用本公开实施例提供的虚拟场景的素材处理方法,创作符合要求的虚拟场景和动态关卡,开放部分接口和控制资源给学生,激发学生编写算法完成教学关卡。Example 4: The teacher needs to create interactive teaching content, and students are expected to write algorithms spontaneously according to the content. They can use the virtual scene material processing method provided by the disclosed embodiment to create virtual scenes and dynamic levels that meet the requirements, and open some interfaces and control resources. For students, inspire students to write algorithms to complete the teaching levels.
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例。本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的执行顺序应当以其功能和可能的内在逻辑确定。It can be understood that the above-mentioned method embodiments mentioned in this disclosure can all be combined with each other to form a combined embodiment without violating the principle and logic. Those skilled in the art can understand that, in the above method in the specific implementation manner, the execution sequence of each step should be determined by its function and possible internal logic.
此外,本公开还提供了虚拟场景的素材处理装置、电子设备、计算机可读存储介质、计算机程序产品,上述均可用来实现本公开提供的任一种虚拟场景的素材处理方法,相应技术 方案和技术效果可参见方法部分的相应记载。In addition, the present disclosure also provides a material processing device for a virtual scene, electronic equipment, a computer-readable storage medium, and a computer program product, all of which can be used to implement any material processing method for a virtual scene provided in the present disclosure, corresponding technical solutions and The technical effects can be found in the corresponding records in the method section.
图4示出本公开实施例提供的虚拟场景的素材处理装置的框图。如图4所示,所述虚拟场景的素材处理装置包括:Fig. 4 shows a block diagram of a material processing device for a virtual scene provided by an embodiment of the present disclosure. As shown in Figure 4, the material processing device of described virtual scene comprises:
第一获取部分41,被配置为获取用户自定义的虚拟场景的第一素材图像;The first acquisition part 41 is configured to acquire a first material image of a user-defined virtual scene;
提取部分42,被配置为基于所述用户输入的素材生成代码,提取所述第一素材图像的轮廓信息;The extraction part 42 is configured to extract the contour information of the first material image based on the material generation code input by the user;
生成部分43,被配置为基于所述轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体;和/或,基于所述轮廓信息和所述第一素材图像,生成所述第一素材图像对应的第一贴图实体。The generating part 43 is configured to generate a first virtual physical entity corresponding to the first material image based on the outline information; and/or generate the first virtual physical entity based on the outline information and the first material image. The first texture entity corresponding to the material image.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
第二获取部分,被配置为基于所述用户输入的素材添加代码,获取目标实体,其中,所述目标实体至少包括目标虚拟物理实体;The second acquiring part is configured to add a code based on the material input by the user to acquire a target entity, wherein the target entity includes at least a target virtual physical entity;
第一添加部分,被配置为基于所述目标实体,在所述虚拟场景中添加自定义素材。The first adding part is configured to add custom material in the virtual scene based on the target entity.
在一种可能的实现方式中,所述目标实体包括以下任意一项:In a possible implementation manner, the target entity includes any of the following:
所述第一虚拟物理实体和所述第一贴图实体;the first virtual physical entity and the first texture entity;
所述第一虚拟物理实体;said first virtual physical entity;
所述第一虚拟物理实体和第二贴图实体,其中,所述第二贴图实体基于第二素材图像生成;The first virtual physical entity and the second texture entity, wherein the second texture entity is generated based on a second material image;
第二虚拟物理实体和所述第一贴图实体,其中,所述第二虚拟物理实体基于第三素材图像生成。The second virtual physical entity and the first texture entity, wherein the second virtual physical entity is generated based on a third material image.
在一种可能的实现方式中,所述所述装置还包括:第二添加部分,被配置为基于所述用户输入的初始化代码和所述目标实体,在所述虚拟场景中添加自定义素材。In a possible implementation manner, the apparatus further includes: a second adding part configured to add custom material in the virtual scene based on the initialization code input by the user and the target entity.
在一种可能的实现方式中,所述初始化代码中的初始化信息包括初始化尺寸和初始化位置;所述第二添加部分,被配置为在所述目标实体包括目标虚拟物理实体和目标贴图实体的情况下,基于所述初始化尺寸,调整所述目标虚拟物理实体和所述目标贴图实体的尺寸,得到尺寸变换后的目标虚拟物理实体和尺寸变换后的目标贴图实体;基于所述初始化位置,对齐所述尺寸变换后的目标虚拟物理实体和所述尺寸变换后的目标贴图实体;将对齐后的所述尺寸变换后的目标虚拟物理实体和所述尺寸变换后的目标贴图实体,添加在所述虚拟场景中。In a possible implementation manner, the initialization information in the initialization code includes an initialization size and an initialization position; the second adding part is configured to include a target virtual physical entity and a target texture entity when the target entity includes Next, based on the initialization size, adjust the size of the target virtual physical entity and the target texture entity to obtain a size-transformed target virtual physical entity and a size-transformed target texture entity; based on the initialization position, align all The size-transformed target virtual physical entity and the size-transformed target texture entity; the aligned size-transformed target virtual physical entity and the size-transformed target texture entity are added to the virtual scene.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
设置部分,被配置为基于所述用户输入的交互方式代码,设置所述自定义素材的交互方式。The setting part is configured to set the interaction mode of the custom material based on the interaction mode code input by the user.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
确定部分,被配置为通过物理引擎,确定所述自定义素材在所述虚拟场景中呈现的状态信息。The determining part is configured to determine the status information of the custom material presented in the virtual scene through the physics engine.
在一种可能的实现方式中,所述生成部分43,被配置为在所述轮廓信息包括曲线段的情况下,将所述曲线段调整为线段,得到调整后的轮廓信息;In a possible implementation manner, the generating part 43 is configured to adjust the curve segment into a line segment when the profile information includes a curve segment, and obtain the adjusted profile information;
基于所述调整后的轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体。Based on the adjusted outline information, a first virtual physical entity corresponding to the first material image is generated.
在一种可能的实现方式中,所述提取部分42,被配置为响应于所述第一素材图像不为可缩放的矢量图形SVG,提取所述第一素材图像的顶点信息;In a possible implementation manner, the extracting part 42 is configured to extract the vertex information of the first material image in response to the fact that the first material image is not a scalable vector graphics SVG;
基于所述顶点信息,提取所述第一素材图像的轮廓信息。Based on the vertex information, outline information of the first material image is extracted.
在一种可能的实现方式中,所述提取部分42,被配置为响应于所述第一素材图像为SVG,提取所述第一素材图像的路径信息;In a possible implementation manner, the extracting part 42 is configured to extract path information of the first material image in response to the fact that the first material image is SVG;
基于所述路径信息,确定所述第一素材图像的轮廓信息。Based on the path information, contour information of the first material image is determined.
在本公开实施例中,通过获取用户自定义的虚拟场景的第一素材图像,基于所述用户输入的素材生成代码,提取所述第一素材图像的轮廓信息,基于所述轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体,和/或,基于所述轮廓信息和所述第一素材图像,生成所 述第一素材图像对应的第一贴图实体,由此通过用户编程的方式完成素材的生成,素材生成的方式与编程教学内容紧密结合,从而能够通过素材生成过程促进编程知识的吸收。另外,通过生成用户自定义的第一素材图像对应的第一虚拟物理实体和/或第一贴图实体,能够基于一个素材图像获得能够独立使用的虚拟物理实体和/或贴图实体,从而能够提高在虚拟场景中使用素材的灵活性。与相关技术中采用“设计-美术-技术”的流程制作虚拟场景的素材的方式相比,本公开实施例提供的虚拟场景的素材处理方法能够降低虚拟场景制作成本。In the embodiment of the present disclosure, by acquiring the first material image of the user-defined virtual scene, the code is generated based on the material input by the user, the contour information of the first material image is extracted, and the contour information is generated based on the contour information. The first virtual physical entity corresponding to the first material image, and/or, based on the outline information and the first material image, generate the first texture entity corresponding to the first material image, thereby through user programming The method of material generation is completed, and the method of material generation is closely combined with the programming teaching content, so that the absorption of programming knowledge can be promoted through the process of material generation. In addition, by generating the first virtual physical entity and/or the first texture entity corresponding to the user-defined first material image, a virtual physical entity and/or texture entity that can be used independently can be obtained based on a material image, thereby improving Flexibility in using material in virtual sets. Compared with the method in the related art that adopts the process of "design-art-technology" to produce virtual scene materials, the virtual scene material processing method provided by the embodiment of the present disclosure can reduce the cost of virtual scene production.
在本公开实施例以及其他的实施例中,“部分”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是单元,还可以是模块也可以是非模块化的。In the embodiments of the present disclosure and other embodiments, a "part" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course it may also be a unit, a module or a non-modular one.
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其实现和技术效果可以参照上文方法实施例的描述。In some embodiments, the functions or modules included in the apparatus provided by the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments, and its implementation and technical effects can refer to the descriptions of the above method embodiments.
本公开实施例还提供一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。其中,所述计算机可读存储介质可以是非易失性计算机可读存储介质,或者可以是易失性计算机可读存储介质。An embodiment of the present disclosure also provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented. Wherein, the computer-readable storage medium may be a non-volatile computer-readable storage medium, or may be a volatile computer-readable storage medium.
本公开实施例还提出一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述方法。An embodiment of the present disclosure also proposes a computer program, including computer readable codes. When the computer readable codes are run in an electronic device, a processor in the electronic device executes the above method.
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述方法。An embodiment of the present disclosure also provides a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are run in an electronic device , the processor in the electronic device executes the above method.
本公开实施例还提供一种电子设备,包括:一个或多个处理器;用于存储可执行指令的存储器;其中,所述一个或多个处理器被配置为调用所述存储器存储的可执行指令,以执行上述方法。An embodiment of the present disclosure also provides an electronic device, including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to call the executable instructions stored in the memory instruction to perform the above method.
电子设备可以被提供为终端、服务器或其它形态的设备。Electronic devices may be provided as terminals, servers, or other forms of devices.
图5示出本公开实施例提供的一种电子设备800的框图。例如,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。FIG. 5 shows a block diagram of an electronic device 800 provided by an embodiment of the present disclosure. For example, the electronic device 800 may be a terminal such as a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, or a personal digital assistant.
如图5所示,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(Input/Output,I/O)的接口812,传感器组件814,以及通信组件816。As shown in FIG. 5, the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input/output (Input/Output, I/O) interface 812 , sensor component 814 , and communication component 816 .
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。The processing component 802 generally controls the overall operations of the electronic device 800, such as those associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802 .
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(Static Random Access Memory,SRAM),电可擦除可编程只读存储器(Electrically Erasable Programmable Read Only Memory,EEPROM),可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM),可编程只读存储器(Programmable Read Only Memory,PROM),只读存储器(Read Only Memory,ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 804 is configured to store various types of data to support operations at the electronic device 800 . Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. Memory 804 can be realized by any type of volatile or non-volatile storage device or their combination, such as Static Random Access Memory (Static Random Access Memory, SRAM), Electrically Erasable Programmable Read-Only Memory (Electrically Erasable Programmable Read Only Memory, EEPROM), Erasable Programmable Read Only Memory (Erasable Programmable Read Only Memory, EPROM), Programmable Read Only Memory (Programmable Read Only Memory, PROM), Read Only Memory (Read Only Memory, ROM) , magnetic memory, flash memory, magnetic disk or optical disk.
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。The power supply component 806 provides power to various components of the electronic device 800 . Power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 800 .
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(Liquid Crystal Display,LCD)和触摸面板(Touch Panel,TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸 传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。The multimedia component 808 includes a screen providing an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (Liquid Crystal Display, LCD) and a touch panel (Touch Panel, TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or slide action, but also detect duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(Microphone,MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a microphone (Microphone, MIC), and when the electronic device 800 is in an operation mode, such as a calling mode, a recording mode and a voice recognition mode, the microphone is configured to receive an external audio signal. Received audio signals may be further stored in memory 804 or sent via communication component 816 . In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如互补金属氧化物半导体(Complementary Metal Oxide Semiconductor,CMOS)或电荷耦合装置(Charge Coupled Device,CCD)图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of electronic device 800 . For example, the sensor component 814 can detect the open/closed state of the electronic device 800, the relative positioning of components, such as the display and the keypad of the electronic device 800, the sensor component 814 can also detect the electronic device 800 or a Changes in position of components, presence or absence of user contact with electronic device 800 , electronic device 800 orientation or acceleration/deceleration and temperature changes in electronic device 800 . Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor assembly 814 may also include an optical sensor, such as a Complementary Metal Oxide Semiconductor (CMOS) or Charge Coupled Device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如无线网络(Wi-Fi)、第二代移动通信技术(The 2nd Generation Mobile Communication Technology,2G)、第三代移动通信技术(The 3nd Generation Mobile Communication Technology,3G)、第四代移动通信技术(The 4th Generation Mobile Communication Technology,4G)、通用移动通信技术的长期演进(Long Term Evolution,LTE)、第五代移动通信技术(The 5th Generation Mobile Communication Technology,5G)或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(Near Field Communication,NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(Radio Frequency Identification,RFID)技术,红外数据协会(Infrared Data Association,IrDA)技术,超宽带(Ultra Wide Band,UWB)技术,蓝牙(Bluetooth,BT)技术和其他技术来实现。The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access wireless networks based on communication standards, such as wireless networks (Wi-Fi), second generation mobile communication technology (The 2nd Generation Mobile Communication Technology, 2G), third generation mobile communication technology (The 3rd Generation Mobile Communication Technology, 3G), the fourth generation mobile communication technology (The 4th Generation Mobile Communication Technology, 4G), the long-term evolution of general mobile communication technology (Long Term Evolution, LTE), the fifth generation mobile communication technology (The 5th Generation Mobile Communication Technology, 5G) or their combination. In an exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be based on Radio Frequency Identification (RFID) technology, Infrared Data Association (Infrared Data Association, IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (Bluetooth, BT) technology and other technology to achieve.
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(Digital Signal Processing Device,DSPD)、可编程逻辑器件(programmable logic device,PLD)、现场可编程门阵列(Field Programmable Gate Array,FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (Digital Signal Processing Device , DSPD), programmable logic device (programmable logic device, PLD), field programmable gate array (Field Programmable Gate Array, FPGA), controller, microcontroller, microprocessor or other electronic components to implement, used to perform the above method.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。In an exemplary embodiment, there is also provided a non-volatile computer-readable storage medium, such as the memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to implement the above method.
图6示出本公开实施例提供的另一电子设备1900的框图。例如,电子设备1900可以被提供为一服务器。如图6所示,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对 应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。FIG. 6 shows a block diagram of another electronic device 1900 provided by an embodiment of the present disclosure. For example, electronic device 1900 may be provided as a server. As shown in FIG. 6 , electronic device 1900 includes processing component 1922 , which further includes one or more processors, and a memory resource represented by memory 1932 for storing instructions executable by processing component 1922 , such as application programs. The application program stored in memory 1932 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如微软服务器操作系统(Windows Server TM),苹果公司推出的基于图形用户界面操作系统(Mac OS X TM),多用户多进程的计算机操作系统(Unix TM),自由和开放原代码的类Unix操作系统(Linux TM),开放原代码的类Unix操作系统(FreeBSD TM)或类似。 Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input-output (I/O) interface 1958 . The electronic device 1900 can operate based on the operating system stored in the memory 1932, such as the Microsoft server operating system (Windows Server TM ), the graphical user interface-based operating system (Mac OS X TM ) introduced by Apple Inc., and the multi-user and multi-process computer operating system (Unix ), a free and open source Unix-like operating system (Linux ), an open source Unix-like operating system (FreeBSD ), or the like.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium, such as the memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to implement the above method.
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。The present disclosure can be a system, method and/or computer program product. A computer program product may include a computer readable storage medium having computer readable program instructions thereon for causing a processor to implement various aspects of the present disclosure.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是但不限于电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更详细的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(Random Access Memory,RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、数字多功能盘(Digital Video Disc,DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device. A computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More detailed examples (non-exhaustive list) of computer-readable storage media include: portable computer diskette, hard disk, random access memory (Random Access Memory, RAM), read-only memory (ROM), erasable programmable Read memory (EPROM or flash memory), Static Random Access Memory (SRAM), Compact Disc Read-Only Memory (CD-ROM), Digital Video Disc (DVD), Memory Stick , a floppy disk, a mechanically encoded device, such as a punched card or a raised structure in a groove with instructions stored thereon, and any suitable combination of the foregoing. As used herein, computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。Computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or a network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(Instruction Set Architecture,ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言,诸如Smalltalk、C++等,以及常规的过程式编程语言,诸如C语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络,包括局域网(Local Area Network,LAN)或广域网(Wide Area Network,WAN)连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(Programmable Logic Array,PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。Computer program instructions for performing the operations of the present disclosure may be assembly instructions, Instruction Set Architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or in the form of one or more source or object code written in any combination of programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as C or similar programming languages. Computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement. In cases involving a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it may be connected to an external computer (for example, using Internet Service Provider to connect via the Internet). In some embodiments, by utilizing the state information of computer-readable program instructions to personalize and customize electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGA) or programmable logic arrays (Programmable Logic Array, PLA), The electronic circuitry can execute computer readable program instructions to implement various aspects of the present disclosure.
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It should be understood that each block of the flowcharts and/or block diagrams, and combinations of blocks in the flowcharts and/or block diagrams, can be implemented by computer-readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、 可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine such that when executed by the processor of the computer or other programmable data processing apparatus , producing an apparatus for realizing the functions/actions specified in one or more blocks in the flowchart and/or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause computers, programmable data processing devices and/or other devices to work in a specific way, so that the computer-readable medium storing instructions includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks in flowcharts and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。It is also possible to load computer-readable program instructions into a computer, other programmable data processing device, or other equipment, so that a series of operational steps are performed on the computer, other programmable data processing device, or other equipment to produce a computer-implemented process , so that instructions executed on computers, other programmable data processing devices, or other devices implement the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, a portion of a program segment, or an instruction that includes one or more Executable instructions. In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or action , or may be implemented by a combination of dedicated hardware and computer instructions.
该计算机程序产品可以通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品体现为计算机存储介质,在另一个可选实施例中,计算机程序产品体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。The computer program product can be realized by hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) and the like.
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。Having described various embodiments of the present disclosure above, the foregoing description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and alterations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principle of each embodiment, practical application or improvement of technology in the market, or to enable other ordinary skilled in the art to understand each embodiment disclosed herein.
工业实用性Industrial Applicability
本公开实施例提供了一种虚拟场景的素材处理方法及装置、电子设备、存储介质和计算机程序产品,其中,虚拟场景的素材处理方法包括:获取用户自定义的虚拟场景的第一素材图像;基于所述用户输入的素材生成代码,提取所述第一素材图像的轮廓信息;基于所述轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体;和/或,基于所述轮廓信息和所述第一素材图像,生成所述第一素材图像对应的第一贴图实体。上述方案通过用户编程的方式完成素材的生成,素材生成的方式与编程教学内容紧密结合,从而能够通过素材生成过程促进编程知识的吸收。另外,通过生成用户自定义的第一素材图像对应的第一虚拟物理实体和/或第一贴图实体,能够基于一个素材图像获得能够独立使用的虚拟物理实体和/或贴图实体,从而能够提高在虚拟场景中使用素材的灵活性。与相关技术中采用”设计-美术-技术”的流程制作虚拟场景的素材的方式相比,本公开实施例提供的虚拟场景的素材处理方法能够降低虚拟场景制作成本。Embodiments of the present disclosure provide a material processing method and device for a virtual scene, an electronic device, a storage medium, and a computer program product, wherein the material processing method for a virtual scene includes: acquiring a first material image of a user-defined virtual scene; Based on the material generation code input by the user, extract the outline information of the first material image; based on the outline information, generate a first virtual physical entity corresponding to the first material image; and/or, based on the outline Information and the first material image to generate a first texture entity corresponding to the first material image. The above solution completes the generation of materials through user programming, and the method of material generation is closely integrated with programming teaching content, so that the absorption of programming knowledge can be promoted through the material generation process. In addition, by generating the first virtual physical entity and/or the first texture entity corresponding to the user-defined first material image, a virtual physical entity and/or texture entity that can be used independently can be obtained based on a material image, thereby improving Flexibility in using material in virtual sets. Compared with the method in the related art that uses the process of "design-art-technology" to produce virtual scene materials, the method for processing virtual scene materials provided by the embodiments of the present disclosure can reduce the cost of virtual scene production.

Claims (14)

  1. 一种虚拟场景的素材处理方法,包括:A material processing method for a virtual scene, comprising:
    获取用户自定义的虚拟场景的第一素材图像;Acquiring the first material image of the user-defined virtual scene;
    基于所述用户输入的素材生成代码,提取所述第一素材图像的轮廓信息;extracting contour information of the first material image based on the material generation code input by the user;
    基于所述轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体;和/或,基于所述轮廓信息和所述第一素材图像,生成所述第一素材图像对应的第一贴图实体。Based on the outline information, generate a first virtual physical entity corresponding to the first material image; and/or, based on the outline information and the first material image, generate a first texture corresponding to the first material image entity.
  2. 根据权利要求1所述的方法,其中,在所述生成所述第一素材图像对应的第一虚拟物理实体和所述生成所述第一素材图像对应的第一贴图实体之后,所述方法还包括:The method according to claim 1, wherein, after said generating the first virtual physical entity corresponding to the first material image and said generating the first texture entity corresponding to the first material image, said method further include:
    基于所述用户输入的素材添加代码,获取目标实体,其中,所述目标实体至少包括目标虚拟物理实体;Adding a code based on the material input by the user to obtain a target entity, wherein the target entity includes at least a target virtual physical entity;
    基于所述目标实体,在所述虚拟场景中添加自定义素材。Based on the target entity, add custom material in the virtual scene.
  3. 根据权利要求2所述的方法,其中,所述目标实体包括以下任意一项:The method according to claim 2, wherein the target entity comprises any of the following:
    所述第一虚拟物理实体和所述第一贴图实体;the first virtual physical entity and the first texture entity;
    所述第一虚拟物理实体;said first virtual physical entity;
    所述第一虚拟物理实体和第二贴图实体,其中,所述第二贴图实体基于第二素材图像生成;The first virtual physical entity and the second texture entity, wherein the second texture entity is generated based on a second material image;
    第二虚拟物理实体和所述第一贴图实体,其中,所述第二虚拟物理实体基于第三素材图像生成。The second virtual physical entity and the first texture entity, wherein the second virtual physical entity is generated based on a third material image.
  4. 根据权利要求2或3任意一项所述的方法,其中,所述在所述生成所述第一素材图像对应的第一虚拟物理实体和所述生成所述第一素材图像对应的第一贴图实体之后,所述方法还包括:The method according to any one of claims 2 or 3, wherein the first virtual physical entity corresponding to the generating of the first material image and the first texture corresponding to the generating of the first material image After the entity, the method also includes:
    基于所述用户输入的初始化代码和所述目标实体,在所述虚拟场景中添加自定义素材。Adding custom materials in the virtual scene based on the initialization code input by the user and the target entity.
  5. 根据权利要求4所述的方法,其中,所述初始化代码中的初始化信息包括初始化尺寸和初始化位置;The method according to claim 4, wherein the initialization information in the initialization code includes an initialization size and an initialization position;
    所述基于所述用户输入的初始化代码和所述目标实体,在所述虚拟场景中添加自定义素材,包括:The adding custom material in the virtual scene based on the initialization code input by the user and the target entity includes:
    在所述目标实体包括目标虚拟物理实体和目标贴图实体的情况下,基于所述初始化尺寸,调整所述目标虚拟物理实体和所述目标贴图实体的尺寸,得到尺寸变换后的目标虚拟物理实体和尺寸变换后的目标贴图实体;In the case where the target entity includes a target virtual physical entity and a target texture entity, based on the initial size, adjust the size of the target virtual physical entity and the target texture entity to obtain a size-transformed target virtual physical entity and The target texture entity after size transformation;
    基于所述初始化位置,对齐所述尺寸变换后的目标虚拟物理实体和所述尺寸变换后的目标贴图实体;Aligning the size-transformed target virtual physical entity and the size-transformed target texture entity based on the initialization position;
    将对齐后的所述尺寸变换后的目标虚拟物理实体和所述尺寸变换后的目标贴图实体,添加在所述虚拟场景中。Adding the aligned size-transformed target virtual physical entity and the size-transformed target texture entity to the virtual scene.
  6. 根据权利要求2至5中任意一项所述的方法,其中,在所述虚拟场景中添加自定义素材之后,所述方法还包括:The method according to any one of claims 2 to 5, wherein, after adding custom materials in the virtual scene, the method further comprises:
    基于所述用户输入的交互方式代码,设置所述自定义素材的交互方式。Based on the interaction mode code input by the user, the interaction mode of the custom material is set.
  7. 根据权利要求2至6中任意一项所述的方法,其中,在所述虚拟场景中添加自定义素材之后,所述方法还包括:The method according to any one of claims 2 to 6, wherein, after adding custom materials in the virtual scene, the method further comprises:
    通过物理引擎,确定所述自定义素材在所述虚拟场景中呈现的状态信息。The state information of the custom material presented in the virtual scene is determined through a physics engine.
  8. 根据权利要求1至7中任意一项所述的方法,其中,所述基于所述轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体,包括:The method according to any one of claims 1 to 7, wherein said generating a first virtual physical entity corresponding to said first material image based on said outline information comprises:
    在所述轮廓信息包括曲线段的情况下,将所述曲线段调整为线段,得到调整后的轮廓信息;When the contour information includes a curve segment, adjusting the curve segment to a line segment to obtain adjusted contour information;
    基于所述调整后的轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体。Based on the adjusted outline information, a first virtual physical entity corresponding to the first material image is generated.
  9. 根据权利要求1至8中任意一项所述的方法,其中,所述提取所述第一素材图像的轮廓信息,包括:The method according to any one of claims 1 to 8, wherein said extracting the contour information of said first material image comprises:
    响应于所述第一素材图像不为可缩放的矢量图形SVG,提取所述第一素材图像的顶点信息;Extracting vertex information of the first material image in response to the fact that the first material image is not a scalable vector graphics SVG;
    基于所述顶点信息,提取所述第一素材图像的轮廓信息。Based on the vertex information, outline information of the first material image is extracted.
  10. 根据权利要求1至8中任意一项所述的方法,其中,所述提取所述第一素材图像的轮廓信息,包括:The method according to any one of claims 1 to 8, wherein said extracting the contour information of said first material image comprises:
    响应于所述第一素材图像为SVG,提取所述第一素材图像的路径信息;Extracting path information of the first material image in response to the first material image being SVG;
    基于所述路径信息,确定所述第一素材图像的轮廓信息。Based on the path information, contour information of the first material image is determined.
  11. 一种虚拟场景的素材处理装置,包括:A material processing device for a virtual scene, comprising:
    第一获取部分,被配置为获取用户自定义的虚拟场景的第一素材图像;The first acquisition part is configured to acquire the first material image of the user-defined virtual scene;
    提取部分,被配置为基于所述用户输入的素材生成代码,提取所述第一素材图像的轮廓信息;The extraction part is configured to extract the outline information of the first material image based on the material generation code input by the user;
    生成部分,被配置为基于所述轮廓信息,生成所述第一素材图像对应的第一虚拟物理实体;和/或,基于所述轮廓信息和所述第一素材图像,生成所述第一素材图像对应的第一贴图实体。The generating part is configured to generate a first virtual physical entity corresponding to the first material image based on the outline information; and/or generate the first material based on the outline information and the first material image The first texture entity corresponding to the image.
  12. 一种电子设备,包括:An electronic device comprising:
    一个或多个处理器;one or more processors;
    用于存储可执行指令的存储器;memory for storing executable instructions;
    其中,所述一个或多个处理器被配置为调用所述存储器存储的可执行指令,以执行权利要求1至10中任意一项所述的方法。Wherein, the one or more processors are configured to invoke executable instructions stored in the memory to perform the method according to any one of claims 1-10.
  13. 一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现权利要求1至10中任意一项所述的方法。A computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 10 is realized.
  14. 一种计算机程序产品,所述计算机程序产品包括计算机程序或指令,在所述计算机程序或指令在电子设备上运行的情况下,使得所述电子设备执行权利要求1至10中任意一项所述的方法。A computer program product, the computer program product comprising a computer program or an instruction, when the computer program or instruction is run on an electronic device, the electronic device is made to execute any one of claims 1 to 10. Methods.
PCT/CN2022/091009 2021-11-23 2022-05-05 Material processing method and apparatus for virtual scenario, and electronic device, storage medium and computer program product WO2023092950A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111393782.6A CN114119829A (en) 2021-11-23 2021-11-23 Material processing method and device of virtual scene, electronic equipment and storage medium
CN202111393782.6 2021-11-23

Publications (1)

Publication Number Publication Date
WO2023092950A1 true WO2023092950A1 (en) 2023-06-01

Family

ID=80439946

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/091009 WO2023092950A1 (en) 2021-11-23 2022-05-05 Material processing method and apparatus for virtual scenario, and electronic device, storage medium and computer program product

Country Status (2)

Country Link
CN (1) CN114119829A (en)
WO (1) WO2023092950A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117195360A (en) * 2023-09-07 2023-12-08 广东南华工商职业学院 3D scanning-based landscape model design method, system, equipment and medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114119829A (en) * 2021-11-23 2022-03-01 上海商汤科技开发有限公司 Material processing method and device of virtual scene, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160150187A1 (en) * 2013-07-09 2016-05-26 Alcatel Lucent A method for generating an immersive video of a plurality of persons
CN110675496A (en) * 2019-09-27 2020-01-10 武汉中地数码科技有限公司 Mesh subdivision and visualization method and system based on three-dimensional urban geological model
CN111599023A (en) * 2020-04-02 2020-08-28 思创数码科技股份有限公司 Method and device for mass map pasting of urban building models
CN111651152A (en) * 2020-04-27 2020-09-11 北京编程猫科技有限公司 Method and device for transforming figure picture based on graphical programming
CN113254005A (en) * 2021-04-23 2021-08-13 深圳点猫科技有限公司 Material drawing and editing method, device, system and medium based on graphical programming
CN113298858A (en) * 2021-05-21 2021-08-24 广州虎牙科技有限公司 Method, device, terminal and storage medium for generating action of virtual image
CN114119829A (en) * 2021-11-23 2022-03-01 上海商汤科技开发有限公司 Material processing method and device of virtual scene, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160150187A1 (en) * 2013-07-09 2016-05-26 Alcatel Lucent A method for generating an immersive video of a plurality of persons
CN110675496A (en) * 2019-09-27 2020-01-10 武汉中地数码科技有限公司 Mesh subdivision and visualization method and system based on three-dimensional urban geological model
CN111599023A (en) * 2020-04-02 2020-08-28 思创数码科技股份有限公司 Method and device for mass map pasting of urban building models
CN111651152A (en) * 2020-04-27 2020-09-11 北京编程猫科技有限公司 Method and device for transforming figure picture based on graphical programming
CN113254005A (en) * 2021-04-23 2021-08-13 深圳点猫科技有限公司 Material drawing and editing method, device, system and medium based on graphical programming
CN113298858A (en) * 2021-05-21 2021-08-24 广州虎牙科技有限公司 Method, device, terminal and storage medium for generating action of virtual image
CN114119829A (en) * 2021-11-23 2022-03-01 上海商汤科技开发有限公司 Material processing method and device of virtual scene, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117195360A (en) * 2023-09-07 2023-12-08 广东南华工商职业学院 3D scanning-based landscape model design method, system, equipment and medium
CN117195360B (en) * 2023-09-07 2024-04-09 广东南华工商职业学院 3D scanning-based landscape model design method, system, equipment and medium

Also Published As

Publication number Publication date
CN114119829A (en) 2022-03-01

Similar Documents

Publication Publication Date Title
WO2023092950A1 (en) Material processing method and apparatus for virtual scenario, and electronic device, storage medium and computer program product
WO2015188614A1 (en) Method and device for operating computer and mobile phone in virtual world, and glasses using same
US11451619B2 (en) App remote control method and related devices
EP4207083A1 (en) Elastic object rendering method and apparatus, device, and storage medium
US20150063785A1 (en) Method of overlappingly displaying visual object on video, storage medium, and electronic device
KR102068215B1 (en) Method and system for providing contents based on story using virtual reality and augmented reality
CN111464430B (en) Dynamic expression display method, dynamic expression creation method and device
WO2023045207A1 (en) Task processing method and apparatus, electronic device, storage medium, and computer program
WO2023179346A1 (en) Special effect image processing method and apparatus, electronic device, and storage medium
CN110620884B (en) Expression-driven-based virtual video synthesis method and device and storage medium
TWI752473B (en) Image processing method and apparatus, electronic device and computer-readable storage medium
CN112053370A (en) Augmented reality-based display method, device and storage medium
WO2023045941A1 (en) Image processing method and apparatus, electronic device and storage medium
CN112581571B (en) Control method and device for virtual image model, electronic equipment and storage medium
WO2023138559A1 (en) Virtual reality interaction method and apparatus, and device and storage medium
CN112053449A (en) Augmented reality-based display method, device and storage medium
WO2020215789A1 (en) Virtual paintbrush implementing method and apparatus, and computer readable storage medium
JP6433923B2 (en) Providing a specific object location to the device
KR102242324B1 (en) Illuminating a Virtual Environment With Camera Light Data
CN111127469A (en) Thumbnail display method, device, storage medium and terminal
WO2024027819A1 (en) Image processing method and apparatus, device, and storage medium
WO2023197912A1 (en) Image processing method and apparatus, device, storage medium, and program product
WO2023051356A1 (en) Virtual object display method and apparatus, and electronic device and storage medium
CN112257594A (en) Multimedia data display method and device, computer equipment and storage medium
CN109636917B (en) Three-dimensional model generation method, device and hardware device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22897050

Country of ref document: EP

Kind code of ref document: A1