Texture display methods, devices, and electronic terminals

By determining the 3D coordinates of the graffiti operation points on the graphical user interface and converting them into the UV coordinates of the sphere, the problem of poor display effect of graffiti texture on the surface of a 3D sphere is solved, and the graffiti handwriting is clearly displayed on the surface of the sphere, thus improving the user experience.

CN116012511BActive Publication Date: 2026-07-17NETEASE (HANGZHOU) NETWORK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2022-10-20
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Existing technologies for displaying graffiti textures on the surface of a three-dimensional sphere have poor display effects and cannot clearly display graffiti strokes on the surface of a three-dimensional sphere.

Method used

By responding to graffiti operations on the graphical user interface, the three-dimensional coordinates of the graffiti operation point in the world coordinate system of the virtual scene space are determined, and the graffiti coordinates are converted into UV coordinates on the surface of a sphere using a specified transformation matrix. The graffiti texture is then displayed on the sphere based on the UV coordinates and the display size of the preset texture.

Benefits of technology

It improves the display accuracy of graffiti textures on the surface of 3D spheres, ensuring that the graffiti brush area is clearly displayed on the sphere surface, thus enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116012511B_ABST
    Figure CN116012511B_ABST
Patent Text Reader

Abstract

This disclosure provides a method, apparatus, and electronic terminal for displaying textures, relating to the field of image rendering technology, and alleviates the technical problem of poor display effect of graffiti textures on the surface of a three-dimensional sphere in the prior art. The method includes: in response to a graffiti operation on a sphere in a graphical user interface, determining the three-dimensional coordinates of the operation point corresponding to the graffiti operation on the sphere in the world coordinate system of the virtual scene space; converting the three-dimensional coordinates into first UV coordinates on the surface of the sphere using a specified transformation matrix; and displaying the graffiti texture corresponding to the graffiti operation on the surface of the sphere based on the first UV coordinates and a preset texture display size.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image rendering technology, and in particular to a method, apparatus and electronic terminal for displaying textures. Background Technology

[0002] Currently, with the development of image rendering technology, two-dimensional images can be displayed on three-dimensional models. For example, in game or animation production, users can write or doodle on paper or walls, and the written strokes or doodles can be displayed as two-dimensional images on three-dimensional paper and wall models.

[0003] However, the accuracy of displaying two-dimensional images on the surface of a three-dimensional sphere in the existing technology is low, and it cannot display graffiti textures well on the surface of a three-dimensional sphere, resulting in a poor display effect of graffiti textures on the surface of a three-dimensional sphere. Summary of the Invention

[0004] The purpose of this disclosure is to provide a method, apparatus, and electronic terminal for displaying textures, so as to alleviate the technical problem of poor display effect of graffiti textures on the surface of a three-dimensional sphere in the prior art.

[0005] In a first aspect, embodiments of this disclosure provide a method for displaying textures, which provides a graphical user interface through a terminal device, wherein the content displayed by the graphical user interface includes a sphere located in a virtual scene space; the method includes:

[0006] In response to a drawing operation on the sphere on the graphical user interface, the three-dimensional coordinates of the operation point on the sphere corresponding to the drawing operation in the world coordinate system of the virtual scene space are determined;

[0007] The three-dimensional coordinates are converted into the first UV coordinates on the surface of the sphere using a specified transformation matrix;

[0008] Based on the first UV coordinates and the display size of the preset texture, the graffiti texture corresponding to the graffiti operation is displayed on the sphere.

[0009] Secondly, embodiments of this disclosure provide a texture display device that provides a graphical user interface via a terminal device, wherein the content displayed by the graphical user interface includes a sphere located in a virtual scene space; including:

[0010] A determination module is configured to, in response to a drawing operation on the sphere on the graphical user interface, determine the three-dimensional coordinates of the operation point on the sphere corresponding to the drawing operation in the world coordinate system of the virtual scene space;

[0011] A transformation module is used to convert the three-dimensional coordinates into first UV coordinates on the surface of the sphere using a specified transformation matrix;

[0012] The display module is used to display the graffiti texture corresponding to the graffiti operation on the sphere based on the first UV coordinates and the display size of the preset texture.

[0013] Thirdly, this disclosure also provides an electronic terminal, including a memory and a processor. The memory stores a computer program that can run on the processor, and when the processor executes the computer program, it implements the steps of the method described in the first aspect above.

[0014] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method described in the first aspect above.

[0015] The embodiments disclosed herein bring the following beneficial effects:

[0016] This disclosure provides a method, apparatus, and electronic terminal for displaying textures. First, in response to a drawing operation on a sphere in a graphical user interface, the three-dimensional coordinates of the operation point on the sphere in the world coordinate system of the virtual scene space are determined. Then, a specified transformation matrix is ​​used to convert the three-dimensional coordinates into first UV coordinates on the surface of the sphere. Based on the first UV coordinates and a preset texture display size, the drawing texture corresponding to the drawing operation is displayed on the sphere. In this solution, by using a specified transformation matrix to convert the three-dimensional coordinates of the drawing operation point on the sphere in the world coordinate system of the virtual scene space into UV coordinates on the surface of the sphere, the drawing texture can be directly displayed on the sphere based on these UV coordinates and a preset texture display size. This makes the two-dimensional texture displayed on the surface of the three-dimensional sphere more accurate, allowing for a clearer display of the drawing brush range on the surface of the three-dimensional sphere. This improves the display effect of the drawing texture on the surface of the three-dimensional sphere, alleviates the technical problem of poor display effect of drawing textures on the surface of the three-dimensional sphere in the prior art, and improves the user experience. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1This is a schematic diagram illustrating an application scenario provided by an embodiment of this disclosure;

[0019] Figure 2 This is a schematic diagram of the structure of an electronic terminal provided in an embodiment of the present disclosure;

[0020] Figure 3 This is a schematic diagram illustrating a usage scenario of an electronic terminal provided in an embodiment of this disclosure;

[0021] Figure 4 A flowchart illustrating a method for displaying textures according to an embodiment of this disclosure;

[0022] Figure 5 A graphical user interface diagram provided for an embodiment of this disclosure;

[0023] Figure 6 Another graphical user interface diagram provided for an embodiment of this disclosure;

[0024] Figure 7 Another graphical user interface diagram provided for an embodiment of this disclosure;

[0025] Figure 8 This is a schematic diagram illustrating the intersection of a ray and a sphere, provided in an embodiment of this disclosure.

[0026] Figure 9 A schematic diagram of spatial coordinate transformation provided in an embodiment of this disclosure;

[0027] Figure 10 Another graphical user interface diagram provided for an embodiment of this disclosure;

[0028] Figure 11 A flowchart illustrating another method for displaying textures provided in an embodiment of this disclosure;

[0029] Figure 12 This is a structural schematic of a texture display device provided in an embodiment of the present disclosure. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0031] The terms “comprising” and “having”, and any variations thereof, used in the embodiments of this disclosure are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or devices.

[0032] With existing technology, two-dimensional images can be displayed well on the plane of a three-dimensional virtual object, such as as a texture on one face of a virtual cube. However, they cannot be displayed well on the curved surface of a three-dimensional sphere. For example, if you draw on a three-dimensional sphere, the doodles will not be displayed well.

[0033] Based on this, the present disclosure provides a method, apparatus, and electronic terminal for displaying textures. This method can clearly display the range of a graffiti brush on the surface of a three-dimensional sphere, alleviating the technical problem of poor display effect of graffiti textures on the surface of a three-dimensional sphere in the prior art, and improving the user experience.

[0034] In one embodiment of this disclosure, the texture display method can run on electronic terminals such as terminal devices and server devices. The terminal device can be a local terminal device. When the texture display method runs on a server, the method can be implemented and executed based on a cloud interaction system, which includes a server and client devices.

[0035] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program and the game screen presentation are separated. The storage and execution of texture display methods are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, the terminal device for information processing is the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses game screen data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.

[0036] In an alternative implementation, the terminal device can be a local terminal device. Taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, conventionally downloading, installing, and running the game program via an electronic terminal device. The local terminal device can provide the graphical user interface to the player in various ways, such as rendering it on the terminal's display screen, or providing it to the player through holographic projection. For example, the local terminal device can include a display screen for displaying the graphical user interface, which includes game screens, and a processor for running the game, generating the graphical user interface, and controlling the display of the graphical user interface on the display screen.

[0037] In one possible implementation, this disclosure provides a method for displaying textures, which provides a graphical user interface through a first terminal device, wherein the first terminal device may be the aforementioned local terminal device or a client device in the aforementioned cloud interaction system.

[0038] For example, such as Figure 1 As shown, Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this disclosure. The application scenario may include a terminal device 102 and a server device 101. The terminal device 102 can communicate with the server device 101 via a wired network or a wireless network. In this embodiment, the electronic terminal can be either the terminal device 102 or the server device 101.

[0039] In this embodiment, the electronic terminal is described using terminal device 102 as an example. Figure 2 As shown, the terminal device 102 includes a memory 1021 and a processor 1022. The memory stores a computer program that can run on the processor. When the processor executes the computer program, it implements the steps of the method provided in the above embodiments.

[0040] See Figure 2 The terminal device 102 also includes a bus 1023 and a communication interface 1024. The processor 1022, the communication interface 1024 and the memory 1021 are connected through the bus 1023. The processor 1022 is used to execute executable modules, such as computer programs, stored in the memory 1021.

[0041] The memory 1021 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 1024 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.

[0042] Bus 1023 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 2 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0043] The memory 1021 is used to store programs. After receiving an execution instruction, the processor 1022 executes the program. The method executed by the apparatus defined by the process disclosed in any of the foregoing embodiments of this disclosure can be applied to the processor 1022 or implemented by the processor 1022.

[0044] The processor 1022 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 1022 or by instructions in software form. The processor 1022 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 1021, and processor 1022 reads the information from memory 1021 and, in conjunction with its hardware, completes the steps of the above method.

[0045] Of course, the electronic terminal in this embodiment can also be a local computer device without a network connection. For example... Figure 3 As shown, the computer device 103 includes a processor 1031, a memory 1032, and a bus. The memory 1032 stores machine-readable instructions that can be executed by the processor 1031. When the computer device is running, the processor 1031 communicates with the memory 1032 via the bus, and the processor 1031 executes the machine-readable instructions to perform steps such as a texture display method.

[0046] Specifically, the memory 1032 and processor 1031 mentioned above can be general-purpose memory and processor, without any specific limitations. When the processor 1031 runs the computer program stored in the memory 1032, it can execute the texture display method.

[0047] The embodiments of this disclosure will be further described below with reference to the accompanying drawings.

[0048] Figure 4This is a flowchart illustrating a texture display method provided in an embodiment of this disclosure. The method can be applied to a terminal device capable of displaying a graphical user interface (GUI), where the GUI displays content including a sphere located in a virtual scene space. Figure 4 As shown, the method includes:

[0049] Step S410: In response to a drawing operation on the sphere on the graphical user interface, determine the three-dimensional coordinates of the operation point on the sphere corresponding to the drawing operation in the world coordinate system of the virtual scene space.

[0050] For example, a user can control the mouse cursor to click on the surface of a sphere in the graphical user interface, allowing the system to determine the three-dimensional coordinates of the starting point of the drawing in the world coordinate system of the virtual scene space. The user can then move the mouse cursor to perform the drawing operation on the sphere. The system can respond to the user's drawing operation by determining the three-dimensional coordinates of the corresponding point on the sphere in the world coordinate system of the virtual scene space in real time. Besides the mouse cursor clicking method shown above, drawing operations can also be performed using other methods, such as touch-based clicks or long-press operations, etc., which are not specifically limited here.

[0051] Step S420: Use the specified transformation matrix to convert the three-dimensional coordinates into the first UV coordinates on the surface of the sphere.

[0052] In practical applications, graffiti textures are displayed on the surface of a sphere using texture mapping. A texture essentially uses an image to control the appearance of the model. Texture mapping technology allows an image to be pasted onto the model's surface, controlling the model's color pixel by pixel. In art modeling, texture unwrapping techniques are typically used in modeling software to store texture mapping coordinates on each vertex. Texture mapping coordinates define the two-dimensional coordinates of that vertex within the texture. These coordinates are usually represented by a two-dimensional variable (U, V), where U is the horizontal coordinate and V is the vertical coordinate; therefore, texture mapping coordinates are also called UV coordinates. Because UV coordinates are two-dimensional, a specified transformation matrix is ​​needed to convert the three-dimensional coordinates to the first UV coordinates on the surface of the sphere.

[0053] Step S430: Based on the first UV coordinates and the display size of the preset texture, display the graffiti texture corresponding to the graffiti operation on the sphere.

[0054] For example, users can also set the shape and size of the graffiti brush, such as setting it to... Figure 5 The square brush shown, or like Figure 6The circular brush shown is an example; the texture size can be varied, such as 256 by 256 or 1024 by 1024, etc. The system can display the graffiti texture corresponding to the graffiti operation on the sphere based on the first UV coordinates and the display size of the graffiti texture.

[0055] In this embodiment of the disclosure, by specifying a transformation matrix, the three-dimensional coordinates of the graffiti operation points on the sphere in the world coordinate system of the virtual scene space are converted into UV coordinates on the surface of the sphere. Based on the UV coordinates and the preset texture display size, the graffiti texture can be directly displayed on the sphere, making the two-dimensional texture displayed on the surface of the three-dimensional sphere more accurate. This allows the range of the graffiti brush to be displayed more clearly on the surface of the three-dimensional sphere, improving the display effect of the graffiti texture on the surface of the three-dimensional sphere, alleviating the technical problem of poor display effect of graffiti texture on the surface of the three-dimensional sphere in the prior art, and improving the user experience.

[0056] The steps described above will be explained in detail below.

[0057] In some embodiments, after obtaining the user's operation position on the sphere, such as the mouse click position, the system can emit a ray from that position along a preset direction into the virtual scene space, and determine the intersection of the ray and the sphere as the operation point. This allows for precise determination of the three-dimensional coordinates of the operation point corresponding to the graffiti operation on the sphere in the world coordinate system, thereby enabling more accurate display of graffiti textures on the three-dimensional sphere. As an example, step S410 above may specifically include the following steps:

[0058] Step a) In response to a drawing operation on the sphere in the graphical user interface, determine the operation position corresponding to the drawing operation in the graphical user interface.

[0059] Step b) Determine the intersection point of the ray originating from the operation position and following a preset direction with the sphere in the virtual scene space.

[0060] Step c) Determine the operation point on the sphere corresponding to the graffiti operation and the three-dimensional coordinates of the operation point in the world coordinate system based on the intersection point.

[0061] For example, such as Figure 7As shown in the diagram, the black box represents the mouse cursor click location, which is the corresponding operation position in the graphical user interface (GUI) for the user's drawing action. This position is not directly located on the surface of the sphere; rather, it can be understood as the point where the user performs the action on the GUI (i.e., the location within the black box). This point corresponds to a point in the virtual scene space. Then, starting from this point, a ray is drawn into the virtual scene space along a preset direction, which is the same as the orientation of the virtual camera's lens center. The system then calculates the intersection point of this ray with the sphere in the virtual scene space and identifies this intersection point as the corresponding operation point on the sphere, thus determining the three-dimensional coordinates of the operation point in the world coordinate system.

[0062] By making the system respond to the user's drawing operation on the sphere in the graphical user interface, the corresponding operation position in the graphical user interface is determined. This determines the intersection point of the ray starting from the operation position and following a preset direction with the sphere in the virtual scene space. Based on the intersection point, the operation point on the sphere corresponding to the drawing operation and the three-dimensional coordinates of the operation point in the world coordinate system are determined. This achieves accurate determination of the three-dimensional coordinates of the operation point on the sphere corresponding to the drawing operation in the world coordinate system, thus enabling better display of drawing textures on the three-dimensional sphere.

[0063] Based on steps a), b), and c) above, the ray emitted from the operation position may have zero, one, or two intersection points with the sphere. When there are two intersection points, the system can determine the intersection point closest to the virtual camera, i.e., the intersection point closest to the user, as the operation point corresponding to the graffiti operation on the sphere. This allows the graffiti texture to be displayed on the user's side, improving the texture display effect and facilitating user observation. As an example, step c) above may specifically include the following steps:

[0064] Step d): If there is only one intersection point, then the intersection point is determined as the operation point on the sphere corresponding to the graffiti operation.

[0065] Step e): If there are two intersection points, the intersection point closest to the virtual camera corresponding to the graphical user interface is determined as the operation point on the sphere corresponding to the graffiti operation.

[0066] Regarding the virtual camera corresponding to the graphical user interface in step e), it should be noted that there is a correlation between the virtual camera and the content displayed in the graphical user interface. That is, the image displayed in the graphical user interface is the content captured by the virtual camera in the virtual scene space. It can also be understood that as the virtual camera moves in the virtual scene space, the content displayed in the graphical user interface will also change accordingly.

[0067] For example, such as Figure 8As shown, taking the operating position as the starting point, a ray emitted in a preset direction may intersect the sphere at zero, one, or two points. If... Figure 8 As shown in (a), if the ray does not intersect the sphere, it can be determined that the operation point is not on the sphere, and the graffiti texture will not be displayed; if as... Figure 8 As shown in (b), if there is an intersection point, then this intersection point can be determined as the operation point on the sphere corresponding to the graffiti operation; if as... Figure 8 As shown in (c), there are two intersection points. The intersection point closest to the virtual camera corresponding to the graphical user interface can be determined as the operation point on the sphere corresponding to the graffiti operation. This can be understood as determining the operation point as the one of the two intersection points that is closer to the user.

[0068] By having the system determine the intersection point as the corresponding operation point on the sphere when there is only one intersection point, and determine the intersection point closest to the virtual camera corresponding to the graphical user interface as the corresponding operation point on the sphere when there are two intersection points, the graffiti texture is displayed on the user's side, making it easier for the user to observe and draw.

[0069] In some embodiments, the display shape of the graffiti texture can include multiple types, and different display shapes correspond to different UV coordinate transformation methods, improving the accuracy of coordinate transformation and enriching the functionality. When the display shape is square, the three-dimensional coordinates can be transformed using the observation matrix and divided by the scaling parameter of the sphere to obtain the corresponding UV coordinates. As an example, the preset display shape of the texture is square; the above step S420 can specifically include the following steps:

[0070] Step f) uses the observation matrix to convert the three-dimensional coordinates in the world coordinate system into coordinates in the observation space.

[0071] Step g) Divide the coordinates in the observation space by the scaling parameter of the sphere to obtain the first UV coordinates on the surface of the sphere.

[0072] For step f) above, the observation space is the space with the virtual camera corresponding to the graphical user interface as the observation point.

[0073] For example, such as Figure 9As shown, view space is often referred to as the virtual camera in a game, and is therefore sometimes also called camera space or eye space. View space is the space from which the world space coordinates of an object are transformed into coordinates in front of the observer's field of view. Therefore, view space is the space observed from the perspective of the virtual camera. This is typically achieved by a combination of translations and rotations to move the scene so that specific objects are positioned in front of the virtual camera. These combined transformations are usually stored in a view matrix, used to transform 3D coordinates in the world coordinate system to coordinates in view space. Therefore, coordinate transformations are performed using a view matrix, for example, using the following formula:

[0074] CameraPos=DiffPos*ViewMatrix;

[0075] Obtain the coordinates in the observation space (CameraPos), where DiffPos is the 3D coordinate to be transformed; use the formula:

[0076] LocalPos=CameraPos / ScaleXY;

[0077] Dividing the coordinates in the observation space (CameraPos) by the scaling parameter (ScaleXY) of the sphere yields the local coordinates (LocalPos), which is a UV coordinate representation, specifically the first UV coordinates on the surface of the sphere.

[0078] By having the system use the observation matrix to convert the three-dimensional coordinates in the world coordinate system into coordinates in the observation space, and then dividing the coordinates in the observation space by the scaling parameter of the sphere, the first UV coordinates on the surface of the sphere can be obtained. This allows the system to convert the three-dimensional coordinates using the observation matrix and divide them by the scaling parameter of the sphere when the display shape is square, thereby obtaining the corresponding UV coordinates.

[0079] In some embodiments, the display shape of the graffiti texture can include multiple types, and different display shapes correspond to different UV coordinate transformation methods, which improves the accuracy of coordinate transformation and makes the functionality richer. When the display shape is circular, the three-dimensional coordinates can be directly converted to UV coordinates through the model matrix. As an example, the default display shape of the texture is circular; the above step S420 may specifically include the following steps:

[0080] Step h) uses the model matrix to convert the three-dimensional coordinates in the world coordinate system into the first UV coordinates on the surface of the sphere.

[0081] For example, such as Figure 9 As shown, when the preset texture's display shape is circular, the system can directly convert the 3D coordinates in the world coordinate system to the local space using the model matrix, obtaining local coordinates (LocalPos). Local coordinates are a UV coordinate representation, specifically the first UV coordinates on the surface of a sphere. The conversion formula is as follows:

[0082] LocalPos=DiffPos*InverseModelMatrix;

[0083] InverseModelMatrix is ​​the inverse transformation of the model matrix.

[0084] By setting the system's preset texture display shape to a circle, the model matrix can be used to directly convert the three-dimensional coordinates in the world coordinate system into the first UV coordinates on the surface of the sphere, effectively improving the conversion efficiency and thus enhancing the display effect of the graffiti texture.

[0085] In some embodiments, since the graffiti texture is displayed in a two-dimensional plane, it needs to be converted to the length of a circle to better display the graffiti texture. For example, the display range of the graffiti texture can be determined by combining UV coordinates and the preset display size of the texture. Specifically, the display range can be refined into individual target points, thereby displaying the graffiti texture more clearly. As an example, the above step S430 may specifically include the following steps:

[0086] Step i) Based on the first UV coordinates and the display size of the preset texture, determine the target point within the display range of the graffiti texture from the points on the sphere.

[0087] Step j) Display the graffiti texture corresponding to the graffiti operation at the second UV coordinate position of the target point on the sphere.

[0088] For step i) above, the distance between the point on the sphere and the operation point is the difference between the UV coordinates of the point on the sphere and the first UV coordinates.

[0089] For example, the system can determine the target points within the display range of the graffiti texture from points on the sphere based on the first UV coordinates and the display size of the preset texture, such as... Figure 10 As shown in the diagram, circle 1001 represents the operation point, which is the position where the player clicks with the mouse cursor. The center of this circle is point A (WorldPos) in the diagram. Figure 10Point O in the diagram represents the point on the sphere where it is determined whether the graffiti texture should be displayed; specifically, it is the point within the display range of the graffiti texture. To determine whether point O is within the display range, the display size of the preset texture is required. By comparing the distance between point O and point A (the center point) with the display size of the preset texture, it can be determined whether point O is within the display range of the graffiti texture.

[0090] For example, the default texture is displayed as a circle with a radius of 5. Figure 10 The area indicated by circle 1002 is the display size of the preset texture. The difference between the world coordinates (AbsoluteWorldPos) of point O and the position (WorldPos) of the center point (point A) is the distance between point O and the center point (point A).

[0091] DiffPos=AbsoluteWorldPos-WorldPos.

[0092] If the difference is greater than the radius 5 of circle 1002, then point O is determined to be outside the display range of the graffiti texture; if the difference is less than or equal to the radius 5 of circle 1002, then point O is determined to be within the display range of the graffiti texture, that is, point O is a target point within the display range of the graffiti texture.

[0093] Similarly, the world coordinates of other points on the sphere minus the position of the center point is the difference between the other points on the sphere and this center point. This difference can then be compared with the display size of the preset texture to determine whether these points are within the display range of the graffiti texture. This allows us to determine the target points within the display range of the graffiti texture from the points on the sphere.

[0094] By having the system first determine the target point within the display range of the graffiti texture from points on the sphere based on the first UV coordinates and the display size of the preset texture, and then display the graffiti texture corresponding to the graffiti operation at the position of the second UV coordinate of the target point on the sphere, the graffiti texture can be displayed better, and the display effect can be improved.

[0095] Based on steps i) and j) above, when determining the target points within the display range of the graffiti texture, the scaling ratio of the graffiti texture to be displayed can be adjusted according to the preset texture display size. Adjusting the scaling ratio ensures the accuracy of the graffiti texture's display size on the sphere, thereby ensuring that the display effect of the graffiti texture on the sphere is the same as the user-set, thus guaranteeing the display effect of the graffiti texture on the sphere. As an example, step i) above may specifically include the following steps:

[0096] Step k) Adjust the scaling ratio of the graffiti texture to be displayed based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture.

[0097] Step 1) Based on the scaling ratio and the first UV coordinates, determine the target points within the display range of the graffiti texture from the points on the sphere.

[0098] For example, users can set the display size of a preset texture, such as setting the display size of a graffiti brush (BrushRadius). The system can adjust the scaling ratio of the graffiti texture to be displayed according to the user-set value to obtain the scaling ratio of the graffiti texture. Then, based on the scaling ratio and the first UV coordinates, the system determines the target points within the display range of the graffiti texture from the points on the sphere. The graffiti texture is then displayed by displaying each individual target point.

[0099] The system first adjusts the scaling ratio of the graffiti texture to be displayed based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture. Then, based on the scaling ratio and the first UV coordinates, the target points within the display range of the graffiti texture are determined from the points on the sphere, thereby ensuring that the display effect of the graffiti texture on the sphere is the same as that set by the user, thus guaranteeing the display effect of the graffiti texture on the sphere.

[0100] Based on steps k) and l) above, the display shape of the graffiti texture can include various types, and different display shapes correspond to different scaling ratios for adjustment, thus enriching the functionality. When the display shape of the graffiti texture is square, since the user can only set the side length of the square, the scaling ratio of the graffiti texture to be displayed can be adjusted based on the side length, ensuring the accuracy of the display size of the graffiti texture on the sphere. As an example, the preset texture display shape is square, and the display size of the preset texture includes the preset side length of the square; step k) above can specifically include the following steps:

[0101] Step m) Adjust the scaling ratio of the graffiti texture to be displayed based on the preset side length to obtain the scaling ratio of the graffiti texture.

[0102] For example, when the preset texture is displayed in a square shape, the user can set the BrushRadius, which the system then converts to the length of a sphere. Since the texture is displayed in two dimensions, it only needs to be converted to the length of a circle. Since the image is a square, it is converted to the side length of the inscribed square of the circle, which is then used as the preset side length of the square. This is then compared with the image's length SizeX and width SizeY to determine the required scaling ratios AlphaBrushScaleX and AlphaBrushScaleY. This can be achieved using the following formula function:

[0103] floatMaxSize=FMath::Sqrt(2.0f)*Radius;

[0104] floatAlphaBrushScale=MaxSize / (float)FMath::Max <int32>(SizeX, SizeY);

[0105] AlphaBrushScaleX=1.0f / (AlphaBrushScale*SizeX);

[0106] AlphaBrushScaleY=1.0f / (AlphaBrushScale*SizeY).

[0107] By adjusting the scaling ratio of the graffiti texture to be displayed based on the preset side length, the scaling ratio of the graffiti texture is obtained, thus ensuring the display effect of the graffiti texture on the sphere.

[0108] Based on steps k) and l) above, the UV coordinates can be offset to ensure that the center of the graffiti texture display coincides with the center of the operation point, allowing the graffiti texture to move with the user's mouse click position, thus better displaying the graffiti texture on the sphere. As an example, after step l) above, the method may also include the following steps:

[0109] Step n) is to perform translation adjustment based on the second UV coordinates of the target point so that the operation point is located in the center of the range to be displayed.

[0110] For example, in art modeling, texture unwrapping technology is typically used in modeling software to store texture mapping coordinates on each vertex. Texture mapping coordinates define the two-dimensional coordinates of that vertex within the texture. These coordinates are usually represented by a two-dimensional variable (U, V), where U is the horizontal coordinate and V is the vertical coordinate. However, the vertex UV coordinate range is usually normalized to [0,1]. A translation adjustment is typically made by adding 0.5 to the UV coordinates, allowing the square graffiti texture image to be displayed in the center of the mouse cursor, for example:

[0111] U=LocalPos.x*AlphaBrushScaleX+0.5;

[0112] V=LocalPos.y*AlphaBrushScaleY+0.5.

[0113] By translating the system based on the second UV coordinates of the target point, so that the operation point is located in the center of the display area, it can be ensured that the center of the graffiti texture display coincides with the center of the operation point, so that the graffiti texture moves with the user's mouse click position, thereby better displaying the graffiti texture on the sphere.

[0114] Based on steps k) and l) above, the display shape of the graffiti texture can include various types, and different display shapes correspond to different scaling ratios for adjustment, thus enriching the functionality. When the display shape of the graffiti texture is circular, the user can directly set the radius of the circle, thereby directly adjusting the scaling ratio of the graffiti texture to be displayed, ensuring the accuracy of the graffiti texture's display size on the sphere. As an example, the preset display shape of the texture is circular; step k) above can specifically include the following steps:

[0115] Step o) Based on the display size of the preset texture, the scaling ratio of the graffiti texture to be displayed is adjusted by adjusting the radius of the circle, so as to obtain the scaling ratio of the graffiti texture.

[0116] For example, when the preset texture is displayed in a circle, the radius of the circle can be adjusted directly to adjust the scaling ratio of the graffiti texture to be displayed, thus obtaining the scaling ratio of the graffiti texture.

[0117] By adjusting the radius of a circle to adjust the scaling ratio of the graffiti texture displayed based on a preset texture, the system can effectively improve user operation efficiency and thus enhance the system's display effect.

[0118] Based on the above step o), for a circular graffiti texture, the points on the boundary of the area can be determined first, and the distance between the points on the boundary and the center point can be determined as the radius of the circle. Then, the target points within the display range of the graffiti texture can be determined from the points on the sphere, and the circular graffiti texture can be displayed on the sphere, improving the accuracy of the display range of the circular graffiti texture. As an example, the operation point is the center point of the circle; the above step l) can specifically include the following steps:

[0119] Step p) determines the points on the boundary of the area to be displayed based on the scaling ratio, and determines the distance between the points on the boundary and the center point as the radius of the circle.

[0120] Step q) determines the target points within the display range of the graffiti texture from the points on the sphere, based on the radius of the circle and the first UV coordinates.

[0121] For example, the system can determine the points on the boundary of the area to be displayed, and define the distance between the points on the boundary and the center point as the radius of the circle. For instance, the distance Distance can be calculated using the formula for the chord length between two points, as follows:

[0122]

[0123] This allows the distance Distance to be defined as the radius of a circle, enabling the display of target points within that circle.

[0124] The system first determines the points on the boundary of the display area based on the scaling ratio, and determines the distance between the points on the boundary and the center point as the radius of the circle. Then, based on the radius of the circle and the first UV coordinates, the target points of the graffiti texture within the display area are determined from the points on the sphere. The circular graffiti texture is then displayed on the sphere based on the target points, thereby improving the display effect.

[0125] Based on steps p) and q) above, the system can also detect the display size of the circular graffiti texture. If the display size of the texture exceeds the display range of the sphere, the graffiti texture will not be displayed, thus avoiding situations where the graffiti texture is larger than the sphere, thereby improving the display effect. As an example, step q) above may specifically include the following steps:

[0126] Step r) determines the distance between a point on the sphere and the center point using the chord length formula between two points based on the first UV coordinates.

[0127] Step s): If the distance between a point on the sphere and the center point is less than or equal to the radius of the circle, then the point on the sphere is determined as the target point within the display range.

[0128] In step t), if the distance between a point on the sphere and the center point is greater than the radius of the circle, then the point on the sphere is determined as an outside point of the circle outside the display range.

[0129] For example, such as Figure 11 As shown, the user has set the display size of the preset texture and the radius of the circle. The system determines whether the circle should be displayed at that location by comparing the radius with the previously calculated distance Distance. If Distance > Radius, the image is not displayed; otherwise, it is displayed.

[0130] By comparing the distance between a point on the sphere and the center point with the radius of the circle, the display size of the circular graffiti texture can be detected. If the display size of the texture exceeds the display range of the sphere, the graffiti texture will not be displayed, thus avoiding the situation where the graffiti texture is larger than the sphere and improving the display effect.

[0131] Figure 12 This is a schematic diagram of a texture display device provided in an embodiment of the present disclosure. The device can be applied to a terminal device capable of displaying a graphical user interface (GUI), where the GUI displays content including a sphere. Figure 12 As shown, the texture display device 1200 includes:

[0132] The determination module 1201 is configured to, in response to a drawing operation on the sphere on the graphical user interface, determine the three-dimensional coordinates of the operation point on the sphere corresponding to the drawing operation in the world coordinate system of the virtual scene space;

[0133] Transformation module 1202 is used to convert three-dimensional coordinates into first UV coordinates on the surface of a sphere using a specified transformation matrix;

[0134] Display module 1203 is used to display the graffiti texture corresponding to the graffiti operation on the sphere based on the first UV coordinates and the display size of the preset texture.

[0135] In some embodiments, the determining module 1201 is specifically used for:

[0136] In response to a drawing operation on the sphere in the graphical user interface, determine the operation position corresponding to the drawing operation in the graphical user interface;

[0137] Determine the intersection point of the ray, which originates from the operation position and follows a preset direction, with the sphere in the virtual scene space;

[0138] Based on the intersection point, determine the operation point corresponding to the graffiti operation on the sphere and the three-dimensional coordinates of the operation point in the world coordinate system.

[0139] In some embodiments, the determining module 1201 is specifically used for:

[0140] If there is only one intersection point, then the intersection point is determined as the operation point on the sphere corresponding to the graffiti operation;

[0141] If there are two intersection points, the intersection point closest to the virtual camera corresponding to the graphical user interface will be determined as the operation point on the sphere corresponding to the graffiti operation.

[0142] In some embodiments, the preset texture is displayed in a square shape; the conversion module 1202 is specifically used for:

[0143] The observation matrix is ​​used to convert the three-dimensional coordinates in the world coordinate system into coordinates in the observation space; where the observation space is the space with the virtual camera corresponding to the graphical user interface as the observation point.

[0144] Divide the coordinates in the observation space by the scaling parameter of the sphere to obtain the first UV coordinates on the surface of the sphere.

[0145] In some embodiments, the display shape of the preset texture is circular; the conversion module 1202 is specifically used for:

[0146] The model matrix is ​​used to convert the three-dimensional coordinates in the world coordinate system into the first UV coordinates on the surface of the sphere.

[0147] In some embodiments, the display module 1203 is specifically used for:

[0148] Based on the first UV coordinates and the display size of the preset texture, the target point within the display range of the graffiti texture is determined from the points on the sphere; wherein, the distance between the point on the sphere and the operation point is the difference between the UV coordinates of the point on the sphere and the first UV coordinates;

[0149] Display the graffiti texture corresponding to the graffiti operation at the second UV coordinate of the target point on the sphere.

[0150] In some embodiments, the display module 1203 is specifically used for:

[0151] The scaling ratio of the graffiti texture to be displayed is adjusted based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture.

[0152] Based on the scaling factor and the first UV coordinates, the target points within the display range of the graffiti texture are determined from the points on the sphere.

[0153] In some embodiments, the display shape of the preset texture is square, and the display size of the preset texture includes the preset side length of the square; the display module 1203 is specifically used for:

[0154] The scaling ratio of the graffiti texture to be displayed is adjusted based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture, including:

[0155] The scaling ratio of the graffiti texture to be displayed is adjusted based on the preset side length to obtain the scaling ratio of the graffiti texture.

[0156] In some embodiments, the device further includes:

[0157] The adjustment module is used to determine the target point of the graffiti texture within the display range from points on the sphere based on the scaling ratio and the first UV coordinates, and then perform translation adjustment based on the second UV coordinates of the target point so that the operation point is located in the center of the display range.

[0158] In some embodiments, the display shape of the preset texture is circular; the display module 1203 is specifically used for:

[0159] The scaling ratio of the graffiti texture to be displayed is adjusted based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture, including:

[0160] The display size based on the preset texture is obtained by adjusting the radius of the circle and scaling the graffiti texture to be displayed.

[0161] In some embodiments, the operation point is the center point of a circle; the display module 1203 is specifically used for:

[0162] The points on the boundary of the display area are determined based on the scaling ratio, and the distance between the points on the boundary and the center point is determined as the radius of the circle.

[0163] Based on the radius of the circle and the first UV coordinates, the target points within the display range of the graffiti texture are determined from the points on the sphere.

[0164] In some embodiments, the display module 1203 is specifically used for:

[0165] The distance between a point on the sphere and the center point is determined based on the first UV coordinates using the chord length formula between two points.

[0166] If the distance between a point on the sphere and the center point is less than or equal to the radius of the circle, then the point on the sphere is determined as the target point within the display range;

[0167] If the distance between a point on the sphere and the center point is greater than the radius of the circle, then the point on the sphere is defined as an outside point of the circle, outside the display range.

[0168] The texture display device provided in this disclosure has the same technical features as the texture display method provided in the above embodiments, and therefore can solve the same technical problems and achieve the same technical effects. By enabling the system to respond to the user's drawing operation on the sphere in the graphical user interface, the system determines the three-dimensional coordinates of the operation point corresponding to the drawing operation on the sphere in the world coordinate system of the virtual scene space. Then, the system uses a specified transformation matrix to convert the three-dimensional coordinates into the first UV coordinates on the surface of the sphere. Based on the first UV coordinates and the preset texture display size, the system displays the drawing texture corresponding to the drawing operation on the sphere. This allows the range of the drawing brush to be displayed more clearly on the surface of the three-dimensional sphere, alleviating the technical problem of poor display effect of drawing texture on the surface of a three-dimensional sphere in the prior art and improving the user experience.

[0169] This disclosure also provides an electronic terminal, including: a processor, a storage medium, and a bus. The storage medium stores machine-readable instructions executable by the processor. When the electronic terminal runs a texture display method as described in the embodiments, the processor communicates with the storage medium via the bus. The processor executes the machine-readable instructions, and the preamble of the processor method item performs the following steps:

[0170] In response to a drawing operation on the sphere on the graphical user interface, the three-dimensional coordinates of the operation point on the sphere corresponding to the drawing operation in the world coordinate system of the virtual scene space are determined;

[0171] The three-dimensional coordinates are converted into the first UV coordinates on the surface of the sphere using a specified transformation matrix;

[0172] Based on the first UV coordinates and the display size of the preset texture, the graffiti texture corresponding to the graffiti operation is displayed on the sphere.

[0173] The specific implementation methods and working processes can be referred to the corresponding processes in the above method embodiments, and will not be repeated here.

[0174] In one feasible implementation, when the processor executes the determination of the three-dimensional coordinates of the operation point corresponding to the graffiti operation on the sphere in the world coordinate system in response to the graffiti operation on the sphere, it specifically performs the following:

[0175] In response to a drawing operation on the sphere in the graphical user interface, determine the operation position corresponding to the drawing operation in the graphical user interface;

[0176] Determine the intersection point of the ray, which originates from the operation position and follows a preset direction, with the sphere in the virtual scene space;

[0177] Based on the intersection point, determine the operation point corresponding to the graffiti operation on the sphere and the three-dimensional coordinates of the operation point in the world coordinate system.

[0178] In one feasible implementation, when the processor performs the step of determining the operation point corresponding to the graffiti operation on the sphere based on the intersection point, it is specifically used for:

[0179] If the number of intersection points is one, then the intersection point is determined as the operation point on the sphere corresponding to the graffiti operation;

[0180] If there are two intersection points, the intersection point closest to the virtual camera corresponding to the graphical user interface is determined as the operation point on the sphere corresponding to the graffiti operation.

[0181] In one feasible implementation, when the processor performs the conversion of the three-dimensional coordinates into first UV coordinates on the surface of the sphere using a specified transformation matrix, it specifically performs the following:

[0182] The observation matrix is ​​used to convert the three-dimensional coordinates in the world coordinate system into coordinates in the observation space; wherein, the observation space is the space with the virtual camera corresponding to the graphical user interface as the observation point;

[0183] Divide the coordinates in the observation space by the scaling parameter of the sphere to obtain the first UV coordinates on the surface of the sphere.

[0184] In one feasible implementation, the preset texture is displayed in a circular shape; when the processor performs the step of converting the three-dimensional coordinates into first UV coordinates on the surface of the sphere using a specified transformation matrix, it specifically performs the following:

[0185] The three-dimensional coordinates in the world coordinate system are converted into the first UV coordinates on the surface of the sphere using the model matrix.

[0186] In one feasible implementation, when the processor displays the graffiti texture corresponding to the graffiti operation on the sphere based on the first UV coordinates and the display size of the preset texture, it is specifically used for:

[0187] Based on the first UV coordinates and the display size of the preset texture, target points within the display range of the graffiti texture are determined from the points on the sphere; wherein, the distance between the points on the sphere and the operation point is the difference between the UV coordinates of the points on the sphere and the first UV coordinates;

[0188] The graffiti texture corresponding to the graffiti operation is displayed at the second UV coordinate position of the target point on the sphere.

[0189] In one feasible implementation, when the processor determines the target points within the display range of the graffiti texture from points on the sphere based on the first UV coordinates and the display size of the preset texture, it is specifically used to:

[0190] The scaling ratio of the graffiti texture to be displayed is adjusted based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture.

[0191] Based on the scaling ratio and the first UV coordinates, target points within the display range of the graffiti texture are determined from the points on the sphere.

[0192] In one feasible implementation, the display shape of the preset texture is square, and the display size of the preset texture includes the preset side length of the square; when the processor adjusts the scaling ratio of the graffiti texture to be displayed based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture, it is specifically used for:

[0193] The scaling ratio of the graffiti texture to be displayed is adjusted based on the preset side length to obtain the scaling ratio of the graffiti texture.

[0194] In one feasible implementation, after determining the target points within the display range of the graffiti texture from points on the sphere based on the scaling factor and the first UV coordinates, the processor is further configured to perform:

[0195] The operation point is translated and adjusted based on the second UV coordinates of the target point so that it is located in the center of the area to be displayed.

[0196] In one feasible implementation, the display shape of the preset texture is circular; when the processor adjusts the scaling ratio of the graffiti texture to be displayed based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture, it is specifically used for:

[0197] The display size based on the preset texture is obtained by adjusting the radius of the circle and adjusting the scaling ratio of the graffiti texture to be displayed.

[0198] In one feasible implementation, the operation point is the center point of the circle; when the processor executes the step of determining the target point within the display range of the graffiti texture from points on the sphere based on the scaling ratio and the first UV coordinates, it is specifically used for:

[0199] Based on the scaling ratio, the points on the boundary of the display range are determined, and the distance between the points on the boundary and the center point is determined as the radius of the circle;

[0200] Based on the radius of the circle and the first UV coordinates, target points within the display range of the graffiti texture are determined from points on the sphere.

[0201] In one feasible implementation, when the processor performs the step of determining the target point within the display range of the graffiti texture from points on the sphere based on the radius of the circle and the first UV coordinates, it is specifically used to: determine the distance between the point on the sphere and the center point based on the first UV coordinates using the chord length formula between two points;

[0202] If the distance between a point on the sphere and the center point is less than or equal to the radius of the circle, then the point on the sphere is determined as the target point within the display range;

[0203] If the distance between a point on the sphere and the center point is greater than the radius of the circle, then the point on the sphere is determined as an outside point of the circle outside the display range.

[0204] In this way, the system can respond to the user's drawing operation on the sphere in the graphical user interface, determine the three-dimensional coordinates of the operation point on the sphere in the world coordinate system of the virtual scene space, and then use a specified transformation matrix to convert the three-dimensional coordinates into the first UV coordinates on the surface of the sphere. Based on the first UV coordinates and the display size of the preset texture, the system displays the drawing texture corresponding to the drawing operation on the surface of the sphere. This allows the range of the drawing brush to be displayed more clearly on the surface of the three-dimensional sphere, alleviating the technical problem of poor display effect of drawing texture on the surface of a three-dimensional sphere in the prior art and improving the user experience.

[0205] Corresponding to the above-described texture display method, this disclosure also provides a program product, such as a computer-readable storage medium, which stores computer-executable instructions. When these computer-executable instructions are invoked and executed by a processor, they cause the processor to perform the following steps:

[0206] In response to a drawing operation on the sphere on the graphical user interface, the three-dimensional coordinates of the operation point on the sphere corresponding to the drawing operation in the world coordinate system of the virtual scene space are determined;

[0207] The three-dimensional coordinates are converted into the first UV coordinates on the surface of the sphere using a specified transformation matrix;

[0208] Based on the first UV coordinates and the display size of the preset texture, the graffiti texture corresponding to the graffiti operation is displayed on the sphere.

[0209] The specific implementation methods and working processes can be referred to the corresponding processes in the above method embodiments, and will not be repeated here.

[0210] In one feasible implementation, when the processor executes the determination of the three-dimensional coordinates of the operation point corresponding to the graffiti operation on the sphere in the world coordinate system in response to the graffiti operation on the sphere, it specifically performs the following:

[0211] In response to a drawing operation on the sphere in the graphical user interface, determine the operation position corresponding to the drawing operation in the graphical user interface;

[0212] Determine the intersection point of the ray, which originates from the operation position and follows a preset direction, with the sphere in the virtual scene space;

[0213] Based on the intersection point, determine the operation point corresponding to the graffiti operation on the sphere and the three-dimensional coordinates of the operation point in the world coordinate system.

[0214] In one feasible implementation, when the processor performs the step of determining the operation point corresponding to the graffiti operation on the sphere based on the intersection point, it is specifically used for:

[0215] If the number of intersection points is one, then the intersection point is determined as the operation point on the sphere corresponding to the graffiti operation;

[0216] If there are two intersection points, the intersection point closest to the virtual camera corresponding to the graphical user interface is determined as the operation point on the sphere corresponding to the graffiti operation.

[0217] In one feasible implementation, when the processor performs the conversion of the three-dimensional coordinates into first UV coordinates on the surface of the sphere using a specified transformation matrix, it specifically performs the following:

[0218] The observation matrix is ​​used to convert the three-dimensional coordinates in the world coordinate system into coordinates in the observation space; wherein, the observation space is the space with the virtual camera corresponding to the graphical user interface as the observation point;

[0219] Divide the coordinates in the observation space by the scaling parameter of the sphere to obtain the first UV coordinates on the surface of the sphere.

[0220] In one feasible implementation, the preset texture is displayed in a circular shape; when the processor performs the step of converting the three-dimensional coordinates into first UV coordinates on the surface of the sphere using a specified transformation matrix, it specifically performs the following:

[0221] The three-dimensional coordinates in the world coordinate system are converted into the first UV coordinates on the surface of the sphere using the model matrix.

[0222] In one feasible implementation, when the processor displays the graffiti texture corresponding to the graffiti operation on the sphere based on the first UV coordinates and the display size of the preset texture, it is specifically used for:

[0223] Based on the first UV coordinates and the display size of the preset texture, target points within the display range of the graffiti texture are determined from the points on the sphere; wherein, the distance between the points on the sphere and the operation point is the difference between the UV coordinates of the points on the sphere and the first UV coordinates;

[0224] The graffiti texture corresponding to the graffiti operation is displayed at the second UV coordinate position of the target point on the sphere.

[0225] In one feasible implementation, when the processor determines the target points within the display range of the graffiti texture from points on the sphere based on the first UV coordinates and the display size of the preset texture, it is specifically used to:

[0226] The scaling ratio of the graffiti texture to be displayed is adjusted based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture.

[0227] Based on the scaling ratio and the first UV coordinates, target points within the display range of the graffiti texture are determined from the points on the sphere.

[0228] In one feasible implementation, the display shape of the preset texture is square, and the display size of the preset texture includes the preset side length of the square; when the processor adjusts the scaling ratio of the graffiti texture to be displayed based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture, it is specifically used for:

[0229] The scaling ratio of the graffiti texture to be displayed is adjusted based on the preset side length to obtain the scaling ratio of the graffiti texture.

[0230] In one feasible implementation, after determining the target points within the display range of the graffiti texture from points on the sphere based on the scaling factor and the first UV coordinates, the processor is further configured to perform:

[0231] The operation point is translated and adjusted based on the second UV coordinates of the target point so that it is located in the center of the area to be displayed.

[0232] In one feasible implementation, the display shape of the preset texture is circular; when the processor adjusts the scaling ratio of the graffiti texture to be displayed based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture, it is specifically used for:

[0233] The display size based on the preset texture is obtained by adjusting the radius of the circle and adjusting the scaling ratio of the graffiti texture to be displayed.

[0234] In one feasible implementation, the operation point is the center point of the circle; when the processor executes the step of determining the target point within the display range of the graffiti texture from points on the sphere based on the scaling ratio and the first UV coordinates, it is specifically used for:

[0235] Based on the scaling ratio, the points on the boundary of the display range are determined, and the distance between the points on the boundary and the center point is determined as the radius of the circle;

[0236] Based on the radius of the circle and the first UV coordinates, target points within the display range of the graffiti texture are determined from points on the sphere.

[0237] In one feasible implementation, when the processor performs the step of determining the target point within the display range of the graffiti texture from points on the sphere based on the radius of the circle and the first UV coordinates, it is specifically used to: determine the distance between the point on the sphere and the center point based on the first UV coordinates using the chord length formula between two points;

[0238] If the distance between a point on the sphere and the center point is less than or equal to the radius of the circle, then the point on the sphere is determined as the target point within the display range;

[0239] If the distance between a point on the sphere and the center point is greater than the radius of the circle, then the point on the sphere is determined as an outside point of the circle outside the display range.

[0240] In this way, the system can respond to the user's drawing operation on the sphere in the graphical user interface, determine the three-dimensional coordinates of the operation point on the sphere in the world coordinate system of the virtual scene space, and then use a specified transformation matrix to convert the three-dimensional coordinates into the first UV coordinates on the surface of the sphere. Based on the first UV coordinates and the display size of the preset texture, the system displays the drawing texture corresponding to the drawing operation on the surface of the sphere. This allows the range of the drawing brush to be displayed more clearly on the surface of the three-dimensional sphere, alleviating the technical problem of poor display effect of drawing texture on the surface of a three-dimensional sphere in the prior art and improving the user experience.

[0241] The texture display device provided in this disclosure can be specific hardware on a device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in this disclosure are the same as those in the foregoing method embodiments. For the sake of brevity, any parts not mentioned in the device embodiments can be referred to the corresponding content in the foregoing method embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can all be referred to the corresponding processes in the above method embodiments, and will not be repeated here.

[0242] In the embodiments provided in this disclosure, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0243] For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, 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, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0244] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0245] In addition, the functional units in the embodiments provided in this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0246] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the texture display method described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0247] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0248] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this disclosure. All should be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A method for displaying textures, characterized in that, The method includes providing a graphical user interface via a terminal device, wherein the content displayed by the graphical user interface includes a sphere located in a virtual scene space; the method comprises: In response to a drawing operation on the sphere in the graphical user interface, the operation position corresponding to the drawing operation in the graphical user interface is determined; the intersection point of a ray with the operation position as the starting point and along a preset direction with the sphere in the virtual scene space is determined; based on the intersection point, the operation point corresponding to the drawing operation on the sphere and the three-dimensional coordinates of the operation point in the world coordinate system of the virtual scene space are determined; The three-dimensional coordinates are converted into first UV coordinates on the surface of the sphere using the observation matrix or model matrix; The scaling ratio of the graffiti texture to be displayed is adjusted based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture; based on the scaling ratio and the first UV coordinates, a target point within the display range of the graffiti texture is determined from the points on the sphere; wherein, the distance between the point on the sphere and the operation point is the difference between the UV coordinates of the point on the sphere and the first UV coordinates; the graffiti texture corresponding to the graffiti operation is displayed at the position of the second UV coordinates of the target point on the sphere.

2. The method according to claim 1, characterized in that, Determining the operation point on the sphere corresponding to the graffiti operation based on the intersection point includes: If the number of intersection points is one, then the intersection point is determined as the operation point on the sphere corresponding to the graffiti operation; If there are two intersection points, the intersection point closest to the virtual camera corresponding to the graphical user interface is determined as the operation point on the sphere corresponding to the graffiti operation.

3. The method according to claim 1, characterized in that, The preset texture is displayed in a square shape; The process of converting the three-dimensional coordinates into first UV coordinates on the surface of the sphere using an observation matrix or a model matrix includes: The observation matrix is ​​used to convert the three-dimensional coordinates in the world coordinate system into coordinates in the observation space; wherein, the observation space is the space with the virtual camera corresponding to the graphical user interface as the observation point; Divide the coordinates in the observation space by the scaling parameter of the sphere to obtain the first UV coordinates on the surface of the sphere.

4. The method according to claim 1, characterized in that, The preset texture is displayed in a circular shape; The process of converting the three-dimensional coordinates into first UV coordinates on the surface of the sphere using an observation matrix or a model matrix includes: The three-dimensional coordinates in the world coordinate system are converted into the first UV coordinates on the surface of the sphere using the model matrix.

5. The method according to claim 1, characterized in that, The preset texture is displayed in a square shape, and the display size of the preset texture includes the preset side length of the square. The process of adjusting the scaling ratio of the graffiti texture to be displayed based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture includes: The scaling ratio of the graffiti texture to be displayed is adjusted based on the preset side length to obtain the scaling ratio of the graffiti texture.

6. The method according to claim 1, characterized in that, After determining the target points within the display range of the graffiti texture from points on the sphere based on the scaling ratio and the first UV coordinates, the method further includes: The operation point is translated and adjusted based on the second UV coordinates of the target point so that it is located in the center of the area to be displayed.

7. The method according to claim 1, characterized in that, The preset texture is displayed in a circular shape; The process of adjusting the scaling ratio of the graffiti texture to be displayed based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture includes: The display size based on the preset texture is obtained by adjusting the radius of the circle and adjusting the scaling ratio of the graffiti texture to be displayed.

8. The method according to claim 7, characterized in that, The operation point is the center point of the circle; The step of determining the target points within the display range of the graffiti texture from points on the sphere based on the scaling ratio and the first UV coordinates includes: Based on the scaling ratio, the points on the boundary of the display range are determined, and the distance between the points on the boundary and the center point is determined as the radius of the circle; Based on the radius of the circle and the first UV coordinates, target points within the display range of the graffiti texture are determined from points on the sphere.

9. The method according to claim 8, characterized in that, The step of determining the target points within the display range of the graffiti texture from points on the sphere based on the radius of the circle and the first UV coordinates includes: The distance between a point on the sphere and the center point is determined based on the first UV coordinates using the chord length formula between two points. If the distance between a point on the sphere and the center point is less than or equal to the radius of the circle, then the point on the sphere is determined as the target point within the display range; If the distance between a point on the sphere and the center point is greater than the radius of the circle, then the point on the sphere is determined as an outside point of the circle outside the display range.

10. A texture display device, characterized in that, A graphical user interface is provided through a terminal device, wherein the content displayed by the graphical user interface includes a sphere located in a virtual scene space; including: A determination module is configured to, in response to a drawing operation on the sphere on the graphical user interface, determine the three-dimensional coordinates of the operation point on the sphere corresponding to the drawing operation in the world coordinate system of the virtual scene space; A conversion module is used to convert the three-dimensional coordinates into first UV coordinates on the surface of the sphere using an observation matrix or a model matrix; The display module is used to display the graffiti texture corresponding to the graffiti operation on the sphere based on the first UV coordinates and the display size of the preset texture; The determination module is specifically used to: in response to a drawing operation on the sphere on the graphical user interface, determine the operation position corresponding to the drawing operation in the graphical user interface; determine the intersection point of a ray with the operation position as the starting point and along a preset direction with the sphere in the virtual scene space; and determine the operation point corresponding to the drawing operation on the sphere and the three-dimensional coordinates of the operation point in the world coordinate system based on the intersection point. The display module is specifically used for: determining the target point within the display range of the graffiti texture from the points on the sphere based on the first UV coordinates and the display size of the preset texture; wherein, the distance between the point on the sphere and the operation point is the difference between the UV coordinates of the point on the sphere and the first UV coordinates; and displaying the graffiti texture corresponding to the graffiti operation at the position of the second UV coordinates of the target point on the sphere. The display module is also used to: adjust the scaling ratio of the graffiti texture to be displayed based on the display size of the preset texture to obtain the scaling ratio of the graffiti texture; and determine the target point within the display range of the graffiti texture from the points on the sphere based on the scaling ratio and the first UV coordinates.

11. An electronic terminal, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method according to any one of claims 1 to 9.