A method, device and storage medium for displaying three-dimensional illustrations
By saving depth information in three-dimensional illustrations and using rendering techniques to expand the back surface, the problems of large calculations of edge line completion and poor real-time interaction of three-dimensional illustrations are solved, and efficient edge line filling effect is achieved, reducing the calculation amount and maintaining the rendering performance.
Patent Information
- Application Number
- CN202510714732.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-05-30
AI Technical Summary
In the prior art, the calculation of edge line completion of three-dimensional illustrations is high, the cost is high, and the real-time interaction is poor, especially when processing large models, which cannot meet the real-time interaction requirements.
By drawing the grid of the three-dimensional model and saving depth information, drawing outlines overlays, and using rendering techniques to expand the back surface to form continuous complementary lines, avoiding traditional geometric data calculations.
Reduces the computational volume, improves rendering performance, ensures edge line filling in milliseconds, and improves real-time interactivity.
Smart Images

Figure CN120236018B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method, device and storage medium for displaying three-dimensional illustrations. Background Art
[0002] In industrial manufacturing fields such as aerospace, automobiles, and ships, as well as in the fields of 3D modeling and game development, the detailed shapes of objects are accurately stored in the form of 3D models. Although high-precision 3D models are core data carriers, they still need to be converted into 3D illustrations in scenarios such as technical documents and assembly guides. By simplifying the structure, hiding irrelevant parts, and adding annotations or section lines, 3D illustrations can highlight key parts more clearly. For example, in the design of automobile engines in the industrial manufacturing field, it is often necessary to convert complex 3D assemblies into 3D illustrations such as exploded views or sectional diagrams to show the spatial relationship between parts.
[0003] When converting a 3D model to a 3D illustration, the model's outlines are drawn based on predefined geometric parameters (such as edge coordinates). When the model is rotated, these predefined edges transform with the coordinate system and may disappear due to projection degradation. To ensure that the object's outline remains consistent regardless of rotation, edge inpainting is required. This feature reconstructs the visual outlines lost due to projection degradation, preserving the integrity of the object's representation.
[0004] In existing technologies, edge infilling is mostly based on geometric projection algorithms (such as orthographic and axonometric projections), which generate vector lines by calculating the visible edges and contours of the model surface. Specifically, each time the viewing angle changes, all facets must be retraversed to calculate the visibility of each facet's edge. Then, geometric projection calculations are performed on the missing contour edges to determine the coordinates and lengths of the edges to be completed. The missing contour edges are then drawn and displayed. As can be seen, the disadvantages of existing edge infilling solutions are that visibility determination and geometric calculations must be performed facet by facet. When processing large models with millions of facets (such as entire ship assemblies), the generation time can be as long as several hours, resulting in high computational complexity, high cost, and poor real-time interactivity. Summary of the Invention
[0005] The embodiments of the present disclosure provide a method, device and storage medium for displaying three-dimensional illustrations, so as to at least solve the technical problems in the prior art of large computational complexity, high cost and poor real-time interactivity in completing edge lines of three-dimensional illustrations.
[0006] According to one aspect of an embodiment of the present disclosure, a method for displaying an illustration is provided, wherein the three-dimensional illustration is an image with a stereoscopic effect generated by rendering a three-dimensional model onto a screen plane, the display method comprising: drawing a grid of a target object in the three-dimensional model, and saving only depth information of the grid in a drawing buffer; wherein the target object is an object to be displayed in the three-dimensional model; drawing a contour line of the target object superimposed on the drawn grid, and saving depth information, color information and template information of the contour line in the drawing buffer to obtain an initial three-dimensional illustration; wherein the initial three-dimensional illustration only displays the contour of the target object line, the mesh surface of the target object is not displayed, and the displayed contour line is missing in a partial visual area displayed on the screen; the color information of all meshes in the initial three-dimensional illustration is set to the color information of the contour line, and based on the data in the drawing buffer area and the set color information, back-end expansion drawing is performed on all meshes in the initial three-dimensional illustration to obtain a final three-dimensional illustration; wherein, all meshes in the final three-dimensional illustration are expanded by a preset width along the normal direction under the normalized device coordinate space, and the geometric areas displayed in each mesh after expansion due to back-end drawing and the missing contour lines visually form continuous complementary lines.
[0007] According to another aspect of an embodiment of the present disclosure, a storage medium is further provided, the storage medium including a stored program, wherein when the program is run, a processor executes any one of the above methods.
[0008] According to another aspect of the embodiments of the present disclosure, an illustration display device is further provided, wherein the three-dimensional illustration is an image with a stereoscopic sense generated by rendering a three-dimensional model onto a screen plane, the display device comprising: a contour occlusion module configured to draw a mesh of a target object in the three-dimensional model and save only depth information of the mesh in a drawing buffer; wherein the target object is an object to be displayed in the three-dimensional model; a contour line of the target object is superimposed on the drawn mesh, and the depth information, color information and template information of the contour line are saved in the drawing buffer to obtain an initial three-dimensional illustration; wherein the initial three-dimensional illustration only displays the contour line of the target object The outline does not display the mesh surface of the target object, and the displayed outline is missing in a partial visual area displayed on the screen; the edge filling module is configured to set the color information of all meshes in the initial three-dimensional illustration to the color information of the outline, and based on the data in the drawing buffer area and the set color information, perform back-end expansion drawing on all meshes in the initial three-dimensional illustration to obtain a final three-dimensional illustration; wherein, all meshes in the final three-dimensional illustration are expanded by a preset width along the normal direction under the normalized device coordinate space, and the geometric areas displayed in each mesh after expansion due to back-end drawing and the missing outline visually form a continuous filling line.
[0009] According to another aspect of the embodiment of the present disclosure, an illustration display device is also provided, comprising: a processor; and a memory connected to the processor, for providing the processor with instructions for processing the following processing steps: drawing a grid of a target object in the three-dimensional model, and saving only depth information of the grid in a drawing buffer; wherein the target object is an object to be displayed in the three-dimensional model; drawing the contour line of the target object superimposed on the drawn grid, and saving the depth information, color information and template information of the contour line in the drawing buffer to obtain an initial three-dimensional illustration; wherein the initial three-dimensional illustration only displays the contour line of the target object, and does not display the grid of the target object surface, and the displayed contour line is missing in part of the visual area displayed on the screen; the color information of all grids in the initial three-dimensional illustration is set to the color information of the contour line, and based on the data in the drawing buffer area and the set color information, back-end expansion drawing is performed on all grids in the initial three-dimensional illustration to obtain a final three-dimensional illustration; wherein, all grids in the final three-dimensional illustration are expanded by a preset width along the normal direction under the normalized device coordinate space, and the geometric areas displayed in each grid after expansion due to back-end drawing and the missing contour lines visually form continuous complementary lines; the three-dimensional illustration is a three-dimensional image generated by rendering the three-dimensional model to the screen plane.
[0010] In the disclosed embodiment, there is no need to perform actual geometric data calculations and display a real edge line. Instead, a simple rendering technique is used to implement the edge filling function. The present invention uses rendering techniques to achieve the effect of illustrations, which can meet the requirements of large-scene model illustration effects. In addition, the present invention uses rendering instead of traditional edge filling geometric data calculations, which greatly reduces the amount of calculation. In order to ensure that the rendering performance of this solution remains at the millisecond level, this solution uses a culling algorithm to reduce the number of objects that need to be displayed before the first drawing, which will not cause a decrease in rendering performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of this application. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation of the present disclosure. In the drawings:
[0012] Figure 1 is a hardware structure block diagram of a computing device for implementing the method according to embodiment 1 of the present disclosure;
[0013] Figure 2 is a schematic flow chart of a method for displaying a three-dimensional illustration according to the first aspect of Embodiment 1 of the present disclosure;
[0014] Figure 3 1 is a flow chart of performing backside expansion drawing on each grid according to embodiment 1 of the present disclosure;
[0015] Figure 4 This is the first illustration without edge filling;
[0016] Figure 5 It is a schematic diagram showing the final effect of the three-dimensional illustration of the present invention;
[0017] Figure 6 is a schematic diagram of a display device for a three-dimensional illustration of the present invention; and
[0018] Figure 7 Schematic diagram of another three-dimensional illustration display device of the present invention. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present disclosure.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0021] View Space (Camera Space): A coordinate system with the camera as its origin. The coordinates of all objects are relative to the camera's position and orientation. In this space, the camera is located at the origin, typically facing the -Z axis, to facilitate subsequent projection calculations (such as perspective projection).
[0022] Normalized Device Coordinates (NDC) space is an intermediate space used to normalize vertex coordinates in 3D rendering. Its coordinate range is [-1, 1] (all three axes fall within this range). The core function of this space is to unify vertex coordinates of different projection types into a standardized range, facilitating subsequent conversion to screen space coordinates.
[0023] Screen Space: The coordinates in the NDC space are converted to the screen space through the viewport transformation matrix (ViewportTransformation). The coordinates in the screen space correspond to the pixel coordinates that are finally displayed on the screen.
[0024] Example 1
[0025] According to this embodiment, a display embodiment of a three-dimensional illustration is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0026] The method embodiment provided in this embodiment can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computing device for realizing the display of a three-dimensional illustration. Figure 1As shown, a computing device may include one or more processors (the processor may include, but is not limited to, a microprocessor (MCU) or a programmable logic device (FPGA) or other processing device), a memory for storing data, a transmission device for communication functions, and an input / output interface. The memory, transmission device, and input / output interface are connected to the processor via a bus. In addition, it may also include: a display, a keyboard, and a cursor control device connected to the input / output interface. Those skilled in the art will understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0027] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry." The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be fully or partially integrated into any of the other components of the computing device. As discussed in the embodiments of the present disclosure, the data processing circuitry functions as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0028] The memory can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the display of the three-dimensional illustrations in the embodiment of the present disclosure. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizes the display method of the three-dimensional illustrations of the above-mentioned application. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely located relative to the processor, and these remote memories may be connected to the computing device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0029] The transmission device is used to receive or send data via a network. Specific examples of the aforementioned network may include a wireless network provided by a communications provider of the computing device. In one embodiment, the transmission device includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0030] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computing device.
[0031] It should be noted that, in some optional embodiments, the above Figure 1 The computing device shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computing device described above.
[0032] In the above operating environment, according to a first aspect of this embodiment, a method for displaying a three-dimensional illustration is provided. Figure 2 A schematic diagram of the process is shown in FIG. Figure 2 As shown, the method includes:
[0033] S202: Draw a mesh of the target object in the three-dimensional model, and save only depth information of the mesh in a drawing buffer.
[0034] The target object is an object that needs to be displayed in the three-dimensional model.
[0035] In the present invention, a three-dimensional illustration is an image with a three-dimensional effect generated by rendering a three-dimensional model onto a screen plane.
[0036] A mesh is a geometric structure composed of vertices, edges, and faces, used to describe the shape of an object. In the present invention, methods for drawing a mesh of a target object may include, but are not limited to, the following methods:
[0037] Polygonal modeling uses basic geometric shapes (such as cubes, spheres, cylinders, etc.) as a starting point and gradually refines the model by adding, deleting, and moving vertices, edges, and faces.
[0038] Curve modeling uses curves (such as Bezier curves and NURBS curves) to define the outline of an object. Meshes are generated through lofting, rotational lofting, and other methods.
[0039] Scanning modeling uses 3D scanning equipment (such as laser scanners, structured light scanners, etc.) to obtain the surface data of the object and then convert it into a mesh.
[0040] Image-based modeling reconstructs a 3D mesh from multiple photos of an object. Using two or more photos taken from different angles, the disparity is calculated to reconstruct depth information. Alternatively, multiple photos taken under different lighting conditions are used to analyze lighting changes to reconstruct the object's surface normals and, in turn, the mesh.
[0041] Subdivision surface modeling starts with a low-resolution mesh and gradually generates a high-resolution smooth mesh through a subdivision algorithm.
[0042] Physics-based modeling generates meshes by simulating physical processes (such as fluid dynamics and elasticity). Fluid dynamics algorithms are used to simulate the flow of liquids and generate a mesh of the liquid surface. Alternatively, finite element methods are used to simulate the elastic deformation of objects and generate a mesh of the deformed surface.
[0043] In the present invention, the existing high-resolution mesh can also be optimized to reduce the number of vertices and faces while maintaining the visual effect of the model.
[0044] S204 , overlaying and drawing the contour line of the target object in the drawn grid, and saving the depth information, color information, and template information of the contour line in the drawing buffer area to obtain an initial three-dimensional illustration.
[0045] The initial three-dimensional illustration only displays the contour line of the target object, but does not display the mesh surface of the target object, and the displayed contour line is missing in a partial visual area displayed on the screen.
[0046] In the present invention, the drawing buffer may include:
[0047] The depth buffer is used to store the depth information of the drawing;
[0048] The color buffer is used to store the color information of the drawing;
[0049] The template buffer is used to store the drawn module information.
[0050] S206. Set the color information of all meshes in the initial three-dimensional illustration as the color information of the contour line, and perform back-end expansion drawing on all meshes in the initial three-dimensional illustration based on the data in the drawing buffer and the set color information to obtain a final three-dimensional illustration.
[0051] Among them, all grids in the final three-dimensional illustration are expanded by a preset width along the normal direction in the normalized device coordinate space, and the geometric areas displayed due to back-face drawing in each grid after expansion and the missing contour lines visually form continuous completion lines.
[0052] Optionally, in 202, before drawing the mesh of the target object in the three-dimensional model, the method further includes:
[0053] The objects that do not need to be displayed in the three-dimensional model are eliminated using a preset elimination algorithm, and the objects that need to be displayed in the three-dimensional model are retained.
[0054] It should be noted that, in the present invention, the preset culling algorithm can be pre-set before implementing the present invention. The culling algorithm is used to reduce the amount of rendering calculations and improve rendering efficiency. For example, in the present invention, the culling algorithm may include but is not limited to:
[0055] 1. The frustum culling algorithm determines whether a 3D model or object is within the camera's frustum. If an object is completely outside the frustum, it is not rendered and is culled. This method decomposes the frustum into six planes (left-right, top-bottom, and front-back) and determines whether the object is inside the frustum by calculating the intersection of the object's bounding box with these planes. If the object's bounding box intersects all six planes of the frustum, the object is inside the frustum; otherwise, the object is outside.
[0056] 2. Backface culling: This algorithm determines the orientation of polygons. If a polygon's normal points away from the camera, it is considered a backface polygon and can be culled. This method calculates the direction of the polygon's normal and then determines the polygon's orientation based on the camera's position and direction. This is typically done by taking the dot product of the polygon's vertex normal vector and the camera's direction vector. If the dot product is negative, the polygon is backfaced.
[0057] 3. Occlusion culling: This algorithm determines whether an object is occluded by other objects. If completely occluded, it is not rendered. During the rendering process, this method uses the depth buffer to record the depth value of each pixel and compares the depth value of the newly rendered object to determine whether it is occluded. Objects in the scene are represented by hierarchical bounding boxes, and occluded objects are culled by determining the occlusion relationship between bounding boxes.
[0058] 4. The Level of Detail (LOD) culling algorithm uses models with different LODs for rendering based on the object's distance from the camera. Objects farther away use low-detail models, while objects closer use high-detail models. This method pre-prepare multiple LOD models for each object. During rendering, the appropriate model is dynamically selected based on the object's distance from the camera.
[0059] 5. Screen-space culling: In screen space, objects are determined to be rendered based on their projected size and position on the screen. This method calculates the bounding box of the object's projection on the screen and culls the object if it exceeds the screen bounds. For partially visible objects that are off-screen, further determination is made to determine if they intersect the screen.
[0060] 6. Spatial segmentation culling algorithm divides the scene into multiple subspaces (such as octree, quadtree, etc.) and eliminates objects in the entire subspace by judging the relationship between the subspace and the viewing frustum or camera.
[0061] Optionally, in S204, superimposing and drawing the outline of the target object in the drawn grid includes:
[0062] Compare the depth value of each line segment in the currently drawn contour line with the existing depth value in the depth buffer; wherein the existing depth value includes the depth information of all drawn meshes and the depth information of the drawn contour line;
[0063] The line segment to be rendered to the screen is determined based on the comparison result.
[0064] In this step, you can also overlay the outline of the object you want to display on the drawn grid. At this time, because the depth data drawn on the grid surface still exists, a depth test is performed with the currently drawn outline, which creates the effect that the line is blocked by the grid surface.
[0065] In this invention, depth testing refers to determining which line segments should be rendered to the screen by comparing the depth value of each line segment in the currently drawn contour with the depth values already in the depth buffer (including already drawn meshes and contours, where the depth, color, and module information of each contour line is automatically saved to the buffer after each contour line is drawn). Optionally, the rule can be: if the line segment depth is less than the buffer value, it is visible (i.e., drawn); if the line segment depth is greater than or equal to the buffer value, it is occluded (i.e., not drawn), thereby ensuring correct occlusion relationships.
[0066] After this step, an initial three-dimensional illustration is obtained, which is referred to as the first illustration in the present invention. Figure 4 As shown, this illustration only displays the object's borders, not the object's mesh faces. However, the displayed borders can be obscured by undisplayed mesh faces (i.e., the obscuration relationship is still preserved). Note that the first illustration has not yet been edge-filled.
[0067] Optionally, in S206, the operation of storing only the depth information of the mesh in the rendering buffer includes:
[0068] After drawing the mesh of the target object in the three-dimensional model, the depth information, color information and template information of the mesh are saved in the drawing buffer; and the color information and template information of all meshes in the drawing buffer are cleared.
[0069] In this step, the mesh's color and template are cleared from the cache data, leaving only the depth buffer data. This means that only the depth information is retained, not the color or template information. This results in the subsequent illustration displaying only the border (outline) but not the mesh.
[0070] In this step, the color and template of the grid in the cache data are cleared, and only the data in the depth buffer is retained, which can achieve the following technical effects:
[0071] 1. Improve rendering efficiency. For example, reduce unnecessary fragment shading calculations. In the rendering process of the existing technology, each fragment will go through the fragment shader to calculate the color value. If a fragment is eventually occluded by other closer fragments, then its color calculation is redundant. By retaining only the depth information, it is possible to determine which fragments are invisible at an early stage, thereby skipping the color calculation for these fragments. This can significantly reduce the computational burden of the fragment shader and improve rendering efficiency. For example, reduce bandwidth usage. During the rendering process, the reading and writing operations of color and template information will occupy the video memory bandwidth. If only the depth information is retained, these unnecessary read and write operations can be reduced, thereby reducing the use of video memory bandwidth and further improving rendering performance.
[0072] 2. Optimize the rendering of complex scenes. In complex scenes, there may be a large number of occlusion relationships between objects. By retaining only depth information, these occlusion relationships can be handled more efficiently, avoiding unnecessary rendering of occluded objects. For example, in a scene containing a large number of transparent or semi-transparent objects, depth pre-testing can help quickly determine which objects do not require transparency blending calculations, thereby optimizing the rendering process.
[0073] 3. Reduce resource consumption. Clearing the color and stencil buffers reduces video memory usage. On some resource-constrained devices, this can significantly improve rendering performance. Furthermore, retaining only depth information reduces cache fragmentation and improves cache utilization. This helps improve data access efficiency during rendering, further improving performance.
[0074] 4. Improve shadow rendering performance. In shadow mapping, only depth information is typically required to calculate shadows. By retaining only depth information, shadow maps can be generated more efficiently, thereby improving shadow rendering performance. Furthermore, ambient occlusion calculations often rely on depth information. By retaining only depth information, ambient occlusion effects can be calculated more efficiently, improving the realism of the scene.
[0075] 5. Reduce rendering errors. When processing transparent objects, existing rendering methods can cause sorting errors, resulting in incorrect rendering results. By retaining only depth information and using deferred shading techniques, transparent objects can be rendered more accurately, avoiding these errors. In addition, by reducing unnecessary calculations and data processing, the rendering process can be more stable, reducing rendering errors and anomalies.
[0076] Optionally, in S206, back-end expansion rendering is performed on each mesh in the initial three-dimensional illustration, such as Figure 3 As shown, including:
[0077] S302, calculating first position information of each vertex in the view space based on the position information of the vertex in the local coordinate system of the three-dimensional model;
[0078] In this step, the position of the vertex in the view space is calculated. The purpose is to transform the vertex coordinates into a coordinate system with the camera as the origin to facilitate subsequent projection calculations.
[0079] Optionally, the coordinate calculation relationship can be: vertex position in view space = model vertex position * model view matrix.
[0080] Optionally, the model view matrix is calculated using the following formula:
[0081] ;
[0082] in, is the model matrix, is the view matrix (View Matrix), is the model view matrix.
[0083] Optionally, the model matrix represents the transformation of an object from its local coordinate system to the world coordinate system. It is composed of the following basic transformations: Translation: Positions the object in the world coordinate system. Rotation: Adjusts the orientation of the object. Scale: Adjusts the size of the object.
[0084] Assuming that the model needs to be scaled (S), then rotated (R), and finally translated (T), the model matrix is:
[0085] ;
[0086] Optionally, the view matrix transforms the world coordinate system into the camera coordinate system (with the camera as the origin and facing the -z axis). Its core is to calculate the three orthogonal axes of the camera: the right vector (R), the up vector (U), and the forward vector (F), and use them to construct the rotation matrix. The specific process includes:
[0087] 1. Input parameters: Camera position: , represents the x-axis coordinate of the camera , y-axis coordinate and the z-axis coordinate ;Observe the target point: , represents the x-axis coordinate of the observation point , y-axis coordinate and the z-axis coordinate ; World space up direction: (Usually the Y axis).
[0088] 2. Calculate three orthogonal vectors
[0089] Forward vector (F): points to the direction of the observed target and needs to be normalized.
[0090] ;
[0091] F represents the x-axis coordinate of the forward vector , y-axis coordinate and the z-axis coordinate , Represents a normalization operation.
[0092] Right vector (R): obtained by cross-producting the forward vector F with the "upward direction" of the world space and needs to be normalized.
[0093] ;
[0094] R represents the x-axis coordinate of the right vector , y-axis coordinate and the z-axis coordinate .
[0095] Up vector (U): obtained by cross-producting the right vector and the forward vector to ensure that the three vectors are orthogonal.
[0096] ;
[0097] U represents the x-axis coordinate of the up vector , y-axis coordinate and the z-axis coordinate .
[0098] 3. Construct the view matrix. The view matrix consists of a rotation part and a translation part:
[0099] Rotation Matrix : Aligns the world coordinate system to the camera coordinate system. The camera's right vector (R) corresponds to the +x axis of the view coordinate system, and the camera's up vector (U) corresponds to the +y axis of the view coordinate system. The camera's forward vector (-F) corresponds to the -z axis of the view coordinate system (since it faces -z by default).
[0100] ;
[0101] is the component of the right vector R, corresponding to the x-axis of the view coordinate system.
[0102] is the component of the up vector U, corresponding to the y-axis of the view coordinate system.
[0103] It is the opposite direction of the forward vector F, corresponding to the -z axis of the view coordinate system.
[0104] Translation Matrix : Move the camera position to the origin.
[0105] ;
[0106] Finally, the view matrix is:
[0107] ;
[0108] S304: Calculate the outward expansion direction of the vertex in the normalized device coordinate space based on the normal of the three-dimensional model;
[0109] Optionally, this step includes the following steps:
[0110] 1. Calculate the normal in world space and set the z-axis value to -0.5 (to prevent the expanded back-facing vertices from blocking the front-facing patches). World space is the coordinate system of the entire scene, in which the positions of all objects are relative to the scene origin.
[0111] Normal in world space = model normal Normal matrix;
[0112] 2. Calculate the normal in NDC space;
[0113] Normal in NDC space = Normal in world space Projection Matrix
[0114] 3. Normalize the normals in NDC space to ensure that the expansion direction is a unit vector. This gives the vertex's expansion direction, which is the direction along which the vertex will be expanded.
[0115] Among them, the normal matrix is used to transform the normal vector of the model space to the world space, and its mathematical essence is the inverse transpose matrix of the model matrix.
[0116] The model matrix is:
[0117] ;
[0118] T is the translation matrix, which does not affect the direction of the normal;
[0119] R is a rotation matrix and an orthogonal matrix, that is, it satisfies ;
[0120] S is the scaling matrix. Non-uniform scaling will result in incorrect normal directions.
[0121] Since the normal is a direction vector, it is necessary to eliminate the influence of translation and correct the directional deviation caused by scaling.
[0122] ;
[0123] Therefore the normal matrix can be expressed as:
[0124] ;
[0125] When the model only includes rotation and translation, not scaling, the normal matrix is simplified to .
[0126] The projection matrix P converts the coordinates within the viewing cone into the clipping space coordinates. The core is to define the geometric parameters of the viewing cone. Take perspective projection as an example:
[0127] The parameters of perspective projection are: near plane distance n, far plane distance f, field of view angle fov (vertical direction), aspect ratio aspect.
[0128] The perspective projection matrix P is:
[0129] ;
[0130] The formula for normalizing the normal in NDC space is as follows:
[0131]
[0132] Where n normalized is the normalized plane normal, that is, the normal in the normalized NDC space; n ndc_xy is the normal in NDC space, is the modulus of the normal in NDC space.
[0133] S306. Calculate second position information of the vertex in a normalized device coordinate space based on the first position information.
[0134] Optional, calculated as:
[0135] The position of the vertex in NDC space = the position of the vertex in view space Projection matrix.
[0136] S308. Calculate, based on the second position information, third position information of the vertex in the normalized device coordinate space after the vertex is expanded outward by a preset width along the outward expansion direction;
[0137] The position of the model vertex after the normalized plane normal is expanded by a preset width is calculated. As a preferred example, the preset width is the width of the contour line.
[0138] The position of the vertex in NDC space after expansion = the position of the vertex in NDC space + the normalized plane normal Preset width.
[0139] S310, calculating fourth position information of the vertex in screen space based on the third position information;
[0140] Optional, calculated as:
[0141] The position of the vertex in screen space = the position of the vertex in NDC space after expansion Viewport transformation matrix;
[0142] The viewport transformation matrix (Viewport Transformation Matrix) is a matrix used in computer graphics to convert Normalized Device Coordinates (NDC) to Screen Coordinates. The NDC coordinate system is a cube with coordinates ranging from -1 to 1 in the x, y, and z directions. The viewport transformation maps these coordinates to a rectangular area on the actual display device, known as the viewport.
[0143] The viewport transformation matrix is a 4×4 homogeneous coordinate matrix. Assume that the coordinates of the lower left corner of the viewport on the screen are The width and height are W and H , the depth range is (Usually n=0, f=1). Then the viewport transformation matrix M viewport It can be expressed as:
[0144] .
[0145] Among them, the first row of the viewport transformation matrix scales the x coordinate and pan , mapping [-1,1] to .
[0146] The second row of the viewport transformation matrix scales the y coordinate and pan , mapping [-1,1] to , where the screen y-axis is positive downward.
[0147] The third row of the viewport transformation matrix scales the z coordinate and pan , mapping [0,1] to [ n, f ].
[0148] The transformation process is: given the normalized device coordinates , get the screen coordinates by matrix multiplication That is, the normalized device coordinate x-axis coordinate is , the y-axis coordinate is , the z-axis coordinate is , the screen coordinate x-axis coordinate is , the y-axis coordinate is , the z-axis coordinate is .
[0149] The calculation process is:
[0150] .
[0151] For example, assuming the viewport parameter is , the normalized coordinates are (0.5, -0.5, 0.8, 1), then the transformed screen coordinates are:
[0152] ;
[0153] ;
[0154] ;
[0155] The final screen coordinates are (700, 550, 0.9).
[0156] S312: Based on the data in the rendering buffer, the set color information, and the fourth position information, perform only back-face rendering on each mesh in the initial three-dimensional illustration.
[0157] After the above steps, the final 3D illustration is obtained. All grids in the final 3D illustration are expanded by a preset width along the normal direction in the normalized device coordinate space, and the geometric areas displayed due to back-drawing and the missing contour lines in each expanded grid form a continuous complementary line visually. The final 3D illustration, also referred to as the second illustration in the present invention, is Figure 5 Because the depth buffer is retained when implementing the contour occlusion effect, when drawing the back of the first illustration, the portion of the mesh that overlaps with the object drawn in the first illustration is not displayed. Only the outward expansion is displayed. For locations where the contour line is missing, the outward expansion is displayed as a contour line, thus indirectly achieving the line filling function.
[0158] The display method of the three-dimensional illustrations of the present invention does not require actual geometric data calculations to display a real edge line, but instead uses simple rendering techniques to achieve the edge filling function. In other words, the present invention uses rendering techniques to achieve the effect of illustrations, which can meet the requirements of large-scene model illustration effects. In addition, since rendering is used instead of traditional geometric data calculations for edge filling, the amount of calculation is greatly reduced. In order to ensure that the rendering performance of this solution remains at the millisecond level, this solution uses a culling algorithm to reduce the number of objects that need to be displayed before the first drawing, so that the rendering performance will not be reduced.
[0159] Furthermore, according to a second aspect of this embodiment, a storage medium is provided, wherein the storage medium includes a stored program, wherein when the program is executed, a processor executes any one of the above methods for displaying a three-dimensional illustration.
[0160] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0161] Through the description of the above embodiments, those skilled in the art will clearly understand that the methods according to the above embodiments can be implemented using software plus the necessary general-purpose hardware platform. Of course, hardware can also be used, but in many cases the former is a more preferred embodiment. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, or optical disk) and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0162] Example 2
[0163] Figure 6 The illustration display device according to this embodiment is shown, which corresponds to the method according to the first aspect of embodiment 1. Figure 6 As shown, the device includes:
[0164] The outline occlusion module 610 is configured to draw a mesh of a target object in the three-dimensional model and store only depth information of the mesh in a drawing buffer; wherein the target object is an object to be displayed in the three-dimensional model; overlay the outline of the target object on the drawn mesh, and store the depth information, color information, and template information of the outline in the drawing buffer to obtain an initial three-dimensional illustration; wherein the initial three-dimensional illustration only displays the outline of the target object and does not display the mesh surface of the target object, and the displayed outline is missing in a portion of the visual area displayed on the screen;
[0165] The edge filling module 620 is configured to set the color information of all meshes in the initial three-dimensional illustration as the color information of the contour line, and perform back-end expansion drawing on all meshes in the initial three-dimensional illustration based on the data in the drawing buffer and the set color information to obtain a final three-dimensional illustration; wherein, all meshes in the final three-dimensional illustration are expanded by a preset width along the normal direction under the normalized device coordinate space, and the geometric areas displayed in each expanded mesh due to back-end drawing and the missing contour lines visually form continuous filling lines.
[0166] The three-dimensional illustration is an image with a three-dimensional sense generated by rendering a three-dimensional model onto a screen plane.
[0167] Optionally, the outline blocking module 610 is further configured to, before drawing the mesh of the target object in the three-dimensional model, use a preset culling algorithm to remove objects that do not need to be displayed in the three-dimensional model, and retain objects that need to be displayed in the three-dimensional model.
[0168] Optionally, the outline shielding module 610 is further configured to store only the depth information of the mesh in the rendering buffer, specifically including:
[0169] After drawing the mesh of the target object in the three-dimensional model, saving the depth information, color information and template information of the mesh into the drawing buffer; and
[0170] Clear the color information and template information of all meshes in the drawing buffer.
[0171] Optionally, the outline shielding module 610 is further configured to superimpose the outline of the target object in the drawn grid, specifically including:
[0172] Compare the depth value of each line segment in the currently drawn contour line with the existing depth value in the depth buffer; wherein the existing depth value includes the depth information of all drawn meshes and the depth information of the drawn contour line;
[0173] The line segment to be rendered to the screen is determined based on the comparison result.
[0174] Optionally, the edge patching module 620 is further configured to perform back-face expansion rendering on each mesh in the initial 3D illustration by the following steps:
[0175] Calculating first position information of each vertex in the view space based on position information of the vertex in the local coordinate system of the three-dimensional model;
[0176] Calculating an outward expansion direction of the vertex in a normalized device coordinate space based on a normal of the three-dimensional model;
[0177] Calculating second position information of the vertex in a normalized device coordinate space based on the first position information;
[0178] Calculating, based on the second position information, third position information of the vertex in the normalized device coordinate space after the vertex is expanded outward by a preset width along the outward expansion direction;
[0179] Calculating fourth position information of the vertex in screen space based on the third position information;
[0180] Based on the data in the rendering buffer, the set color information, and the fourth position information, only back-face rendering is performed on each mesh in the initial three-dimensional illustration.
[0181] Optionally, the preset width is the width of the contour line.
[0182] Optionally, the depth information is stored in a depth buffer, the color information is stored in a color buffer, and the template information is stored in a template buffer.
[0183] According to this embodiment, there is no need to perform actual geometric data calculations and display a real edge line. Instead, a simple rendering technique is used to implement the edge filling function. The present invention uses rendering techniques to achieve the effect of illustrations, which can meet the requirements of large-scene model illustration effects. In addition, the present invention uses rendering instead of traditional edge filling geometric data calculations, which greatly reduces the amount of calculation. In order to ensure that the rendering performance of this solution remains at the millisecond level, this solution uses a culling algorithm to reduce the number of objects that need to be displayed before the first drawing, which will not cause a decrease in rendering performance.
[0184] Example 3
[0185] Figure 7 The illustration display device according to this embodiment is shown, which corresponds to the method according to the first aspect of embodiment 1. Figure 7 As shown, the apparatus includes: a processor 710; and
[0186] The memory 720 is connected to the processor 710 and is configured to provide the processor 710 with instructions for processing the following steps:
[0187] Drawing a mesh of a target object in the three-dimensional model, and saving only depth information of the mesh in a drawing buffer; wherein the target object is an object to be displayed in the three-dimensional model;
[0188] Drawing the outline of the target object superimposed on the drawn grid, and saving depth information, color information, and template information of the outline in the drawing buffer to obtain an initial three-dimensional illustration; wherein the initial three-dimensional illustration only displays the outline of the target object and does not display the grid surface of the target object, and the displayed outline is missing in a portion of the visual area displayed on the screen;
[0189] Setting the color information of all meshes in the initial three-dimensional illustration as the color information of the contour line, and performing back-face expansion drawing on all meshes in the initial three-dimensional illustration based on the data in the drawing buffer and the set color information to obtain a final three-dimensional illustration; wherein all meshes in the final three-dimensional illustration are expanded by a preset width along the normal direction in the normalized device coordinate space, and the geometric areas displayed in each expanded mesh due to back-face drawing and the missing contour line visually form a continuous complementary line;
[0190] The three-dimensional illustration is an image with a three-dimensional effect generated by rendering a three-dimensional model onto a screen plane.
[0191] Optionally, the memory 720 is further configured to provide the processor 710 with instructions for processing the following steps:
[0192] Before drawing the mesh of the target object in the three-dimensional model, the method further includes:
[0193] The objects that do not need to be displayed in the three-dimensional model are eliminated using a preset elimination algorithm, and the objects that need to be displayed in the three-dimensional model are retained.
[0194] Optionally, the memory 720 is further configured to provide the processor 710 with instructions for processing the following steps:
[0195] Only the depth information of the mesh is stored in the drawing buffer, specifically including:
[0196] After drawing the mesh of the target object in the three-dimensional model, saving the depth information, color information and template information of the mesh into the drawing buffer; and
[0197] Clear the color information and template information of all meshes in the drawing buffer.
[0198] Optionally, the memory 720 is further configured to provide the processor 710 with instructions for processing the following steps:
[0199] Drawing the outline of the target object in the drawn grid by overlaying it specifically includes:
[0200] Compare the depth value of each line segment in the currently drawn contour line with the existing depth value in the depth buffer; wherein the existing depth value includes the depth information of all drawn meshes and the depth information of the drawn contour line;
[0201] The line segment to be rendered to the screen is determined based on the comparison result.
[0202] Optionally, the memory 720 is further configured to provide the processor 710 with instructions for processing the following steps:
[0203] Perform backface expansion painting on each mesh in the initial 3D illustration using the following steps:
[0204] Calculating first position information of each vertex in the view space based on position information of the vertex in the local coordinate system of the three-dimensional model;
[0205] Calculating an outward expansion direction of the vertex in a normalized device coordinate space based on a normal of the three-dimensional model;
[0206] Calculating second position information of the vertex in a normalized device coordinate space based on the first position information;
[0207] Calculating, based on the second position information, third position information of the vertex in the normalized device coordinate space after the vertex is expanded outward by a preset width along the outward expansion direction;
[0208] Calculating fourth position information of the vertex in screen space based on the third position information;
[0209] Based on the data in the rendering buffer, the set color information, and the fourth position information, only back-face rendering is performed on each mesh in the initial three-dimensional illustration.
[0210] Optionally, the preset width is the width of the contour line.
[0211] Optionally, the depth information is stored in a depth buffer, the color information is stored in a color buffer, and the template information is stored in a template buffer.
[0212] According to this embodiment, there is no need to perform actual geometric data calculations and display a real edge line. Instead, a simple rendering technique is used to implement the edge filling function. The present invention uses rendering techniques to achieve the effect of illustrations, which can meet the requirements of large-scene model illustration effects. In addition, the present invention uses rendering instead of traditional edge filling geometric data calculations, which greatly reduces the amount of calculation. In order to ensure that the rendering performance of this solution remains at the millisecond level, this solution uses a culling algorithm to reduce the number of objects that need to be displayed before the first drawing, which will not cause a decrease in rendering performance.
[0213] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0214] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0215] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0216] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0217] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0218] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or 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 for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), a mobile hard drive, a magnetic disk, or an optical disk.
[0219] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A method for displaying a three-dimensional illustration, characterized in that: The three-dimensional illustration is an image with a three-dimensional sense generated by rendering a three-dimensional model onto a screen plane, and the display method includes: Drawing a mesh of a target object in the three-dimensional model, and saving only depth information of the mesh in a drawing buffer; wherein the target object is an object to be displayed in the three-dimensional model; Drawing the outline of the target object superimposed on the drawn grid, and saving depth information, color information, and template information of the outline in the drawing buffer to obtain an initial three-dimensional illustration; wherein the initial three-dimensional illustration only displays the outline of the target object and does not display the grid surface of the target object, and the displayed outline is missing in a portion of the visual area displayed on the screen; Setting the color information of all meshes in the initial three-dimensional illustration as the color information of the contour line, and performing back-face expansion drawing on all meshes in the initial three-dimensional illustration based on the data in the drawing buffer and the set color information to obtain a final three-dimensional illustration; wherein all meshes in the final three-dimensional illustration are expanded by a preset width along the normal direction in the normalized device coordinate space, and the geometric areas displayed in each expanded mesh due to back-face drawing and the missing contour line visually form a continuous complementary line; The back-face expansion drawing is performed on each mesh in the initial 3D illustration by the following steps: Calculating first position information of each vertex in the view space based on position information of the vertex in the local coordinate system of the three-dimensional model; Calculating an outward expansion direction of the vertex in a normalized device coordinate space based on a normal of the three-dimensional model; Calculating second position information of the vertex in a normalized device coordinate space based on the first position information; Calculating, based on the second position information, third position information of the vertex in the normalized device coordinate space after the vertex is expanded outward by a preset width along the outward expansion direction; Calculating fourth position information of the vertex in screen space based on the third position information; Based on the data in the rendering buffer, the set color information, and the fourth position information, only back-face rendering is performed on each mesh in the initial three-dimensional illustration.
2. The method according to claim 1, characterized in that Before drawing the mesh of the target object in the three-dimensional model, the method further includes: The objects that do not need to be displayed in the three-dimensional model are eliminated using a preset elimination algorithm, and the objects that need to be displayed in the three-dimensional model are retained.
3. The method according to claim 1, wherein storing only the depth information of the mesh in the rendering buffer comprises: After drawing the mesh of the target object in the three-dimensional model, saving the depth information, color information and template information of the mesh into the drawing buffer; as well as Clear the color information and template information of all meshes in the drawing buffer.
4. The method according to claim 1, wherein The step of superimposing and drawing the contour line of the target object in the drawn grid includes: Compare the depth value of each line segment in the currently drawn contour line with the existing depth value in the depth buffer; wherein the existing depth value includes the depth information of all drawn meshes and the depth information of the drawn contour line; The line segment to be rendered to the screen is determined based on the comparison result.
5. The method according to claim 1, wherein The preset width is the width of the contour line.
6. The method according to claim 1, characterized in that The depth information is stored in a depth buffer, the color information is stored in a color buffer, and the template information is stored in a template buffer.
7. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is run, the processor executes the method according to any one of claims 1 to 6.
8. A three-dimensional illustration display device, characterized in that: The three-dimensional illustration is an image with a three-dimensional sense generated by rendering a three-dimensional model onto a screen plane, and the display device includes: a contour occlusion module configured to draw a mesh of a target object in the three-dimensional model and save only depth information of the mesh in a drawing buffer; wherein the target object is an object to be displayed in the three-dimensional model; draw a contour line of the target object superimposed on the drawn mesh, and save depth information, color information, and template information of the contour line in the drawing buffer to obtain an initial three-dimensional illustration; wherein the initial three-dimensional illustration only displays the contour line of the target object and does not display the mesh surface of the target object, and the displayed contour line is missing in a portion of the visual area displayed on the screen; an edge infill module configured to set the color information of all meshes in the initial three-dimensional illustration to the color information of the contour line, and perform back-end expansion drawing on all meshes in the initial three-dimensional illustration based on the data in the drawing buffer and the set color information to obtain a final three-dimensional illustration; wherein all meshes in the final three-dimensional illustration are expanded by a preset width along the normal direction in the normalized device coordinate space, and the geometric areas displayed in each expanded mesh due to back-end drawing and the missing contour line visually form a continuous completion line; The back-face expansion drawing is performed on each mesh in the initial 3D illustration by the following steps: Calculating first position information of each vertex in the view space based on position information of the vertex in the local coordinate system of the three-dimensional model; Calculating an outward expansion direction of the vertex in a normalized device coordinate space based on a normal of the three-dimensional model; Calculating second position information of the vertex in a normalized device coordinate space based on the first position information; Calculating, based on the second position information, third position information of the vertex in the normalized device coordinate space after the vertex is expanded outward by a preset width along the outward expansion direction; Calculating fourth position information of the vertex in screen space based on the third position information; Based on the data in the rendering buffer, the set color information, and the fourth position information, only back-face rendering is performed on each mesh in the initial three-dimensional illustration.
9. An illustration display device, characterized in that: include: processor; as well as A memory, connected to the processor, configured to provide the processor with instructions for processing the following processing steps: Drawing a mesh of a target object in a three-dimensional model, and saving only depth information of the mesh in a drawing buffer; wherein the target object is an object to be displayed in the three-dimensional model; Drawing the outline of the target object superimposed on the drawn grid, and saving depth information, color information, and template information of the outline in the drawing buffer to obtain an initial three-dimensional illustration; wherein the initial three-dimensional illustration only displays the outline of the target object and does not display the grid surface of the target object, and the displayed outline is missing in a portion of the visual area displayed on the screen; Setting the color information of all meshes in the initial three-dimensional illustration as the color information of the contour line, and performing back-face expansion drawing on all meshes in the initial three-dimensional illustration based on the data in the drawing buffer and the set color information to obtain a final three-dimensional illustration; wherein all meshes in the final three-dimensional illustration are expanded by a preset width along the normal direction in the normalized device coordinate space, and the geometric areas displayed in each expanded mesh due to back-face drawing and the missing contour line visually form a continuous complementary line; The three-dimensional illustration is an image with a three-dimensional effect generated by rendering a three-dimensional model onto a screen plane; The back-face expansion drawing is performed on each mesh in the initial 3D illustration by the following steps: Calculating first position information of each vertex in the view space based on position information of the vertex in the local coordinate system of the three-dimensional model; Calculating an outward expansion direction of the vertex in a normalized device coordinate space based on a normal of the three-dimensional model; Calculating second position information of the vertex in a normalized device coordinate space based on the first position information; Calculating, based on the second position information, third position information of the vertex in the normalized device coordinate space after the vertex is expanded outward by a preset width along the outward expansion direction; Calculating fourth position information of the vertex in screen space based on the third position information; Based on the data in the rendering buffer, the set color information, and the fourth position information, only back-face rendering is performed on each mesh in the initial three-dimensional illustration.
Citation Information
Patent Citations
Real-time grid contour vectorization and rendering system based on GPU
CN114693851A
Method For Applying Shading Effect To 3D RenderingImages And Information Storage Medium Storing AProgram Implementing The Same
KR1020030083962A