A method and device for generating a curved graph based on a three-dimensional camera view angle

By using a curve generation method based on a 3D camera perspective, a plane is constructed using 2D pixel curves and 3D camera coordinate points to generate curve segments. This solves the problems of complex operation and low computational efficiency in existing technologies, and realizes intuitive and efficient curve generation in 3D space, which is suitable for real-time interaction and high-precision modeling.

CN121010732BActive Publication Date: 2026-05-08BEIJING ADSS DEV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING ADSS DEV
Filing Date
2025-07-23
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing 3D curve generation technologies are complex to operate, lack intuitiveness, have low computational efficiency, and are difficult to control curves precisely in 3D space, especially in real-time interactive and high-precision modeling scenarios where performance challenges are severe.

Method used

By acquiring two-dimensional pixel curves and three-dimensional camera coordinate points, multiple planes are constructed. Curve segments are generated based on the planes and preset conditions. By combining viewport transformation and inverse projection transformation, the two-dimensional data point set is transformed into three-dimensional space, and curves are dynamically generated, improving intuitiveness and computational efficiency.

Benefits of technology

It enables intuitive and rapid curve generation in 3D space, reducing computational load and improving computational efficiency. It is suitable for real-time interactive and high-precision modeling scenarios, enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121010732B_ABST
    Figure CN121010732B_ABST
Patent Text Reader

Abstract

The embodiment of the specification provides a curve figure generation method and device based on a three-dimensional camera perspective, wherein the method comprises the following steps: acquiring a two-dimensional pixel curve and a three-dimensional camera coordinate point; obtaining a two-dimensional data point set according to the two-dimensional pixel curve; projecting the two-dimensional data point set into a three-dimensional space to obtain a three-dimensional data point set; constructing a plurality of planes according to the three-dimensional data point set and the three-dimensional camera coordinate point; generating a plurality of curve segments according to each plane, a preset target three-dimensional model, the three-dimensional data point set and a preset line segment limitation condition; and connecting each curve segment to obtain a complete three-dimensional curve figure. Therefore, the calculation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of computer graphics technology, and in particular to a method and apparatus for generating curve graphics based on the perspective of a three-dimensional camera. Background Technology

[0002] Three-dimensional curves are the optimal solution for describing complex spatial trajectories.

[0003] In existing 3D modeling and graphics generation technologies, 3D curve graphics are usually generated by generating parametric equations through Bézier curves or B-spline curves, or directly by manual drawing by the user.

[0004] However, existing technologies rely on mathematical parameters, requiring users to input complex control points or parameters, making the operation complicated; at the same time, manually drawing curves in three-dimensional space is difficult to control precisely and lacks intuitiveness; and traditional methods may require a lot of calculations to generate curves that fit the viewpoint, resulting in low computational efficiency. Summary of the Invention

[0005] In view of the above solutions, this application aims to propose a method and apparatus for generating curve graphics based on the perspective of a three-dimensional camera, so as to solve at least one of the above technical problems.

[0006] Firstly, one or more embodiments of this specification provide a method for generating curve graphics based on a three-dimensional camera perspective, including:

[0007] Obtain 2D pixel curves and 3D camera coordinates;

[0008] Based on the two-dimensional pixel curve, a two-dimensional data point set is obtained;

[0009] The two-dimensional data point set is projected into three-dimensional space to obtain a three-dimensional data point set;

[0010] Based on the set of 3D data points and the coordinates of the 3D camera, multiple planes are constructed;

[0011] Based on the planes, the preset target 3D model, the 3D data point set, and the preset line segment constraints, multiple curve segments are generated;

[0012] Connect the curve segments to obtain a complete three-dimensional curve graph.

[0013] Furthermore, based on the viewport transformation matrix, the two-dimensional data point set is mapped to the standardized device coordinate system to obtain the NDC coordinates;

[0014] Based on the inverse projection transformation, the NDC coordinates are transformed to the view space to obtain the view space coordinates;

[0015] Based on the inverse view transformation, the view space coordinates are transformed to the world coordinate system to obtain a three-dimensional data point set.

[0016] Further, traverse the data points in the three-dimensional data point set;

[0017] The three-dimensional data point set forms a plane with each two adjacent data points and the coordinate points of the three-dimensional camera;

[0018] After traversing all data points in the 3D data point set, multiple planes are obtained.

[0019] Furthermore, the plane includes the coordinates of the first data point and the second data point;

[0020] Determine the coordinate range based on the coordinates of the first data point and the second data point;

[0021] Based on the coordinate range and the preset target 3D model, determine the 3D point range of the model;

[0022] The intersection line is determined based on the 3D point range, the plane, the three-dimensional data point set, and the preset line segment constraints.

[0023] Based on the intersection line, multiple curve segments are generated.

[0024] Furthermore, the formula for calculating the intersection line is as follows:

[0025]

[0026] in, Represents three-dimensional data points on a plane;

[0027] This represents the distance from a 3D data point to the plane.

[0028] This represents the threshold.

[0029] Secondly, embodiments of this application provide a curve graphic generation device based on a three-dimensional camera perspective, comprising:

[0030] The acquisition module is used to acquire two-dimensional pixel curves and three-dimensional camera coordinate points;

[0031] A two-dimensional point set determination module is used to obtain a two-dimensional data point set based on the two-dimensional pixel curve;

[0032] A three-dimensional point set determination module is used to project the two-dimensional data point set into a three-dimensional space to obtain a three-dimensional data point set;

[0033] A plane construction module is used to construct multiple planes based on the set of 3D data points and the coordinate points of the 3D camera;

[0034] The curve segment generation module is used to generate multiple curve segments based on the planes, the preset target 3D model, the 3D data point set, and the preset line segment constraints.

[0035] The curve graph generation module is used to connect the curve segments to obtain a complete three-dimensional curve graph.

[0036] Furthermore, the 3D point set determination module is configured as follows:

[0037] Based on the viewport transformation matrix, the two-dimensional data point set is mapped to the standardized device coordinate system to obtain the NDC coordinates;

[0038] Based on the inverse projection transformation, the NDC coordinates are transformed to the view space to obtain the view space coordinates;

[0039] Based on the inverse view transformation, the view space coordinates are transformed to the world coordinate system to obtain a three-dimensional data point set.

[0040] Furthermore, the planar building module is configured as follows:

[0041] Traverse the data points in the three-dimensional data point set;

[0042] The three-dimensional data point set forms a plane with each two adjacent data points and the coordinate points of the three-dimensional camera;

[0043] After traversing all data points in the 3D data point set, multiple planes are obtained.

[0044] Furthermore, the curve segment generation module is configured as follows:

[0045] The plane includes the coordinates of the first data point and the second data point;

[0046] Determine the coordinate range based on the coordinates of the first data point and the second data point;

[0047] Based on the coordinate range and the preset target 3D model, determine the 3D point range of the model;

[0048] The intersection line is determined based on the 3D point range, the plane, and the preset line segment constraints;

[0049] Based on the intersection line, multiple curve segments are generated.

[0050] Thirdly, embodiments of this application provide a storage medium for storing computer-executable instructions, characterized in that, when executed, the computer-executable instructions implement the steps of the curve graphic generation method based on the three-dimensional camera perspective described in any one of the first aspects.

[0051] Compared with the prior art, this application can achieve at least the following technical effects:

[0052] This application can automatically perform 3D transformation on two-dimensional pixel curves when they are directly obtained, and then dynamically generate curves by using three-dimensional points and camera coordinate points, thereby improving intuitiveness and computational efficiency. Attached Figure Description

[0053] To more clearly illustrate the technical solutions in one or more embodiments of this specification or in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0054] Figure 1 A flowchart illustrating a method for generating curve graphics based on a 3D camera perspective, provided for one or more embodiments of this specification;

[0055] Figure 2 This is a schematic diagram of a curve graphic generation device based on a three-dimensional camera perspective, provided for one or more embodiments of this specification. Detailed Implementation

[0056] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this document.

[0057] In terms of parametric curve generation methods, whether it's Bézier curves, B-splines, or NURBS, they all heavily rely on precise mathematical parameter settings. These methods require users to have a deep understanding of technical concepts such as control points, node vectors, and weight coefficients, resulting in complex and unintuitive user interfaces. For example, adjusting NURBS curves often requires coordinating multiple parameters simultaneously; any slight change can cause drastic changes in the curve shape, making it difficult for non-professional users to quickly obtain the desired curve shape. Furthermore, high-order curve calculations are prone to numerical instability, which is particularly evident in scenarios requiring high-precision modeling.

[0058] Existing 3D curve drawing tools suffer from significant usability issues in interactive drawing methods. Due to the lack of effective spatial positioning assistance, users struggle to accurately grasp the curve's direction when drawing freely in a 3D environment, frequently resulting in jitter and discontinuity. While some systems attempt to improve the drawing experience through physical simulations (such as rubber band effects), this method is computationally expensive and introduces noticeable delays during real-time interaction, severely impacting the user experience. More importantly, curves generated by these methods typically require extensive manual adjustments and optimizations to meet engineering requirements.

[0059] In terms of computational efficiency, existing technologies face severe performance challenges. Parametric curves require frequent recalculation of basis functions and control points during dynamic editing, a process that consumes significant computational resources. In applications requiring real-time feedback (such as VR design and game development), this computational latency severely degrades the user experience. Furthermore, when dealing with high-precision modeling needs, such as complex surface modeling in aerospace or medical fields, the computational load of traditional methods increases exponentially, leading to a substantial decrease in work efficiency.

[0060] To address the aforementioned technical problems, this application proposes a method for generating curve graphics based on a 3D camera's perspective, such as... Figure 1 As shown, the specific steps are as follows:

[0061] Step S1: Obtain the two-dimensional pixel curve and the coordinate points of the three-dimensional camera.

[0062] In this embodiment, the user presses the start button in three-dimensional space using an interactive device (such as a mouse or VR controller) to draw the desired curve, and the background obtains the two-dimensional pixel curve drawn by the user. The current camera position K is obtained from the rendering engine (such as Unity or Unreal Engine).

[0063] Step S2: Obtain a two-dimensional data point set based on the two-dimensional pixel curve.

[0064] In this embodiment of the application, the coordinates of N 2D points during the two-dimensional pixel curve drawing process are statistically analyzed to obtain a two-dimensional data point set P(P1, P2, ..., P...). N ).

[0065] Step S3: Project the two-dimensional data point set into three-dimensional space to obtain a three-dimensional data point set.

[0066] In this embodiment, the two-dimensional data point set is mapped to the normalized device coordinate system based on the viewport transformation matrix to obtain NDC coordinates; the NDC coordinates are transformed to view space based on inverse projection transformation to obtain view space coordinates; and the view space coordinates are transformed to the world coordinate system based on inverse view transformation to obtain a three-dimensional data point set.

[0067] Specifically, first, the depth values ​​and camera parameters (projection matrix and view matrix) are read from the depth buffer. Then, the pixel coordinates in the 2D data point set are transformed to the Normalized Device Coordinate (NDC) system, ranging from [-1, 1], using the viewport transformation matrix. Second, the NDC coordinates are transformed back to view space using the inverse projection transformation matrix. Homogeneous coordinates are first constructed, and then clip space coordinates are obtained using the homogeneous coordinates and the inverse of the projection matrix. Perspective division is then used to convert the homogeneous coordinates to 3D view space coordinates, outputting the view space coordinates, where the view space coordinates represent the position relative to the camera in the 3D scene. Finally, the view space coordinates are transformed to the world coordinate system using the inverse view transformation. Non-homogeneous coordinates are extracted using the homogeneous coordinates and the inverse of the view matrix, and the 3D world coordinates are output, thus obtaining the 3D data point set.

[0068] In this application, by converting 2D coordinate points into 3D coordinate points, virtual interaction can break through the screen plane and truly integrate into the three-dimensional spatial logic, thereby making the three-dimensional interaction more accurate in operations such as picking up props in games; and it can accurately restore the three-dimensional position through inverse transformation, providing a basis for spatial query (such as light projection, collision detection), thereby solving the problem of "coordinate distortion" caused by perspective projection.

[0069] Step S4: Construct multiple planes based on the set of three-dimensional data points and the coordinates of the three-dimensional camera.

[0070] In this embodiment of the application, the data points in the three-dimensional data point set are traversed; every two adjacent data points in the three-dimensional data point set and the coordinate points of the three-dimensional camera form a plane; after traversing all the data points in the three-dimensional data point set, multiple planes are obtained.

[0071] Specifically, using a set of three-dimensional data points, each pair of adjacent points is used to form a plane with the camera coordinates, and three points form a plane.

[0072] For example, if the three-dimensional data point set has three-dimensional coordinate points a, b, c, d, and e, and the coordinate point of the three-dimensional camera is K, then a total of 4 planes are formed, namely plane 1, abK; plane 2, bcK; plane 3, cdK; and plane 4, deK.

[0073] Step S5: Generate multiple curve segments based on the planes, the preset target 3D model, the 3D data point set, and the preset line segment constraints.

[0074] In this embodiment, the plane includes the coordinates of a first data point and a second data point; a coordinate range is determined based on the coordinates of the first data point and the second data point; a 3D point range of the model is determined based on the coordinate range and the preset target 3D model; an intersection line is determined based on the 3D point range, the plane, the 3D data point set, and preset line segment constraints; and multiple curve segments are generated based on the intersection line.

[0075] Specifically, using constraints, the intersection of all 3D coordinate points within the target 3D model's range with each plane is calculated. If the intersection falls within a threshold range (such as the width of the intersection line), the intersection line is determined, and its texture color is set to red. Otherwise, the intersection line is set to the original texture color. This process is repeated for the second and third 3D data points, the third and fourth 3D data points, and so on, to determine the intersection lines. This results in multiple curve segments, where the intersection line is the line of intersection between the plane and the target 3D model. The formula for determining the intersection line is as follows:

[0076] First, calculate the equation of the plane passing through the three points;

[0077] Given three points on the plane , , The equation of the plane is The coefficient is calculated as follows:

[0078] normal vector There are two vectors and cross product:

[0079]

[0080] Expand into component form:

[0081]

[0082]

[0083]

[0084] D will... Substitute the plane equations to calculate:

[0085]

[0086] Second, calculate the distance from the point to the plane;

[0087] Using the given plane equations and each 3D data point The formula for the distance from a point to a plane is:

[0088]

[0089] Finally, determine whether the point is on the plane (or within the distance range);

[0090] Given the plane equation, 3D data points, and the maximum distance threshold d max Determine if the distance from a point to a plane is within [-d]. max d max Within the range:

[0091]

[0092] in, Represents three-dimensional data points on a plane;

[0093] This represents the distance from a 3D data point to the plane.

[0094] This represents the threshold.

[0095] For example, three points (p1, p2, CameraPt) are displayed in 3D space. They are not on the same straight line, and CameraPt is the coordinate point of the camera. An infinitely extending plane is calculated through these three points. Only the area between two points (p1, p2) is drawn; points outside this area are not displayed in red and are not calculated for intersection. The intersection of a 3D model and the plane is calculated, and the part where the model intersects the plane is displayed in red, while the part where they do not intersect is displayed in the color of the texture image. The line segments between two points are calculated (p2, p3, CameraPt), (p3, p4, CameraPt), (p4, p5, CameraPt)... and so on, and finally a curve is displayed. When a curve intersects the model, the intersection line is set to red. The final model and texture map need to be rendered using OpenGL on the graphics card. This process is divided into a geometry stage and a rasterization stage. In the geometry stage, vertex data from the 3D model is received, and the vertex shader performs coordinate transformation on each vertex, calculates vertex lighting and base color, and outputs clip space coordinates. Then, the geometry shader receives primitives (e.g., points, lines, triangles) as input. Clipping is then performed to remove parts outside the viewport and handle primitives crossing the viewport boundary. Next, screen mapping is performed to convert clip space coordinates to screen space coordinates, and perspective division (homogeneous coordinates → 3D coordinates) is executed. Finally, viewport transformation is performed, mapping the coordinates to screen pixel positions, and the depth value is normalized to the [0,1] range. In the rasterization stage, geometric primitives are converted into screen pixels. Triangle edge equations are calculated using triangle settings to generate an overlay mesh (determining which pixels are covered by triangles). Triangle traversal is then performed, iterating through the pixels covered by triangles and calculating the attributes (color, depth, etc.) of each fragment. Vertex attributes are interpolated to the fragments, including texture coordinates, color, and normals. The fragment shader then performs texture sampling, lighting calculations, and special effects (normal mapping, parallax mapping, etc.) on each fragment, outputting the fragment's color and depth values. Next, per-fragment operations are performed: a depth test compares the current fragment's depth with the depth buffer, discarding occluded fragments; a stencil test determines whether to retain fragments based on the stencil buffer value; transparent / semi-transparent objects are processed, and color blending is performed. Finally, the image is output, and the framebuffer content is transmitted to the display device.

[0096] This application can utilize constraints to limit the range of intersection lines and the calculation range, thereby limiting the range of 3D points in the model and reducing the amount of computation; by limiting the calculation and display range, it avoids "meaningless area interference (such as invalid calculations and incorrect displays caused by infinite extension of the plane)" and reduces performance consumption; it distinguishes the colors of intersecting / non-intersecting areas of the model, making interaction and detection more intuitive.

[0097] Step S6: Connect the curve segments to obtain a complete three-dimensional curve graph.

[0098] In this embodiment, multiple curve segments will form a continuous polyline. Since the polyline is relatively dense, the visual effect is a complete three-dimensional curve graphic. Then, by summing up the lengths of all the continuous polylines, the measured distance is obtained.

[0099] This application can use the above methods to measure the distance of facial scars, mark key facial features, mark wrinkle lines, and create models for preoperative display, thereby meeting the user's visual expectations.

[0100] This application provides a curve graphic generation device based on a three-dimensional camera perspective, such as... Figure 2 As shown, including,

[0101] The acquisition module 101 is used to acquire two-dimensional pixel curves and three-dimensional camera coordinate points;

[0102] The two-dimensional point set determination module 102 is used to obtain a two-dimensional data point set based on the two-dimensional pixel curve;

[0103] The three-dimensional point set determination module 103 is used to project the two-dimensional data point set into three-dimensional space to obtain a three-dimensional data point set;

[0104] The plane construction module 104 is used to construct multiple planes based on the three-dimensional data point set and the coordinate points of the three-dimensional camera;

[0105] The curve segment generation module 105 is used to generate multiple curve segments based on each of the planes, the preset target 3D model, the 3D data point set, and the preset line segment constraints.

[0106] The curve graph generation module 106 is used to connect the curve segments to obtain a complete three-dimensional curve graph.

[0107] Furthermore, the 3D point set determination module is configured as follows:

[0108] Based on the viewport transformation matrix, the two-dimensional data point set is mapped to the standardized device coordinate system to obtain the NDC coordinates;

[0109] Based on the inverse projection transformation, the NDC coordinates are transformed to the view space to obtain the view space coordinates;

[0110] Based on the inverse view transformation, the view space coordinates are transformed to the world coordinate system to obtain a three-dimensional data point set.

[0111] Furthermore, the planar construction module is configured as follows:

[0112] Traverse the data points in the three-dimensional data point set;

[0113] The three-dimensional data point set forms a plane with each two adjacent data points and the coordinate points of the three-dimensional camera;

[0114] After traversing all data points in the 3D data point set, multiple planes are obtained.

[0115] Furthermore, the curve segment generation module is configured as follows:

[0116] The plane includes the coordinates of the first data point and the second data point;

[0117] Determine the coordinate range based on the coordinates of the first data point and the second data point;

[0118] Based on the coordinate range and the preset target 3D model, determine the 3D point range of the model;

[0119] The intersection line is determined based on the 3D point range, the plane, and the preset line segment constraints;

[0120] Based on the intersection line, multiple curve segments are generated.

[0121] This application provides a storage medium for storing computer-executable instructions, characterized in that, when executed, the computer-executable instructions implement the steps of the curve graphic generation method based on the three-dimensional camera perspective described in any of the above embodiments.

[0122] It should be noted that the embodiments concerning storage media in this specification and the embodiments concerning the curve graphic generation method based on the perspective of a three-dimensional camera in this specification are based on the same inventive concept. Therefore, the specific implementation of this embodiment can be referred to the aforementioned implementation of the corresponding curve graphic generation method based on the perspective of a three-dimensional camera, and the repeated parts will not be described again.

[0123] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0124] In the 1930s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many improvements to the methodology today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that an improvement to the methodology cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must also be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0125] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0126] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0127] For ease of description, the above apparatus is described by dividing it into various functional units. Of course, when implementing the embodiments of this specification, the functions of each unit can be implemented in one or more software and / or hardware.

[0128] Those skilled in the art will understand that one or more embodiments of this specification can be provided as a method, system, or computer program product. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0129] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0130] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0131] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0132] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0133] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0134] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0135] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0136] One or more embodiments of this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a particular task or implement a particular abstract data type. One or more embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0137] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0138] The above description is merely an embodiment of this document and is not intended to limit the scope of this document. Various modifications and variations can be made to this document by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this document should be included within the scope of the claims of this document.

Claims

1. A method for generating curve graphics based on a 3D camera perspective, characterized in that... include: Obtain 2D pixel curves and 3D camera coordinates; Based on the two-dimensional pixel curve, a two-dimensional data point set is obtained; The two-dimensional data point set is projected into three-dimensional space to obtain a three-dimensional data point set; Based on the set of 3D data points and the coordinates of the 3D camera, multiple planes are constructed; Based on the planes, the preset target 3D model, the 3D data point set, and the preset line segment constraints, multiple curve segments are generated; Connect the curve segments to obtain a complete three-dimensional curve graph; The step of generating multiple curve segments based on the planes, the preset target 3D model, the 3D data point set, and the preset line segment constraints includes: The plane includes the coordinates of the first data point and the second data point; Determine the coordinate range based on the coordinates of the first data point and the second data point; Based on the coordinate range and the preset target 3D model, determine the 3D point range of the model; The intersection line is determined based on the 3D point range, the plane, the three-dimensional data point set, and the preset line segment constraints. The formula for determining the line of intersection is as follows: in, Represents three-dimensional data points on a plane; This represents the distance from a 3D data point to the plane. This represents the threshold.

2. The method according to claim 1, characterized in that, The step of projecting the two-dimensional data point set into three-dimensional space to obtain a three-dimensional data point set includes: Based on the viewport transformation matrix, the two-dimensional data point set is mapped to the standardized device coordinate system to obtain the NDC coordinates; Based on the inverse projection transformation, the NDC coordinates are transformed to the view space to obtain the view space coordinates; Based on the inverse view transformation, the view space coordinates are transformed to the world coordinate system to obtain a three-dimensional data point set.

3. The method according to claim 1, characterized in that, The step of constructing multiple planes based on the three-dimensional data point set and the three-dimensional camera coordinate points includes: Traverse the data points in the three-dimensional data point set; The three-dimensional data point set forms a plane with each two adjacent data points and the coordinate points of the three-dimensional camera; After traversing all data points in the 3D data point set, multiple planes are obtained.

4. A curve graphic generation device based on a three-dimensional camera perspective, characterized in that... include: The acquisition module is used to acquire two-dimensional pixel curves and three-dimensional camera coordinate points; A two-dimensional point set determination module is used to obtain a two-dimensional data point set based on the two-dimensional pixel curve; A three-dimensional point set determination module is used to project the two-dimensional data point set into a three-dimensional space to obtain a three-dimensional data point set; A plane construction module is used to construct multiple planes based on the set of 3D data points and the coordinate points of the 3D camera; The curve segment generation module is used to generate multiple curve segments based on the planes, the preset target 3D model, the 3D data point set, and the preset line segment constraints. The curve graph generation module is used to connect the curve segments to obtain a complete three-dimensional curve graph. The curve segment generation module is configured to: The plane includes the coordinates of the first data point and the second data point; Determine the coordinate range based on the coordinates of the first data point and the second data point; Based on the coordinate range and the preset target 3D model, determine the 3D point range of the model; The intersection line is determined based on the 3D point range, the plane, and the preset line segment constraints; Based on the intersection line, multiple curve segments are generated; The formula for determining the line of intersection is as follows: in, Represents three-dimensional data points on a plane; This represents the distance from a 3D data point to the plane. This represents the threshold.

5. The apparatus according to claim 4, characterized in that... The three-dimensional point set determination module is configured as follows: Based on the viewport transformation matrix, the two-dimensional data point set is mapped to the standardized device coordinate system to obtain the NDC coordinates; Based on the inverse projection transformation, the NDC coordinates are transformed to the view space to obtain the view space coordinates; Based on the inverse view transformation, the view space coordinates are transformed to the world coordinate system to obtain a three-dimensional data point set.

6. The apparatus according to claim 4, characterized in that... The planar construction module is configured to: Traverse the data points in the three-dimensional data point set; The three-dimensional data point set forms a plane with each two adjacent data points and the coordinate points of the three-dimensional camera; After traversing all data points in the 3D data point set, multiple planes are obtained.

7. A storage medium for storing computer-executable instructions, characterized in that, When the computer-executable instructions are executed, they implement the steps of the curve graphic generation method based on the three-dimensional camera perspective as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Graph three-dimensional rotation and perspective method and device and equipment

    CN113593054A

  • Animation display method and apparatus for three-dimensional curve

    WO2013185516A1