CN110009729B - Three-dimensional voxel modeling method and system based on artificial intelligence - Google Patents

Three-dimensional voxel modeling method and system based on artificial intelligence Download PDF

Info

Publication number
CN110009729B
CN110009729B CN201910219248.XA CN201910219248A CN110009729B CN 110009729 B CN110009729 B CN 110009729B CN 201910219248 A CN201910219248 A CN 201910219248A CN 110009729 B CN110009729 B CN 110009729B
Authority
CN
China
Prior art keywords
dimensional
dimensional voxel
normal vector
voxel model
vector information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910219248.XA
Other languages
Chinese (zh)
Other versions
CN110009729A (en
Inventor
孙悦
李天驰
陶金金
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Dianmao Technology Co Ltd
Original Assignee
Shenzhen Dianmao Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Dianmao Technology Co Ltd filed Critical Shenzhen Dianmao Technology Co Ltd
Priority to CN201910219248.XA priority Critical patent/CN110009729B/en
Publication of CN110009729A publication Critical patent/CN110009729A/en
Application granted granted Critical
Publication of CN110009729B publication Critical patent/CN110009729B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Image Generation (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a three-dimensional voxel modeling method and a system based on artificial intelligence, wherein the method comprises the following steps: a modeling instruction of a user is obtained in advance, calculation and rendering of a three-dimensional image are completed according to WebGL in cooperation with multithreading, and a three-dimensional voxel model is generated; after a graphic processing instruction of a user is detected, a point of a mouse cursor on the three-dimensional voxel model is obtained, and normal vector information of a plane where the point is located is recorded; and processing the three-dimensional voxel model according to the normal vector information to generate a processed target three-dimensional voxel model. The position of the mouse in the three-dimensional voxel model not only indicates the current position, but also is responsible for recording the normal vector of the target surface, thereby providing convenience for the translation, stretching and other treatments of the three-dimensional voxel model, further improving the treatment efficiency of the three-dimensional voxel model, and simultaneously providing convenience for the operation of children.

Description

Three-dimensional voxel modeling method and system based on artificial intelligence
Technical Field
The invention relates to the technical field of machine vision, in particular to a three-dimensional voxel modeling method and system based on artificial intelligence.
Background
Existing three-dimensional modeling methods include voxel modeling methods and non-voxel modeling methods. The non-voxel modeling method has high specificity, and it is very difficult for an ordinary user to build the same model twice. If the use threshold is to be lowered, a very large number of presets and restrictions have to be made, but this reduces the creativity of the software. Voxel modeling software is therefore increasingly emerging in daily work and life.
In the prior art, when the three-dimensional voxel model software is operated, the number of times of calculation is large due to the large number of preset models, the number of layers of middle encapsulation is large, and the performance of equipment is reduced. In the use process of voxel modeling software, because the modeling operation efficiency is low, the memory occupied by the program is large, and the GPU calculation rate is high, so that the software is blocked and the program crashes in the web environment, and inconvenience is brought to the use.
Accordingly, the prior art is still in need of improvement and development.
Disclosure of Invention
In view of the shortcomings of the prior art, the invention aims to provide a three-dimensional voxel modeling method and system based on artificial intelligence, which aim to solve the defect of low operation efficiency of three-dimensional voxel software modeling in the prior art.
The technical scheme of the invention is as follows:
a three-dimensional voxel modeling method based on artificial intelligence, the method comprising:
a modeling instruction of a user is obtained in advance, calculation and rendering of a three-dimensional image are completed according to WebGL in cooperation with multithreading, and a three-dimensional voxel model is generated;
after a graphic processing instruction of a user is detected, a point of a mouse cursor on the three-dimensional voxel model is obtained, and normal vector information of a plane where the point is located is recorded;
and processing the three-dimensional voxel model according to the normal vector information to generate a processed target three-dimensional voxel model.
Optionally, the graphics processing instructions include translation, stretching, circular center building, square center building.
Optionally, when the graphics processing instruction is translation, the processing the three-dimensional voxel model according to the normal vector information to generate a processed target three-dimensional voxel model includes:
the method comprises the steps of obtaining normal vector information, wherein the normal vector information is a one-dimensional array containing three normal vector components;
and (3) extracting an axis with a vector component of 0 by using the method, and controlling the three-dimensional voxel model to move along the axis with a normal vector of 0 to generate a processed target three-dimensional voxel model.
Optionally, when the graphics processing instruction is stretching, the processing the three-dimensional voxel model according to the normal vector information to generate a processed target three-dimensional voxel model includes:
the method comprises the steps of obtaining normal vector information, wherein the normal vector information is a one-dimensional array containing three normal vector components;
and (3) extracting an axis with vector components different from 0, controlling the three-dimensional voxel model to extend along the axis with normal vector different from 0, and generating the processed target three-dimensional voxel model.
Optionally, the graphics processing instruction is configured for building a center of a circle, and the processing the three-dimensional voxel model according to the normal vector information to generate a processed target three-dimensional voxel model includes:
the method comprises the steps of obtaining normal vector information, wherein the normal vector information is a one-dimensional array containing three normal vector components;
and (3) extracting an axis with vector information of 0, controlling the circle to move along the axis with normal vector component of 0, and generating the processed target three-dimensional voxel model.
Optionally, the graphic processing instruction is built for the center of the square, the processing is performed on the three-dimensional voxel model according to the normal vector information, and the generating of the processed target three-dimensional voxel model includes:
the method comprises the steps of obtaining normal vector information, wherein the normal vector information is a one-dimensional array containing three normal vector components;
and (3) extracting an axis with vector information of 0, controlling the square to move along the axis with normal vector component of 0, and generating the processed target three-dimensional voxel model.
Optionally, the extracting method includes controlling the circle to move along the axis with the normal vector component of 0 according to the axis with the vector information of 0, and generating the processed target three-dimensional voxel model, including:
detecting whether the symmetrical mode is started or not, if so, extracting an axis with vector information of 0, and controlling the circle to move along the axis with normal vector component of 0;
and calculating and displaying the three-dimensional voxel model corresponding to the moved three-dimensional voxel model in a symmetrical mode, and generating a processed target three-dimensional voxel model.
Optionally, the symmetric mode is a mirror symmetric mode.
Another embodiment of the present invention further provides an artificial intelligence based three-dimensional voxel modeling system, including:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the artificial intelligence based three-dimensional voxel modeling method described above.
Yet another embodiment of the present invention provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the artificial intelligence-based three-dimensional voxel modeling method described above.
The beneficial effects are that: the invention discloses a three-dimensional voxel modeling method and a system based on artificial intelligence, wherein the position of a mouse in a three-dimensional voxel model in the embodiment of the invention not only indicates the current position, but also is responsible for recording the normal vector of a target surface, thereby providing convenience for the translation, the stretching and other treatments of the three-dimensional voxel model, further improving the treatment efficiency of the three-dimensional voxel model, simultaneously having simple modeling method and providing convenience for the operation of children.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flow chart of a preferred embodiment of an artificial intelligence based three-dimensional voxel modeling method of the present invention.
FIG. 2 is a hardware architecture diagram of a preferred embodiment of an artificial intelligence based three-dimensional voxel modeling system of the present invention.
Detailed Description
The present invention will be described in further detail below in order to make the objects, technical solutions and effects of the present invention more clear and distinct. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a flowchart of a three-dimensional voxel modeling method based on artificial intelligence according to a preferred embodiment of the present invention. As shown in fig. 1, it comprises the steps of:
step S100, a modeling instruction of a user is obtained in advance, calculation and rendering of a three-dimensional image are completed according to WebGL in combination with multithreading, and a three-dimensional voxel model is generated;
step 200, after a graphic processing instruction of a user is detected, a point of a mouse cursor on the three-dimensional voxel model is obtained, and normal vector information of a plane where the point is located is recorded;
and step S300, processing the three-dimensional voxel model according to the normal vector information to generate a processed target three-dimensional voxel model.
When in specific implementation, the embodiment of the invention is mainly used for realizing quick and convenient voxel modeling software running in a browser. The Java script is matched with WebGL development, can be separated from a web server and used as a static page program, namely, can access the web program through a webpage, can be completely used as a local application program, and has good cross-platform performance. The modeling is simple and efficient to operate, and the upper-hand threshold for non-professional common users is low. Thus being suitable for children to operate. But also supports deriving the file formats common to other modeling software and the file formats required by the 3d printer in a one-dimensional array for modeling the three-dimensional structure and recording the dimensional data of the three-dimensional structure. Wherein WebGL (write-through Web Graphics Library) is a 3D drawing protocol.
The data structure of the voxels is preset, and the data structure of the voxels is a one-dimensional array. The one-dimensional array is used for simulating the three-dimensional structure and recording the size data of the three-dimensional structure. Specifically, in terms of data structure, voxels are structures that are modeled in three dimensions using one-dimensional arrays, while three-dimensional size data is recorded. The method can be roughly expressed as:
data= [1,0,1,0,0,0,0,2,5,7,3 …,9]; shape= [5, 5]; thus for voxels with < x, y, z > being <2,3,4>, the subscript is 2+3×5+4×25=117; because the three-dimensional array cannot be constructed by the most space-saving data types in javaScript, and different dimensions are accessed through address layer-by-layer searching, the subscript is directly calculated and then directly positioned, and the calculation speed is high. The values stored in the array, except 0, all indicate that there is a voxel at that location and that the color of the voxel is represented by the corresponding value, which is the number of the middle color of the color table, so that the numbers 1, 2, 4, 6 represent what color is determined by the color table. While color tables are separately stored data, a set of color tables stores rgb values for 255 colors, which can be changed by the user at will to achieve the desired color.
During one editing by the user, from accepting input to rendering: calculating an edited region, i.e., a spatial range S from a start point < x1, y1, z1> to an end point < x2, y2, z2>, by the position of the mouse; traversing the data in the space S, and modifying the value of the corresponding position; calculating vertex data required for rendering through the three-dimensional data; and sending the vertex data, obtaining color information by looking up a color table, and sending the color information to the GPU for rendering.
Optionally, in an embodiment of the present invention, run-length encoding is used to encode and store a one-dimensional array representing a three-dimensional voxel model.
In particular, because the program is running on the web, lightweight, convenient transmission of data is a consideration. Therefore, in terms of data storage, a one-dimensional array of the representation model is encoded by adopting run-length encoding so as to greatly compress the data volume, and most of the existing modeling software directly records the data of each voxel.
Optionally, step S100 includes: the main thread acquires the mouse position of the user, calculates the region to be edited through the mouse position, traverses the data in the region and modifies the value of the corresponding position;
the sub-thread calculates vertex data required by rendering through the one-dimensional array, and returns the vertex data to the main thread;
the main thread searches a color table according to the vertex data to acquire color information, sends the color information to the graphic processor for rendering, and generates an edited three-dimensional voxel model.
Specifically, numbers representing colors in the one-dimensional array are in one-to-one correspondence with colors of the color table in advance.
Instead of voxel-by-voxel rendering, adjacent and consistent-color voxels are merged in practice, which greatly reduces performance requirements, such as a 10x 10 cube, which requires 1000 x 8 vertices if each voxel is rendered, and only 8 vertices in the present procedure.
Since the step of calculating the vertex data required for rendering through the one-dimensional array is a step requiring a large amount of cpu calculation, if the calculation time is too long at one time, the whole program is in an unresponsive state, and in order to minimize the "stuck" condition, the step of calculating the vertex data required for rendering through the one-dimensional array can be completed in an exceptionally opened sub-thread, so that the main thread can still respond to user input without being affected. However, the time consumption of data back and forth transmission in the thread needs to be considered, and if the time consumption is too long, the program still gives a delay feeling. To reduce this time consumption during operation, the data of the main thread and the sub-thread may be synchronized once at the beginning of an operation, and then only the portion of the data fluctuation may be transmitted at a time.
Optionally, the main thread obtains a mouse position of a user, calculates an area to be edited through the mouse position, traverses data in the area, and modifies a value of a corresponding position, including:
the main thread calculates the current editing area through the position of the mouse, acquires the last editing area, compares the difference value of the current editing area and the last editing area, and modifies the range corresponding to the difference value.
In the implementation, the main thread can compare the current editing area with the last editing area to obtain the difference value of two times, so that the traversing range can be reduced to the range represented by the difference value, and a large number of original traversing times are reduced.
Optionally, step S100 further includes:
if the user is detected to import the picture, the picture is processed, and two-dimensional pixels are mapped to three-dimensional voxels to generate a three-dimensional voxel model.
In specific implementation, any picture introduction of a user is detected, a three-dimensional voxel model can be generated, and one or more pictures can be used. If one picture is imported, the principle of generating a stereoscopic model is that a plane extends along a z-axis, if two pictures are used, a user can specify a front view and a side view according to requirements, and the models are generated by analyzing the front view and the side view and combining the two views, so that a plurality of novel models can be generated by combining different pictures at will. The principle of the two pictures is that the two pictures respectively fill the whole space along the x axis and the z axis, and then the intersection is taken.
Wherein the graphics processing instructions include translation, stretching, circular center building, square center building.
Further, when the graphics processing instruction is translation, the processing the three-dimensional voxel model according to the normal vector information to generate a processed target three-dimensional voxel model includes:
the method comprises the steps of obtaining normal vector information, wherein the normal vector information is a one-dimensional array containing three normal vector components;
and (3) extracting an axis with a vector component of 0 by using the method, and controlling the three-dimensional voxel model to move along the axis with a normal vector of 0 to generate a processed target three-dimensional voxel model.
In particular, if the translation command is applied, if the normal vector of the three-dimensional voxel model plane to be translated is [0,1,0], the selected object can only move in the X-axis or the Z-axis, that is, can only move along the axis with the normal vector component of 0.
Further, if the graphics processing instruction is stretching, the processing the three-dimensional voxel model according to the normal vector information to generate a processed target three-dimensional voxel model, including:
the method comprises the steps of obtaining normal vector information, wherein the normal vector information is a one-dimensional array containing three normal vector components;
and (3) extracting an axis with vector components different from 0, controlling the three-dimensional voxel model to extend along the axis with normal vector different from 0, and generating the processed target three-dimensional voxel model.
In practice, if the normal vector is [0,1,0], the stretching will only extend in the positive direction of the Y-axis, and the rule will only extend in directions where the normal vector component is not 0. The extending operation requires sliding the mouse over the auxiliary plane with the aid of an additional plane, calculating the distance in the axial direction of the target.
Further, the graphic processing instruction is a center construction of a circle, the processing is performed on the three-dimensional voxel model according to normal vector information, and a processed target three-dimensional voxel model is generated, and the method comprises the following steps:
obtaining normal vector information, wherein the normal vector information is a one-dimensional array comprising three normal vector components,
and (3) extracting an axis with vector information of 0, controlling the circle to move along the axis with normal vector component of 0, and generating the processed target three-dimensional voxel model.
In practice, the direction of the circular build is as regular as translation, but can only move along an axis with a normal vector component of 0. And will not be described in detail herein.
Further, the graphic processing instruction is a center construction of a square, the processing is performed on the three-dimensional voxel model according to normal vector information, and a processed target three-dimensional voxel model is generated, and the method comprises the following steps:
the method comprises the steps of obtaining normal vector information, wherein the normal vector information is a one-dimensional array containing three normal vector components;
and (3) extracting an axis with vector information of 0, controlling the square to move along the axis with normal vector component of 0, and generating the processed target three-dimensional voxel model.
In practice, the direction of square construction is as regular as translation, but can only move along an axis with a normal vector component of 0. And will not be described in detail herein.
In yet a further embodiment, extracting an axis with vector information of 0, controlling a circle to move along the axis with normal vector component of 0, and generating a processed target three-dimensional voxel model, including:
detecting whether the symmetrical mode is started or not, if so, extracting an axis with vector information of 0, and controlling the circle to move along the axis with normal vector component of 0;
and calculating and displaying the three-dimensional voxel model corresponding to the moved three-dimensional voxel model in a symmetrical mode, and generating a processed target three-dimensional voxel model.
In particular implementations, the symmetric modes include, but are not limited to, a mirror symmetric mode and an axisymmetric mode. Taking mirror symmetry as an example, if the X-axis is mirror symmetric, the symmetry points of [ X, Y, z ] are [ size-X, Y, z ], the symmetrical effects are combined in a superposition way, that is to say the effects of opening the symmetry of the X-axis and the Y-axis simultaneously and opening the structure in two times are different;
for example, there are basic points [ X, Y, z ], if X-axis symmetry is turned on, the [ size-X, Y, z ] is obtained, if Y-axis symmetry is turned on, the obtained points are the [ X, size-Y, z ], but if X-axis symmetry is turned on simultaneously, Y-axis symmetry is calculated once again on the basis of previous calculation of X-axis symmetry. That is, [ x, Y, z ] and [ size-x, Y, z ] calculate the Y-axis symmetry simultaneously, which in turn yields the fourth point [ size-x, size-Y, z ].
Further, the modeling method of the present invention also provides the following functions: drawing, eliminating, coloring, selecting areas, magic bars, space translation, color selection and area replacement. From the hierarchical view of the data representation, how these operations find and modify the data satisfying the condition, such as drawing, is to set all of the data values in the spatial range S to be 0 to a (a represents the subscript of the color currently selected by the user in the color table). The elimination is to set the values in the space S to 0, the coloring is to set the values of the data in the space S to a, the selection is to copy the values of the data in the space S to the selection space, and the rest operation principles are similar.
The four operations of drawing, eliminating, coloring and selecting area have axisymmetric mode and mirror symmetry mode which can be selected, and the two modes support simultaneous use. The selection area also supports multiple selection, deletion of selection area and cancellation of selection area.
Magic wand, color selection, and area replacement are all operations performed on color. Wherein the magic stick provides three options of face, body and all, namely: one continuous face, continuous volume or voxels of all target colors in space (no neighbors are needed) may be selected.
The three-dimensional voxel model method of the embodiment of the invention can run indiscriminately in Chrome, firefox, edge, safari browsers under windows and macOS platforms. The model generated by the method can generate Obj format, and can import other modeling software such as Blender, so as to provide choices for more professional users. In addition to this, the generation of stl format received by the 3D printer is supported.
According to the embodiment of the method, the invention provides a three-dimensional voxel modeling method based on artificial intelligence, which has the following technical advantages:
the data encapsulation from the rendering of the bottom layer to the top layer gets rid of the existing framework, because each process is written by codes, and the realization method of each part can be completely analyzed. For example, the rendering part at the bottom layer can consider what effect is turned on or off to reduce the calculation amount of the GPU, the number of memory clearing times can be reduced by adopting the byte format when the data is stored, and the multithreading is adopted to exert the performance of the CPU to the maximum.
Voxel modeling is modeling with a unit cube as a basic unit, so each modification of the user, such as rendering, elimination, and coloring, can be calculated with voxels as units. In short, it is how many unit cubes to modify in one operation. Modeling is performed by mouse sliding, so that a single operation can modify voxels in a cuboid space, while most existing modeling software for voxels can only edit voxel by voxel.
The method comprises the steps of supporting a user to import a picture for modeling, automatically processing the colors of the picture by a program, and mapping two-dimensional pixels to three-dimensional voxels, so that the user can quickly create a plurality of unique models;
the normal vector of the target surface is recorded through the mouse, so that convenience is provided for translation and stretching of the three-dimensional voxel model, the processing efficiency of the three-dimensional voxel model is further improved, the modeling method is simple, and convenience is provided for children to operate.
Another embodiment of the present invention provides an artificial intelligence based three-dimensional voxel modeling system, as shown in fig. 2, the artificial intelligence based three-dimensional voxel modeling system 10 comprising:
one or more processors 110 and a memory 120, one processor 110 being illustrated in fig. 2, the processors 110 and the memory 120 being coupled via a bus or other means, the bus coupling being illustrated in fig. 2.
Processor 110 is used to implement various control logic of artificial intelligence based three-dimensional voxel modeling system 10, which may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), a single-chip microcomputer, ARM (Acorn RISC Machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. Also, the processor 110 may be any conventional processor, microprocessor, or state machine. The processor 110 may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
The memory 120 is used as a non-volatile computer readable storage medium for storing non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the artificial intelligence based three-dimensional voxel modeling method in the embodiments of the present invention. The processor 110 executes various functional applications and data processing of the artificial intelligence based three-dimensional voxel modeling system 10 by running non-volatile software programs, instructions and units stored in the memory 120, i.e., implements the artificial intelligence based three-dimensional voxel modeling method in the method embodiments described above.
Memory 120 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the stored data region may store data created from use of the artificial intelligence based three-dimensional voxel modeling system 10, or the like. In addition, memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 120 optionally includes memory remotely located with respect to processor 110, which may be connected to artificial intelligence based three-dimensional voxel modeling system 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more units are stored in memory 120 that, when executed by one or more processors 110, perform the artificial intelligence based three-dimensional voxel modeling method in any of the method embodiments described above, e.g., perform method steps S100-S300 in fig. 1 described above.
The three-dimensional voxel modeling system 10 based on artificial intelligence can execute the three-dimensional voxel modeling method based on artificial intelligence provided by the embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. Technical details that are not described in detail in the embodiments of the artificial intelligence based three-dimensional voxel modeling system 10 may be found in the artificial intelligence based three-dimensional voxel modeling methods provided by embodiments of the present invention.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer-executable instructions for execution by one or more processors, e.g., to perform the method steps S100-S300 of fig. 1 described above.
Another embodiment of the present invention provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a processor, cause the processor to perform the artificial intelligence based three-dimensional voxel modeling method of the above method embodiments. For example, the above-described method steps S100 to S300 in fig. 1 are performed.
The system embodiments described above are merely illustrative, in which elements illustrated as separate elements may or may not be physically separate, and elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
From the above description of embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus a general purpose hardware platform, or may be implemented by hardware. Based on such understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the related art in the form of a software product, which may exist in a computer-readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method of the respective embodiments or some parts of the embodiments.
It is to be understood that the invention is not limited in its application to the examples described above, but is capable of modification and variation in light of the above teachings by those skilled in the art, and that all such modifications and variations are intended to be included within the scope of the appended claims.

Claims (10)

1. A three-dimensional voxel modeling method based on artificial intelligence, the method comprising:
a modeling instruction of a user is obtained in advance, calculation and rendering of a three-dimensional image are completed according to WebGL in cooperation with multithreading, and a three-dimensional voxel model is generated;
after a graphic processing instruction of a user is detected, a point of a mouse cursor on the three-dimensional voxel model is obtained, and normal vector information of a plane where the point is located is recorded;
processing the three-dimensional voxel model according to the normal vector information to generate a processed target three-dimensional voxel model;
the method comprises the steps that modeling instructions of a user are obtained in advance, calculation and rendering of a three-dimensional image are completed according to WebGL and multithreading, and before a three-dimensional voxel model is generated, the method comprises the following steps:
the method comprises the steps of setting a data structure of a voxel in advance, wherein the data structure of the voxel is a one-dimensional array, the one-dimensional array is used for simulating a three-dimensional structure and recording size data of the three-dimensional structure, and coding and storing the one-dimensional array representing a three-dimensional voxel model by adopting run-length coding;
the pre-obtaining modeling instructions of a user, completing calculation and rendering of a three-dimensional image according to WebGL and multithreading, and generating a three-dimensional voxel model comprises the following steps:
the main thread acquires the mouse position of the user, calculates the region to be edited through the mouse position, traverses the data in the region and modifies the value of the corresponding position;
the sub-thread calculates vertex data required by rendering through the one-dimensional array, and returns the vertex data to the main thread;
the main thread searches a color table according to the vertex data to acquire color information, sends the color information to a graphic processor for rendering, and generates an edited three-dimensional voxel model;
the main thread searches a color table according to vertex data to acquire color information, sends the color information to a graphic processor for rendering, and pre-corresponds the numbers representing the colors in the one-dimensional array with the colors of the color table one by one, and merges and renders adjacent voxels with consistent colors during rendering;
the sub-thread calculates vertex data required by rendering through the one-dimensional array, returns the vertex data to the main thread, synchronizes the data of the main thread and the sub-thread once when the sub-thread calculates the vertex data required by rendering through the one-dimensional array, and only transmits the part with data change;
the main thread obtains the mouse position of the user, calculates the region to be edited through the mouse position, traverses the data in the region, and modifies the value of the corresponding position, and the method comprises the following steps:
the main thread calculates the current editing area through the position of the mouse, acquires the last editing area, compares the difference value of the current editing area and the last editing area, and modifies the range corresponding to the difference value.
2. The artificial intelligence based three-dimensional voxel modeling method of claim 1, wherein the graphics processing instructions comprise translation, stretching, center building of circles, center building of squares.
3. The three-dimensional voxel modeling method as claimed in claim 2, wherein the processing the three-dimensional voxel model according to the normal vector information to generate a processed target three-dimensional voxel model when the graphics processing instruction is translation, comprises:
the method comprises the steps of obtaining normal vector information, wherein the normal vector information is a one-dimensional array containing three normal vector components;
and (3) extracting an axis with a vector component of 0 by using the method, and controlling the three-dimensional voxel model to move along the axis with a normal vector of 0 to generate a processed target three-dimensional voxel model.
4. The artificial intelligence based three-dimensional voxel modeling method of claim 2, wherein when the graphics processing instruction is stretching, the processing the three-dimensional voxel model according to normal vector information to generate a processed target three-dimensional voxel model comprises:
the method comprises the steps of obtaining normal vector information, wherein the normal vector information is a one-dimensional array containing three normal vector components;
and (3) extracting an axis with vector components different from 0, controlling the three-dimensional voxel model to extend along the axis with normal vector different from 0, and generating the processed target three-dimensional voxel model.
5. The artificial intelligence based three-dimensional voxel modeling method of claim 2, wherein the graphics processing instructions are built for a center of a circle, the processing the three-dimensional voxel model according to normal vector information, generating a processed target three-dimensional voxel model, comprising:
the method comprises the steps of obtaining normal vector information, wherein the normal vector information is a one-dimensional array containing three normal vector components;
and (3) extracting an axis with vector information of 0, controlling the circle to move along the axis with normal vector component of 0, and generating the processed target three-dimensional voxel model.
6. The three-dimensional voxel modeling method based on artificial intelligence according to claim 2, wherein the graphic processing instruction is a center construction of a square, the three-dimensional voxel model is processed according to normal vector information, and the processed target three-dimensional voxel model is generated, comprising:
the method comprises the steps of obtaining normal vector information, wherein the normal vector information is a one-dimensional array containing three normal vector components;
and (3) extracting an axis with vector information of 0, controlling the square to move along the axis with normal vector component of 0, and generating the processed target three-dimensional voxel model.
7. The artificial intelligence based three-dimensional voxel modeling method of claim 5, wherein the extraction method has an axis with vector information of 0, and the circle is controlled to move along the axis with normal vector component of 0 to generate a processed three-dimensional voxel model of the object, comprising:
detecting whether the symmetrical mode is started or not, if so, extracting an axis with vector information of 0, and controlling the circle to move along the axis with normal vector component of 0;
and calculating and displaying the three-dimensional voxel model corresponding to the moved three-dimensional voxel model in a symmetrical mode, and generating a processed target three-dimensional voxel model.
8. The artificial intelligence based three-dimensional voxel modeling method of claim 7, wherein the symmetric mode is a mirror symmetric mode.
9. An artificial intelligence based three-dimensional voxel modeling system, comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the artificial intelligence based three-dimensional voxel modeling method of any one of claims 1-8.
10. A non-transitory computer-readable storage medium storing computer-executable instructions which, when executed by one or more processors, cause the one or more processors to perform the artificial intelligence based three-dimensional voxel modeling method of any one of claims 1-8.
CN201910219248.XA 2019-03-21 2019-03-21 Three-dimensional voxel modeling method and system based on artificial intelligence Active CN110009729B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910219248.XA CN110009729B (en) 2019-03-21 2019-03-21 Three-dimensional voxel modeling method and system based on artificial intelligence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910219248.XA CN110009729B (en) 2019-03-21 2019-03-21 Three-dimensional voxel modeling method and system based on artificial intelligence

Publications (2)

Publication Number Publication Date
CN110009729A CN110009729A (en) 2019-07-12
CN110009729B true CN110009729B (en) 2023-07-07

Family

ID=67167765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910219248.XA Active CN110009729B (en) 2019-03-21 2019-03-21 Three-dimensional voxel modeling method and system based on artificial intelligence

Country Status (1)

Country Link
CN (1) CN110009729B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114022601A (en) * 2021-11-04 2022-02-08 北京字节跳动网络技术有限公司 Volume element rendering method, device and equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5577176A (en) * 1994-11-23 1996-11-19 Computervision Corporation Method and apparatus for displaying a cursor along a two dimensional representation of a computer generated three dimensional surface
WO2010029953A1 (en) * 2008-09-09 2010-03-18 国立大学法人東京大学 3d position specification device, 3d position specification method, and 3d position specification program, voxel modeling device, voxel modeling method, and voxel modeling program
US8817021B1 (en) * 2011-11-11 2014-08-26 Google Inc. System for writing, interpreting, and translating three-dimensional (3D) scenes
CN107890671A (en) * 2017-12-05 2018-04-10 腾讯科技(深圳)有限公司 Threedimensional model rendering intent, device, computer equipment and the storage medium of WEB terminal
CN108171804A (en) * 2017-12-14 2018-06-15 深圳市毕美科技有限公司 The determining method and device of threedimensional model section plane
CN109215121A (en) * 2018-10-23 2019-01-15 百度在线网络技术(北京)有限公司 Method and apparatus for generating information

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10257500B2 (en) * 2017-01-13 2019-04-09 Zspace, Inc. Stereoscopic 3D webpage overlay

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5577176A (en) * 1994-11-23 1996-11-19 Computervision Corporation Method and apparatus for displaying a cursor along a two dimensional representation of a computer generated three dimensional surface
WO2010029953A1 (en) * 2008-09-09 2010-03-18 国立大学法人東京大学 3d position specification device, 3d position specification method, and 3d position specification program, voxel modeling device, voxel modeling method, and voxel modeling program
US8817021B1 (en) * 2011-11-11 2014-08-26 Google Inc. System for writing, interpreting, and translating three-dimensional (3D) scenes
CN107890671A (en) * 2017-12-05 2018-04-10 腾讯科技(深圳)有限公司 Threedimensional model rendering intent, device, computer equipment and the storage medium of WEB terminal
CN108171804A (en) * 2017-12-14 2018-06-15 深圳市毕美科技有限公司 The determining method and device of threedimensional model section plane
CN109215121A (en) * 2018-10-23 2019-01-15 百度在线网络技术(北京)有限公司 Method and apparatus for generating information

Also Published As

Publication number Publication date
CN110009729A (en) 2019-07-12

Similar Documents

Publication Publication Date Title
CN111801708B (en) Method for performing occlusion rendering by using ray casting and real-time depth
CN110889890B (en) Image processing method and device, processor, electronic equipment and storage medium
WO2019242454A1 (en) Object modeling movement method, apparatus and device
CN109448099B (en) Picture rendering method and device, storage medium and electronic device
US11839820B2 (en) Method and apparatus for generating game character model, processor, and terminal
JP2021193599A (en) Virtual object figure synthesizing method, device, electronic apparatus, and storage medium
CN110021058B (en) Three-dimensional voxel modeling method and system convenient for child operation
US20210063735A1 (en) Method and device for controlling image display in a vr system, and vr head mounted device
KR102433857B1 (en) Device and method for creating dynamic virtual content in mixed reality
CN110246209B (en) Image processing method and device
CA2853761A1 (en) Rendering system, rendering server, control method thereof, program, and recording medium
US10394221B2 (en) 3D printing using 3D video data
CN102819855B (en) The generation method of two dimensional image and device
KR20220083830A (en) Image processing method and image synthesis method, image processing apparatus and image synthesis apparatus, and storage medium
JP2023029984A (en) Method, device, electronic apparatus, and readable storage medium for generating virtual image
CN101477702B (en) Built-in real tri-dimension driving method for computer display card
CN110009729B (en) Three-dimensional voxel modeling method and system based on artificial intelligence
US20210042981A1 (en) Systems and methods for partitioning an animatable model
CN115908664B (en) Animation generation method and device for man-machine interaction, computer equipment and storage medium
JP2020532022A (en) Sphere light field rendering method in all viewing angles
KR101428577B1 (en) Method of providing a 3d earth globes based on natural user interface using motion-recognition infrared camera
CN111275806A (en) Parallelization real-time rendering system and method based on points
Noh et al. Shape refinement and rigging of raw-scanned 3D volume by a user-specified skeleton
CN115861500B (en) 2D model collision body generation method and device
KR100301706B1 (en) How to choose three-dimensional models with hierarchical relationships

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant