CN111640182A - Wall surface texture drawing system and method - Google Patents

Wall surface texture drawing system and method Download PDF

Info

Publication number
CN111640182A
CN111640182A CN202010309644.4A CN202010309644A CN111640182A CN 111640182 A CN111640182 A CN 111640182A CN 202010309644 A CN202010309644 A CN 202010309644A CN 111640182 A CN111640182 A CN 111640182A
Authority
CN
China
Prior art keywords
texture
wall
node
model
dst
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.)
Granted
Application number
CN202010309644.4A
Other languages
Chinese (zh)
Other versions
CN111640182B (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.)
Nanjing Zhengfan Information Technology Co ltd
Original Assignee
Nanjing Zhengfan Information 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 Nanjing Zhengfan Information Technology Co ltd filed Critical Nanjing Zhengfan Information Technology Co ltd
Priority to CN202010309644.4A priority Critical patent/CN111640182B/en
Publication of CN111640182A publication Critical patent/CN111640182A/en
Application granted granted Critical
Publication of CN111640182B publication Critical patent/CN111640182B/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
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/10Constructive solid geometry [CSG] using solid primitives, e.g. cylinders, cubes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Geometry (AREA)
  • Architecture (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The invention discloses a wall surface texture drawing system and a wall surface texture drawing method, which belong to the field of 3D model texture drawing. The wall surface three-dimensional coordinate information recorded and stored by the wall surface 3D model creation module is transmitted to the wall surface texture drawing module, the texture 3D model creation module records and stores texture three-dimensional coordinates and texture patterns, the texture three-dimensional coordinates and the texture patterns are transmitted to the texture 3D model redrawing module, the texture is redrawn by the texture 3D model redrawing module according to different redrawing instructions, the redrawn texture is transmitted to the wall surface texture drawing module, and the wall surface texture drawing module draws the texture of the wall surface according to different wall surface drawing instructions. The invention converts most actions needing to be completed manually into various instructions, and the user only needs to key in the corresponding instructions and can complete texture drawing by executing corresponding steps inside the module, thereby simplifying the drawing process.

Description

Wall surface texture drawing system and method
Technical Field
The invention relates to the technical field of 3D model texture drawing, in particular to a wall surface texture drawing system and a wall surface texture drawing method.
Background
In real life, objects exist in the form of three-dimensional geometric entities. The traditional two-dimensional plane photograph causes visual space stereoscopic impression through light and shade contrast and perspective relation, and cannot generate strong stereoscopic impression. The space model of the three-dimensional model is close to the prototype, and the three-dimensional model not only has the characteristics of height, width and depth, but also can display real surface texture information.
In computer graphics, objects are typically modeled with a three-dimensional model and overlaid with textures, and the process of placing texture arrangements on the three-dimensional model, called texture mapping, is performed to make the model more detailed and more realistic.
In current 3D modeling software (common 3D modeling software is 3dMax, autoCAD, etc.), the operation of users using the software to map the texture on the wall surface is very cumbersome, such as: the complicated operation of rotating the texture, magnifying the texture, and drawing the whole wall or the whole house can be performed accurately by using a mouse on a computer, but once the operation is performed on a mobile device, the operation comprises the following steps: the mobile phone or the PAD (such devices are characterized in that the screen is smaller and the user can only use fingers for operation), so that the operations such as tiling, stretching, rotating and the like which can be originally carried out on the computer are difficult to realize on the mobile device, because the computer can be refined by means of a mouse, but on the mobile device, the user can only carry out non-refined operation by fingers, and great inconvenience is brought to texture mapping of different modes on the wall surface.
Disclosure of Invention
1. Problems to be solved
Aiming at the problems that the operation of the texture mapping process on the wall surface is very complicated and the operation requirement of a mobile device cannot be well met in the prior art, the invention provides a wall surface texture drawing system and a wall surface texture drawing method, which can be used for redrawing a texture 3D model and automatically drawing according to the 3D model information of the wall surface and the special rule of the texture of the wall surface, wherein a plurality of steps in the drawing process are automatically completed by equipment without the operation of a user, so that the operation of the user is reduced, and the drawing efficiency of the user is improved.
2. Technical scheme
In order to solve the problems, the technical scheme adopted by the invention is as follows:
the invention relates to a wall texture drawing system, which comprises 4 modules: namely a wall surface 3D model establishing module, a texture 3D model redrawing module and a wall surface texture drawing module.
The wall 3D model establish the three-dimensional coordinate information of the wall that the module will record and store, transmit for the wall texture and draw the module, general wall is the rectangle, consequently, only need the coordinate of four nodes of storage, it is respectively: upper left corner, lower left corner, upper right corner, and lower right corner. If the wall surface is in an irregular shape, a minimum rectangle capable of accommodating the irregular shape is taken, and then mapping is carried out according to the texture of the minimum rectangle.
The texture 3D model creating module transmits the recorded and stored three-dimensional coordinates of the texture and the texture pattern to the texture 3D model redrawing module; since the 3D model of the texture is also rectangular, it is also only necessary to store the coordinates of four nodes, respectively: upper left corner, lower left corner, upper right corner and lower right corner; wherein the texture pattern can be picture, color or combination of picture and color.
The texture 3D model redrawing module redraws textures according to different redrawing instructions and transmits the redrawed textures to the wall surface texture drawing module; the redrawing instruction is specified by a user when the user operates the wall texture pattern, and comprises the following steps: scaling and rotation of the texture.
The wall surface texture drawing module acquires three-dimensional coordinate information of 4 vertexes of the wall surface from the wall surface 3D model creating module, acquires redrawn textures from the texture 3D model redrawing module, and draws the textures of the wall surface according to different wall surface drawing instructions; the wall surface drawing instruction is specified by a user when the wall surface texture pattern is operated, and the wall surface drawing instruction comprises the following steps: whole wall tiling, horizontal tiling, left tiling, right tiling, vertical tiling, upward tiling, downward tiling, full house tiling, whole wall stretching, horizontal stretching, left stretching, right stretching, vertical stretching, upward stretching, downward stretching, full house stretching.
The tiling drawing submodule is an internal module of the wall texture drawing module, and because the technical scheme of finishing each drawing instruction in the wall texture drawing module comprises the tiling technical scheme, and the characteristics of the related tiling technical schemes are basically the same, the technical modes of the parts are integrated into one module.
The invention relates to a wall texture drawing method, which comprises the following steps:
step one, initializing wall 3D model information
The wall 3D model creation module records three-dimensional coordinates of each node of the 3D model of the wall, and the wall model is rectangular, so that the coordinates of four nodes only need to be stored, which are respectively: upper left corner, lower left corner, upper right corner, and lower right corner. The node coordinate of the upper left corner is recorded as node _ LT, the node coordinate of the lower left corner is recorded as node _ LD, the node coordinate of the upper right corner is recorded as node _ RT, and the node coordinate of the lower right corner is recorded as node _ RD. A room is formed by a plurality of wall surfaces, and the three-dimensional coordinates of each node of the wall surface 3D model of the wall surfaces of the plurality of wall surfaces are recorded as a wall surface 3D model group, namely node _ wall _ group. And transmitting the three-dimensional coordinates of the nodes contained in the node _ wall _ group to the wall texture drawing module.
Step two, initializing texture 3D model information
The texture 3D model creating module records three-dimensional coordinates and texture patterns of each node of the texture 3D model, and the texture model is rectangular, so that the coordinates of four nodes are only required to be stored, namely: upper left corner, lower left corner, upper right corner, and lower right corner. Recording the node coordinate of the upper left corner as node _ LT, the node coordinate of the lower left corner as node _ LD, the node coordinate of the upper right corner as node _ RT and the node coordinate of the lower right corner as node _ RD; the texture pattern can be a picture, a color or a combination of the picture and the color; and transmitting the three-dimensional coordinates of the nodes and the texture patterns contained in the texture model to a texture 3D model redrawing module.
Step three, redrawing the texture
The texture 3D model redrawing module acquires three-dimensional coordinates and texture pattern information of nodes contained in the texture 3D model from the texture 3D model creating module, and redraws the texture 3D model according to different redrawing instructions, wherein the redrawing instructions comprise: zooming and rotating. The zooming redrawing instruction and the rotating redrawing instruction do not have the sequence, the two redrawing instructions can be executed independently or in combination, and the three-dimensional coordinates and the texture patterns of the nodes contained in the texture 3D model which is finally redrawn are transmitted to the wall surface texture drawing module; and if no redrawing instruction is executed, transmitting the three-dimensional coordinates of the nodes and the texture pattern contained in the original texture 3D model to the wall texture drawing module.
1. Zoom
The user only needs to send two redrawing instructions to the texture 3D model redrawing module respectively, which are respectively: scaling the texture width and scaling the texture length;
the module calculates a scaled texture width ratio kw, which is the width of the texture newly set in reality/the width of the real original texture, and calculates a scaled texture length ratio kl, which is the length of the texture newly set in reality/the length of the real original texture, where kw and kl are floating point numbers greater than 0. Calculating the lengths of four side line segments of the rectangle according to the coordinates of four nodes of the texture 3D model, multiplying the width of the rectangle by kw to obtain the width of the scaled rectangle, multiplying the length of the rectangle by kl to obtain the length of the scaled rectangle, and finally obtaining the coordinates of the four nodes of the scaled rectangle.
2. Rotate
The angles of rotation include: 90 degrees, 180 degrees, 270 degrees. The rotating direction can be anticlockwise or clockwise, and the technical solutions of the two modes are the same.
A 90 degree counterclockwise rotation has the same effect as a 270 degree clockwise rotation. Assuming that the length and width of the rectangle of the texture 3D model before rotation are respectively: line _ L and line _ W, the length and width of the rectangle of the texture 3D model after rotation are respectively: line _ W and line _ L, wherein the coordinates of the central point of the rotated rectangle and the central point of the rectangle before rotation are the same, and the coordinates of each rotated node are finally obtained; rotating the texture pattern by 90 degrees anticlockwise to finally obtain the rotated texture pattern;
a rotation of 180 degrees counter-clockwise has the same effect as a rotation of 180 degrees clockwise. Coordinates of each node of the texture 3D model after rotation are the same as coordinates of each node of the texture 3D model before rotation; rotating the texture pattern by 180 degrees anticlockwise to finally obtain the rotated texture pattern;
a counterclockwise rotation of 270 degrees has the same effect as a clockwise rotation of 90 degrees. Assuming that the length and width of the rectangle of the texture 3D model before rotation are respectively: line _ L and line _ W, the length and width of the rectangle of the texture 3D model after rotation are respectively: line _ W and line _ L, wherein the coordinates of the central point of the rotated rectangle and the central point of the length shape before rotation are the same, and the coordinates of each rotated node are finally obtained; and rotating the texture pattern by 270 degrees in a counterclockwise direction to finally obtain the rotated texture pattern.
Step four, drawing the wall texture
The wall texture drawing module receives wall 3D model group information, namely node _ wall _ group, from the wall 3D model creating module, receives texture 3D model information from the texture 3D model redrawing module again, and draws the texture of the wall according to different wall drawing instructions, and the wall drawing instructions include: whole wall tiling, whole wall stretching, horizontal tiling, horizontal stretching, left tiling, left stretching, right tiling, vertical stretching, upward tiling, upward stretching, downward tiling, downward stretching, full house tiling, full house stretching;
1. drawing of whole wall
Obtaining a 3D model of a wall surface to be drawn from the node _ wall _ group, and assuming that the 3D model of the wall surface is node _ wall _1, namely the coordinates of four nodes of a rectangle of the 3D model of the node _ wall _1 are: recording the node coordinate of the upper left corner as node _ LT, the node coordinate of the lower left corner as node _ LD, the node coordinate of the upper right corner as node _ RT and the node coordinate of the lower right corner as node _ RD; assuming that the coordinates of the four nodes are wall _ nodes, a rectangular domain constructed by the coordinates of the four nodes is a target rectangular domain to be drawn, and assuming that the target rectangular domain is Rect _ dst _ pain;
1) whole wall tiling
Assuming that the size of the horizontal translation for the texture is tx and the size of the vertical translation for the texture is ty; transmitting the texture 3D model information, the coordinates wall _ nodes of the wall 3D model (which are used as each node of the target drawing area), the size tx of the horizontal translation of the texture and the size ty of the vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
2) stretching of whole wall
The texture pattern texture _ src is drawn in a full manner for the entire rectangular field Rect _ dst _ pain.
2. Horizontal drawing
Assuming that a textured 3D model exists on the wall surface, the textured 3D model needs to be rendered horizontally. Assuming that the 3D model of the wall surface is node _ wall _1, that is, the node coordinate of the lower left corner of the rectangle of the 3D model of node _ wall _1 is recorded as wall _ node _ LD (x, y, z) and the node coordinate of the upper right corner is recorded as wall _ node _ RT (x, y, z); assuming that the texture 3D model is texture _ src, i.e. the node coordinates of the lower left corner of the rectangle of the texture _ src 3D model are registered as texture _ node _ LD (x, y, z) and the node coordinates of the upper right corner are registered as texture _ node _ RT (x, y, z); let the coordinates of each node nodes _ dst of the target rendering area, i.e. the four nodes of the rectangle of the nodes _ dst, be: recording the coordinates of the nodes at the upper left corner as dst _ node _ LT, the coordinates of the nodes at the lower left corner as dst _ node _ LD, the coordinates of the nodes at the upper right corner as dst _ node _ RT, and the coordinates of the nodes at the lower right corner as dst _ node _ RD; the specific coordinates of each node in the target drawing area are as follows: dst _ node _ LT (wall _ node _ ld.x, texture _ node _ rt.y, wall _ node _ ld.z), dst _ node _ LD (wall _ node _ ld.x, texture _ node _ ld.y, wall _ node _ ld.z), dst _ node _ RT (wall _ node _ rt.x, texture _ node _ rt.y, wall _ node _ rt.z), dst _ node _ RD (wall _ node _ rt.x, texture _ node _ ld.y, wall _ node _ rt.z);
1) and (5) horizontally spreading.
Assuming that the size of the horizontal translation for the texture is tx and the size of the vertical translation for the texture is ty; transmitting the texture 3D model information, the coordinates of each node _ dst of the target drawing area, the size tx of horizontal translation of the texture and the size ty of vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
2) horizontal drawing
And forming a target rectangular field to be drawn according to the four nodes of the nodes _ dst, and finally drawing the texture pattern texture _ src in a filling manner on the whole rectangular field Rec _ dst _ pain by assuming that the target rectangular field is Rec _ dst _ pain.
3. Draw to the left
Assuming that there is a textured 3D model on the wall, the textured 3D model needs to be rendered to the left. Assuming that the 3D model of the wall surface is node _ wall _1, that is, the node coordinate of the lower left corner of the rectangle of the 3D model of node _ wall _1 is recorded as wall _ node _ LD (x, y, z) and the node coordinate of the upper right corner is recorded as wall _ node _ RT (x, y, z); assuming that the texture 3D model is texture _ src, i.e. the node coordinates of the lower left corner of the rectangle of the texture _ src 3D model are registered as texture _ node _ LD (x, y, z) and the node coordinates of the upper right corner are registered as texture _ node _ RT (x, y, z); let the coordinates of each node nodes _ dst of the target rendering area, i.e. the four nodes of the rectangle of the nodes _ dst, be: recording the coordinates of the nodes at the upper left corner as dst _ node _ LT, the coordinates of the nodes at the lower left corner as dst _ node _ LD, the coordinates of the nodes at the upper right corner as dst _ node _ RT, and the coordinates of the nodes at the lower right corner as dst _ node _ RD; the specific coordinates of each node in the target drawing area are as follows: dst _ node _ LT (wall _ node _ ld.x, texture _ node _ rt.y, wall _ node _ ld.z), dst _ node _ LD (wall _ node _ ld.x, texture _ node _ ld.y, wall _ node _ ld.z), dst _ node _ RT (texture _ node _ rt.x, texture _ node _ rt.y, texture _ node _ rt.z), dst _ node _ RD (texture _ node _ rt.x, texture _ node _ ld.y, texture _ node _ rt.z);
1) tiling to the left
Assuming that the size of the horizontal translation for the texture is tx and the size of the vertical translation for the texture is ty; transmitting the texture 3D model information, the coordinates of each node _ dst of the target drawing area, the size tx of horizontal translation of the texture and the size ty of vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
2) stretching to the left
And forming a target rectangular field to be drawn according to the four nodes of the nodes _ dst, and finally drawing the texture pattern texture _ src in a filling manner on the whole rectangular field Rec _ dst _ pain by assuming that the target rectangular field is Rec _ dst _ pain.
4. Drawing to the right
Assuming that a textured 3D model exists on the wall surface, the textured 3D model needs to be rendered to the right. Assuming that the 3D model of the wall surface is node _ wall _1, that is, the node coordinate of the lower left corner of the rectangle of the 3D model of node _ wall _1 is recorded as wall _ node _ LD (x, y, z) and the node coordinate of the upper right corner is recorded as wall _ node _ RT (x, y, z); assuming that the texture 3D model is texture _ src, i.e. the node coordinates of the lower left corner of the rectangle of the texture _ src 3D model are registered as texture _ node _ LD (x, y, z) and the node coordinates of the upper right corner are registered as texture _ node _ RT (x, y, z); let the coordinates of each node nodes _ dst of the target rendering area, i.e. the four nodes of the rectangle of the nodes _ dst, be: recording the coordinates of the nodes at the upper left corner as dst _ node _ LT, the coordinates of the nodes at the lower left corner as dst _ node _ LD, the coordinates of the nodes at the upper right corner as dst _ node _ RT, and the coordinates of the nodes at the lower right corner as dst _ node _ RD; the specific coordinates of each node in the target drawing area are as follows: dst _ node _ LT (texture _ node _ ld.x, texture _ node _ rt.y, texture _ node _ ld.z), dst _ node _ LD (texture _ node _ ld.x, texture _ node _ ld.y, texture _ node _ ld.z), dst _ node _ RT (wall _ node _ rt.x, texture _ node _ rt.y, wall _ node _ rt.z), dst _ node _ RD (wall _ node _ rt.x, texture _ node _ ld.y, wall _ node _ rt.z);
1) tiling to the right
Assuming that the size of the horizontal translation for the texture is tx and the size of the vertical translation for the texture is ty; transmitting the texture 3D model information, the coordinates of each node _ dst of the target drawing area, the size tx of horizontal translation of the texture and the size ty of vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
2) stretching to the right
And forming a target rectangular field to be drawn according to the four nodes of the nodes _ dst, and finally drawing the texture pattern texture _ src in a filling manner on the whole rectangular field Rec _ dst _ pain by assuming that the target rectangular field is Rec _ dst _ pain.
5. Vertical drawing
Assuming that a textured 3D model exists on the wall surface, the textured 3D model needs to be rendered vertically. Assuming that the 3D model of the wall surface is node _ wall _1, that is, the node coordinate of the lower left corner of the rectangle of the 3D model of node _ wall _1 is recorded as wall _ node _ LD (x, y, z) and the node coordinate of the upper right corner is recorded as wall _ node _ RT (x, y, z); assuming that the texture 3D model is texture _ src, i.e. the node coordinates of the lower left corner of the rectangle of the texture _ src 3D model are registered as texture _ node _ LD (x, y, z) and the node coordinates of the upper right corner are registered as texture _ node _ RT (x, y, z); let the coordinates of each node nodes _ dst of the target rendering area, i.e. the four nodes of the rectangle of the nodes _ dst, be: recording the coordinates of the nodes at the upper left corner as dst _ node _ LT, the coordinates of the nodes at the lower left corner as dst _ node _ LD, the coordinates of the nodes at the upper right corner as dst _ node _ RT, and the coordinates of the nodes at the lower right corner as dst _ node _ RD; the specific coordinates of each node in the target drawing area are as follows: dst _ node _ LT (texture _ node _ ld.x, wall _ node _ rt.y, texture _ node _ ld.z), dst _ node _ LD (texture _ node _ ld.x, wall _ node _ ld.y, texture _ node _ ld.z), dst _ node _ RT (texture _ node _ rt.x, wall _ node _ rt.y, texture _ node _ rt.z), dst _ node _ RD (texture _ node _ rt.x, wall _ node _ ld.y, texture _ node _ rt.z);
1) vertical tiling
Assuming that the size of the horizontal translation for the texture is tx and the size of the vertical translation for the texture is ty; transmitting the texture 3D model information, the coordinates of each node _ dst of the target drawing area, the size tx of horizontal translation of the texture and the size ty of vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
2) vertical stretching
And forming a target rectangular field to be drawn according to the four nodes of the nodes _ dst, and finally drawing the texture pattern texture _ src in a filling manner on the whole rectangular field Rec _ dst _ pain by assuming that the target rectangular field is Rec _ dst _ pain.
6. Draw upwards
Assuming that a textured 3D model exists on the wall surface, the textured 3D model needs to be rendered upward. Assuming that the 3D model of the wall surface is node _ wall _1, that is, the node coordinate of the lower left corner of the rectangle of the 3D model of node _ wall _1 is recorded as wall _ node _ LD (x, y, z) and the node coordinate of the upper right corner is recorded as wall _ node _ RT (x, y, z); assuming that the texture 3D model is texture _ src, i.e. the node coordinates of the lower left corner of the rectangle of the texture _ src 3D model are registered as texture _ node _ LD (x, y, z) and the node coordinates of the upper right corner are registered as texture _ node _ RT (x, y, z); let the coordinates of each node nodes _ dst of the target rendering area, i.e. the four nodes of the rectangle of the nodes _ dst, be: recording the coordinates of the nodes at the upper left corner as dst _ node _ LT, the coordinates of the nodes at the lower left corner as dst _ node _ LD, the coordinates of the nodes at the upper right corner as dst _ node _ RT, and the coordinates of the nodes at the lower right corner as dst _ node _ RD; the specific coordinates of each node in the target drawing area are as follows: dst _ node _ LT (texture _ node _ ld.x, wall _ node _ rt.y, texture _ node _ ld.z), dst _ node _ LD (texture _ node _ ld.x, texture _ node _ ld.y, texture _ node _ ld.z), dst _ node _ RT (texture _ node _ rt.x, wall _ node _ rt.y, texture _ node _ rt.z), dst _ node _ RD (texture _ node _ rt.x, texture _ node _ ld.y, texture _ node _ rt.z);
1) spread upward
Assuming that the size of the horizontal translation for the texture is tx and the size of the vertical translation for the texture is ty; transmitting the texture 3D model information, the coordinates of each node _ dst of the target drawing area, the size tx of horizontal translation of the texture and the size ty of vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
2) is stretched upwards
And forming a target rectangular field to be drawn according to the four nodes of the nodes _ dst, and finally drawing the texture pattern texture _ src in a filling manner on the whole rectangular field Rec _ dst _ pain by assuming that the target rectangular field is Rec _ dst _ pain.
7. Draw down
Assuming that a textured 3D model exists on the wall surface, the textured 3D model needs to be rendered vertically. Assuming that the 3D model of the wall surface is node _ wall _1, that is, the node coordinate of the lower left corner of the rectangle of the 3D model of node _ wall _1 is recorded as wall _ node _ LD (x, y, z) and the node coordinate of the upper right corner is recorded as wall _ node _ RT (x, y, z); assuming that the texture 3D model is texture _ src, i.e. the node coordinates of the lower left corner of the rectangle of the texture _ src 3D model are registered as texture _ node _ LD (x, y, z) and the node coordinates of the upper right corner are registered as texture _ node _ RT (x, y, z); let the coordinates of each node nodes _ dst of the target rendering area, i.e. the four nodes of the rectangle of the nodes _ dst, be: recording the coordinates of the nodes at the upper left corner as dst _ node _ LT, the coordinates of the nodes at the lower left corner as dst _ node _ LD, the coordinates of the nodes at the upper right corner as dst _ node _ RT, and the coordinates of the nodes at the lower right corner as dst _ node _ RD; the specific coordinates of each node in the target drawing area are as follows: dst _ node _ LT (texture _ node _ ld.x, texture _ node _ rt.y, texture _ node _ ld.z), dst _ node _ LD (texture _ node _ ld.x, wall _ node _ ld.y, texture _ node _ ld.z), dst _ node _ RT (texture _ node _ rt.x, texture _ node _ rt.y, texture _ node _ rt.z), dst _ node _ RD (texture _ node _ rt.x, wall _ node _ ld.y, texture _ node _ rt.z);
1) spread downwards
Assuming that the size of the horizontal translation for the texture is tx and the size of the vertical translation for the texture is ty; transmitting the texture 3D model information, the coordinates of each node _ dst of the target drawing area, the size tx of horizontal translation of the texture and the size ty of vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
2) is stretched downwards
And forming a target rectangular field to be drawn according to the four nodes of the nodes _ dst, and finally drawing the texture pattern texture _ src in a filling manner on the whole rectangular field Rec _ dst _ pain by assuming that the target rectangular field is Rec _ dst _ pain.
8. Drawing of whole house
1) And (5) paving the whole house.
Acquiring node coordinates of the 3D model of each wall surface one by one from node _ wall _ group, and performing: the whole wall in the whole wall drawing is tiled;
2) and (5) stretching the whole house.
Acquiring node coordinates of the 3D model of each wall surface one by one from node _ wall _ group, and performing: and stretching the whole wall in the whole wall drawing.
And tiling and drawing sub-modules. Since the tiled drawing has common drawing features, the tiled drawing is described herein in a unified manner, and the specific technical solution of the tiled drawing is as follows:
the first step, the incoming data on which the algorithm depends, is: coordinates of each node and a texture pattern of the texture 3D model, each node of a target drawing area, and the size of horizontal translation and the size of vertical translation;
1) assuming that the texture pattern is texture _ src, assuming that the width of the texture pattern texture _ src is bmpWidth, and assuming that the height of the texture pattern texture _ src is bmpHeight;
2) the nodes of the texture 3D model comprise 4 nodes and form a rectangular domain, and the rectangular domain of the texture is assumed to be Rect _ texture _ pain; assume that the rectangular fields are the size of Rect _ texture _ picture length and width, respectively: texture _ line _ L and texture _ line _ W;
3) the nodes of the target drawing area also comprise 4 nodes and form a rectangular domain, and the rectangular domain of the target drawing area is assumed to be Rect _ dst _ pain; assuming that the rectangular field is the length and width dimensions of Rect _ dst _ pain respectively: dst _ line _ L and dst _ line _ W;
4) let the size of the horizontal translation be tx and let the size of the vertical translation be ty;
and secondly, the horizontal translation size dst _ tx in the target drawing area is texture _ line _ W _ tx/bmpWidth, the vertical translation size dst _ tx in the target drawing area is texture _ line _ L _ ty/bmpHeight, and the rectangular domain Rect _ dst _ page of the target drawing area is tiled by using texture patterns as texture _ src according to dst _ tx and dst _ ty until the rectangular domain Rect _ dst _ page is tiled.
3. Advantageous effects
Compared with the prior art, the technical scheme provided by the invention has the following remarkable effects:
(1) the invention provides a wall texture drawing system, which provides a texture 3D model redrawing module, wherein the module redraws original texture patterns according to two different redrawing instructions of zooming and rotating, so that the zooming and rotating effects of the wall texture drawing are realized, and a user does not need to zoom and rotate each drawn texture pattern; in addition, the invention can conveniently carry out various kinds of drawing on the texture on the wall surface only by appointing the redrawing instruction and the wall surface drawing instruction and combining the two instructions, thereby reducing the fine operation of manually using a mouse.
(2) The invention provides a wall texture drawing system, which provides a wall texture drawing module, namely, the texture of a wall surface is drawn according to different wall surface drawing instructions, and the module comprises the drawing instructions, so that a user can draw the texture of one wall surface or even the texture of a whole house differently through one operation.
(3) According to the wall surface texture drawing method, due to the existence of the texture 3D model redrawing module and the wall surface texture drawing module, a user can easily draw textures of a wall surface or even a whole room in different ways through different simple operation instructions, so that the complex drawing of the textures of the 3D model is simplified, the user can also finish corresponding operation on mobile equipment smoothly, the operation cost of the user on the mobile equipment is reduced, and the method is suitable for popularization of the mobile internet technology.
Drawings
FIG. 1 is a schematic view of a wall and a texture in a wall texture rendering system according to the present invention;
FIG. 2 is a block diagram of a wall texture rendering system of the present invention;
FIG. 3 is a flowchart of an algorithm of a wall texture rendering method of the present invention;
fig. 4 is a schematic diagram of tiling of a whole wall according to the drawing method of the present invention;
fig. 5 is a schematic diagram of horizontal tiling involved in the rendering method of the present invention;
fig. 6 is a schematic diagram of rightward tiling according to the drawing method of the present invention;
fig. 7 is a schematic diagram of left tiling according to the rendering method of the present invention;
fig. 8 is a schematic diagram of vertical tiling according to the rendering method of the present invention;
fig. 9 is a schematic view of upward tiling according to the rendering method of the present invention;
fig. 10 is a schematic view of downward tiling according to the rendering method of the present invention.
Detailed Description
The invention is further described with reference to specific examples.
Example 1
With reference to fig. 2, the wall surface texture drawing system of the present embodiment includes a wall surface 3D model creating module, a texture 3D model redrawing module, and a wall surface texture drawing module.
The wall 3D model establishes the three-dimensional coordinate information that the module record, storage and transmission wall were established to the wall, and generally speaking, the wall is the rectangle, consequently only needs the three-dimensional coordinate of record storage four nodes, is respectively: upper left corner, lower left corner, upper right corner, and lower right corner (see fig. 1). If the wall surface is irregular, the smallest rectangle capable of accommodating the irregular shape is taken, and four nodes of the rectangle are recorded. The wall surface 3D model creating module transmits the three-dimensional coordinates of the four nodes to the wall surface texture drawing module.
The texture 3D model creating module records, stores and transmits three-dimensional coordinate information of textures, the texture patterns can be pictures, colors or combinations of the pictures and the colors, the texture 3D model is also rectangular, and only three-dimensional coordinates of four nodes need to be recorded and stored, namely: upper left corner, lower left corner, upper right corner, and lower right corner (see fig. 1). The texture 3D model creation module transmits the three-dimensional coordinates of the four nodes and the texture pattern to the texture 3D model redrawing module.
The texture 3D model redrawing module comprises two instructions, namely rotating and zooming the texture respectively, a user specifies a corresponding redrawing instruction on an operation interface as required, the module redraws the texture according to the corresponding redrawing instruction, and transmits the redrawing texture to the wall texture drawing module.
The wall texture drawing module comprises a plurality of wall surface drawing instructions: whole wall tiling, horizontal tiling, left tiling, right tiling, vertical tiling, upward tiling, downward tiling, whole house tiling, whole wall stretching, horizontal stretching, left stretching, right stretching, vertical stretching, upward stretching, downward stretching, and whole house stretching; the module acquires three-dimensional coordinate information of 4 vertexes of the wall surface from the wall surface 3D model establishing module, acquires the redrawn texture and the three-dimensional coordinate information of the 4 vertexes of the texture from the texture 3D model redrawing module, and draws the texture of the wall surface according to the appointed wall surface drawing instruction.
The wall texture drawing module further comprises an internal module: the technical scheme of finishing each drawing instruction in the wall texture drawing module comprises a tiling technical scheme, and the characteristics of the related tiling technical schemes are basically the same, so that the technical modes of the tiling drawing sub-module are uniformly described.
According to the method and the device, various textures on the wall can be very conveniently drawn only by specifying the redrawing instruction and the wall drawing instruction and combining the two instructions, so that the fine operation of manually using a mouse on the wall is reduced. For example, the user needs to scale tiles on the wall and then lay them horizontally to form a waistline. The general way of operating on a PC is: installing a certain tile texture on a wall, zooming the tile texture, copying the tile texture, finding an accurate position to be pasted by using a mouse, and pasting the tile texture, wherein the process is continuously and repeatedly operated until a required waist line is formed; the operation of this belt line in this embodiment is very simple: install a certain tile texture on the wall, the user specifies "redraw command: zoom ", then specify" wall drawing instruction: the drawing of the waist line can be automatically finished by horizontally tiling, so that the fine operation required by a user is greatly reduced, and the aim of finishing the operation of complexly drawing the wall texture on the mobile equipment very simply, conveniently and efficiently is fulfilled.
Example 2
With reference to fig. 3, the wall surface texture drawing method of the present embodiment includes the steps of:
step one, initializing wall 3D model information
The wall 3D model creation module records three-dimensional coordinates of each node of the 3D model of the wall, and the wall model is rectangular, so that the coordinates of four nodes only need to be stored, which are respectively: upper left corner, lower left corner, upper right corner, and lower right corner. The node coordinate of the upper left corner is recorded as node _ LT, the node coordinate of the lower left corner is recorded as node _ LD, the node coordinate of the upper right corner is recorded as node _ RT, and the node coordinate of the lower right corner is recorded as node _ RD. A room is formed by a plurality of wall surfaces, and the three-dimensional coordinates of each node of the wall surface 3D model of the wall surfaces of the plurality of wall surfaces are recorded as a wall surface 3D model group, namely node _ wall _ group. Transmitting the three-dimensional coordinates of the nodes contained in the node _ wall _ group to a wall texture drawing module; if the coordinates of four nodes of one wall surface are respectively: upper left node _ LT (-5, 4, 0), lower left node _ LD (-5, 0, 0), upper right node _ RT (5, 4, 0), and lower right node _ RD (5, 0, 0).
Step two, initializing texture 3D model information
The texture 3D model creating module records three-dimensional coordinates and texture patterns of each node of a 3D model of a texture, and the texture model is rectangular; therefore, only the coordinates of four nodes need to be stored, respectively: upper left corner, lower left corner, upper right corner, and lower right corner. Recording the node coordinate of the upper left corner as node _ LT, the node coordinate of the lower left corner as node _ LD, the node coordinate of the upper right corner as node _ RT and the node coordinate of the lower right corner as node _ RD; the texture pattern can be a picture, a color or a combination of the picture and the color; transmitting the three-dimensional coordinates of the nodes and the texture patterns contained in the texture model to a texture 3D model redrawing module; for example, the coordinates of the four nodes of the texture model are: upper left corner node _ LT (1.5, 3, 0), lower left corner node _ LD (1.5, 1, 0), upper right corner node _ RT (2.5, 3, 0), and lower right corner node _ RD (2.5, 1, 0).
Step three, redrawing the texture
The texture 3D model redrawing module is used for redrawing the texture 3D model according to different redrawing instructions, wherein the texture 3D model redrawing module acquires three-dimensional coordinates and texture pattern information of nodes contained in the texture 3D model from the texture 3D model creating module, and the redrawing instructions comprise: zooming and rotating. The zooming redrawing instruction and the rotating redrawing instruction do not have the sequence, the two redrawing instructions can be executed independently or in combination, and the three-dimensional coordinates and the texture patterns of the nodes contained in the texture 3D model finally redrawn are transmitted to the wall surface texture drawing module; and if no redrawing instruction is executed, transmitting the three-dimensional coordinates of the nodes and the texture pattern contained in the original texture 3D model to the wall texture drawing module.
1. Zoom
This scaling solution is to solve the problem that the mapping relationship between the real texture size and the texture size in the 3D model is complex, for example: for a tile 30cm wide and 60cm long on a wall surface, and the size of the tile in the 3D model may be a rectangle 200 cm wide and 400 cm long, if the user needs to reduce the length and width of the tile to 0.5 times, the user has to calculate by himself: reducing the size of the 3D model to 0.5 times of the original size; this embodiment makes the user need not pay close attention to the size in the 3D model, only needs to pay close attention to the texture size in reality, namely the user only needs to set up the width and the length of the ceramic tile in reality as 15cm and 30cm respectively, and the user just sends two redrawing instructions to texture 3D model redrawing module this moment respectively, is respectively: scaling the texture width and scaling the texture length.
Calculating a scaled texture width ratio kw, i.e. kw equals to the width of the newly set texture in reality/the width of the real native texture, and calculating a scaled texture length ratio kl, i.e. kl equals to the length of the newly set texture in reality/the length of the real native texture, where kw and kl are both floating point numbers greater than 0. Calculating the lengths of four side line segments of the rectangle according to the coordinates of four nodes of the texture 3D model, multiplying the width of the rectangle by kw to obtain the width of the scaled rectangle, multiplying the length of the rectangle by kl to obtain the length of the scaled rectangle, and finally obtaining the coordinates of the four nodes of the scaled rectangle.
The coordinates of the center point of the rectangle after zooming and the coordinates of the center point of the length shape before zooming are the same, and the coordinates of each node after zooming are finally obtained; assuming kw and kl are both 2.0, the coordinates of the four nodes of the texture model are: upper left node _ LT (1, 4, 0), lower left node _ LD (1, 0, 0), upper right node _ RT (3, 4, 0), and lower right node _ RD (3, 0, 0).
2. Rotate
The principle of the rotation technical scheme is basically the same as that of the prior technical scheme, but the technical scheme is combined with the wall texture drawing module to form a brand new technical effect.
The angles of rotation include: 90 degrees, 180 degrees, 270 degrees. The rotating direction can be anticlockwise or clockwise, and the technical solutions of the two modes are the same.
A 90 degree counterclockwise rotation has the same effect as a 270 degree clockwise rotation. Assuming that the length and width of the rectangle of the texture 3D model before rotation are respectively: line _ L and line _ W, the lengths of the length and width of the rectangle of the texture 3D model after rotation are respectively: line _ W and line _ L, wherein the coordinates of the central point of the rotated rectangle and the central point of the rectangle before rotation are the same, and the coordinates of each rotated node are finally obtained; rotating the texture pattern by 90 degrees anticlockwise to finally obtain the rotated texture pattern; the coordinates of the four nodes of the texture model are: upper left node _ LT (0, 3, 0), lower left node _ LD (0, 1, 0), upper right node _ RT (4, 3, 0), and lower right node _ RD (4, 1, 0).
A rotation of 180 degrees counter-clockwise has the same effect as a rotation of 180 degrees clockwise. Coordinates of each node of the texture 3D model after rotation are the same as coordinates of each node of the texture 3D model before rotation; rotating the texture pattern by 180 degrees anticlockwise to finally obtain the rotated texture pattern; the coordinates of the four nodes of the texture model are: upper left node _ LT (1, 4, 0), lower left node _ LD (1, 0, 0), upper right node _ RT (3, 4, 0), and lower right node _ RD (3, 0, 0).
A counterclockwise rotation of 270 degrees has the same effect as a clockwise rotation of 90 degrees. Assuming that the length and width of the rectangle of the texture 3D model before rotation are respectively: line _ L and line _ W, the length and width of the rectangle of the texture 3D model after rotation are respectively: line _ W and line _ L, wherein the coordinates of the central point of the rotated rectangle and the central point of the length shape before rotation are the same, and the coordinates of each rotated node are finally obtained; rotating the texture pattern by 270 degrees in a counterclockwise direction to finally obtain the rotated texture pattern; the coordinates of the four nodes of the texture model are: upper left node _ LT (0, 3, 0), lower left node _ LD (0, 1, 0), upper right node _ RT (4, 3, 0), and lower right node _ RD (4, 1, 0).
Step four, drawing the wall texture
The wall texture drawing module receives wall 3D model group information, namely node _ wall _ group, from the wall 3D model creating module, receives texture 3D model information from the texture 3D model redrawing module again, and draws the texture of the wall according to different wall drawing instructions, and the wall drawing instructions include: whole wall tiling, whole wall stretching, horizontal tiling, horizontal stretching, left tiling, left stretching, right tiling, vertical stretching, upward tiling, upward stretching, downward tiling, downward stretching, full room tiling, full room stretching.
1. Drawing of whole wall (see FIG. 4)
Obtaining a 3D model of a wall surface to be drawn from the node _ wall _ group, and assuming that the 3D model of the wall surface is node _ wall _1, namely the coordinates of four nodes of a rectangle of the 3D model of the node _ wall _1 are: recording the node coordinate of the upper left corner as node _ LT, the node coordinate of the lower left corner as node _ LD, the node coordinate of the upper right corner as node _ RT and the node coordinate of the lower right corner as node _ RD; assuming the coordinates of the four nodes as wall _ nodes; a rectangular domain constructed by the coordinates of the four nodes is a target rectangular domain to be drawn, and the target rectangular domain is assumed to be Rect _ dst _ pain; let the coordinates of the four nodes of the wall be: upper left node _ LT (-5, 4, 0), lower left node _ LD (-5, 0, 0), upper right node _ RT (5, 4, 0), and lower right node _ RD (5, 0, 0);
1) whole wall tiling
Assuming that the size of the horizontal translation for the texture is tx and the size of the vertical translation for the texture is ty; transmitting the texture 3D model information, the coordinates wall _ nodes of the wall 3D model (which are used as each node of the target drawing area), the size tx of the horizontal translation of the texture and the size ty of the vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
2) stretching of whole wall
The texture pattern texture _ src is drawn in a full manner for the entire rectangular field Rect _ dst _ pain.
2. Horizontal rendering (see FIG. 5)
Assuming that a textured 3D model exists on the wall surface, the textured 3D model needs to be rendered horizontally. Assuming that the 3D model of the wall surface is node _ wall _1, that is, the node coordinate of the lower left corner of the rectangle of the 3D model of node _ wall _1 is recorded as wall _ node _ LD (-5, 0, 0) and the node coordinate of the upper right corner is recorded as wall _ node _ RT (5, 4, 0); suppose that the texture 3D model is texture _ src, i.e., the node coordinates of the lower left corner of the rectangle of the texture _ src 3D model are registered as texture _ node _ LD (0, 1, 0) and the node coordinates of the upper right corner are registered as texture _ node _ RT (4, 3, 0); let the coordinates of each node nodes _ dst of the target rendering area, i.e. the four nodes of the rectangle of the nodes _ dst, be: recording the coordinates of the nodes at the upper left corner as dst _ node _ LT, the coordinates of the nodes at the lower left corner as dst _ node _ LD, the coordinates of the nodes at the upper right corner as dst _ node _ RT, and the coordinates of the nodes at the lower right corner as dst _ node _ RD; the specific coordinates of each node in the target drawing area are as follows: dst _ node _ LT (-5, 3, 0), dst _ node _ LD (-5, 1, 0), dst _ node _ RT (5, 3, 0), dst _ node _ RD (5, 1, 0);
1) and (5) horizontally spreading.
Assuming that the size of the horizontal translation for the texture is tx and the size of the vertical translation for the texture is ty; transmitting the texture 3D model information, the coordinates of each node _ dst of the target drawing area, the size tx of horizontal translation of the texture and the size ty of vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
2) horizontal drawing
Forming a target rectangular domain to be drawn according to four nodes of the nodes _ dst, and finally drawing the whole rectangular domain Rec _ dst _ pain in a filling mode by the texture pattern texture _ src assuming that the target rectangular domain is Rec _ dst _ pain;
3. is drawn to the left (see fig. 7)
Assuming that there is a textured 3D model on the wall, the textured 3D model needs to be rendered to the left. Assuming that the 3D model of the wall surface is node _ wall _1, that is, the node coordinate of the lower left corner of the rectangle of the 3D model of node _ wall _1 is recorded as wall _ node _ LD (-5, 0, 0) and the node coordinate of the upper right corner is recorded as wall _ node _ RT (5, 4, 0); suppose that the texture 3D model is texture _ src, i.e., the node coordinates of the lower left corner of the rectangle of the texture _ src 3D model are registered as texture _ node _ LD (0, 1, 0) and the node coordinates of the upper right corner are registered as texture _ node _ RT (4, 3, 0); let the coordinates of each node nodes _ dst of the target rendering area, i.e. the four nodes of the rectangle of the nodes _ dst, be: recording the coordinates of the nodes at the upper left corner as dst _ node _ LT, the coordinates of the nodes at the lower left corner as dst _ node _ LD, the coordinates of the nodes at the upper right corner as dst _ node _ RT, and the coordinates of the nodes at the lower right corner as dst _ node _ RD; the specific coordinates of each node in the target drawing area are as follows: dst _ node _ LT (-5, 3, 0), dst _ node _ LD (-5, 1, 0), dst _ node _ RT (4, 3, 0), dst _ node _ RD (4, 1, 0);
1) tiling to the left
Assuming that the size of the horizontal translation for the texture is tx and the size of the vertical translation for the texture is ty; transmitting the texture 3D model information, the coordinates of each node _ dst of the target drawing area, the size tx of horizontal translation of the texture and the size ty of vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
2) stretching to the left
And forming a target rectangular field to be drawn according to the four nodes of the nodes _ dst, and finally drawing the texture pattern texture _ src in a filling manner on the whole rectangular field Rec _ dst _ pain by assuming that the target rectangular field is Rec _ dst _ pain.
4. To the right (see FIG. 6)
Assuming that a textured 3D model exists on the wall surface, the textured 3D model needs to be rendered to the right. Assuming that the 3D model of the wall surface is node _ wall _1, that is, the node coordinate of the lower left corner of the rectangle of the 3D model of node _ wall _1 is recorded as wall _ node _ LD (-5, 0, 0) and the node coordinate of the upper right corner is recorded as wall _ node _ RT (5, 4, 0); suppose that the texture 3D model is texture _ src, i.e., the node coordinates of the lower left corner of the rectangle of the texture _ src 3D model are registered as texture _ node _ LD (0, 1, 0) and the node coordinates of the upper right corner are registered as texture _ node _ RT (4, 3, 0); let the coordinates of each node nodes _ dst of the target rendering area, i.e. the four nodes of the rectangle of the nodes _ dst, be: recording the coordinates of the nodes at the upper left corner as dst _ node _ LT, the coordinates of the nodes at the lower left corner as dst _ node _ LD, the coordinates of the nodes at the upper right corner as dst _ node _ RT, and the coordinates of the nodes at the lower right corner as dst _ node _ RD; the specific coordinates of each node in the target drawing area are as follows: dst _ node _ LT (0, 3, 0), dst _ node _ LD (0, 1, 0), dst _ node _ RT (5, 3, 0), dst _ node _ RD (5, 1, 0);
1) tiling to the right
Assuming that the size of the horizontal translation for the texture is tx and the size of the vertical translation for the texture is ty; transmitting the texture 3D model information, the coordinates of each node _ dst of the target drawing area, the size tx of horizontal translation of the texture and the size ty of vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
2) stretching to the right
Forming a target rectangular domain to be drawn according to four nodes of the nodes _ dst, and finally drawing the whole rectangular domain Rec _ dst _ pain in a filling mode by the texture pattern texture _ src assuming that the target rectangular domain is Rec _ dst _ pain;
5. vertical rendering (see FIG. 8)
Assuming that a textured 3D model exists on the wall surface, the textured 3D model needs to be rendered vertically. Assuming that the 3D model of the wall surface is node _ wall _1, that is, the node coordinate of the lower left corner of the rectangle of the 3D model of node _ wall _1 is recorded as wall _ node _ LD (-5, 0, 0) and the node coordinate of the upper right corner is recorded as wall _ node _ RT (5, 4, 0); suppose that the texture 3D model is texture _ src, i.e., the node coordinates of the lower left corner of the rectangle of the texture _ src 3D model are registered as texture _ node _ LD (0, 1, 0) and the node coordinates of the upper right corner are registered as texture _ node _ RT (4, 3, 0); let the coordinates of each node nodes _ dst of the target rendering area, i.e. the four nodes of the rectangle of the nodes _ dst, be: recording the coordinates of the nodes at the upper left corner as dst _ node _ LT, the coordinates of the nodes at the lower left corner as dst _ node _ LD, the coordinates of the nodes at the upper right corner as dst _ node _ RT, and the coordinates of the nodes at the lower right corner as dst _ node _ RD; the specific coordinates of each node in the target drawing area are as follows: dst _ node _ LT (0, 4, 0), dst _ node _ LD (0, 0, 0), dst _ node _ RT (4, 4, 0), dst _ node _ RD (4, 0, 0);
1) vertical tiling
Assuming that the size of the horizontal translation for the texture is tx and the size of the vertical translation for the texture is ty; transmitting the texture 3D model information, the coordinates of each node _ dst of the target drawing area, the size tx of horizontal translation of the texture and the size ty of vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
2) vertical stretching
Forming a target rectangular domain to be drawn according to four nodes of the nodes _ dst, and finally drawing the whole rectangular domain Rec _ dst _ pain in a filling mode by the texture pattern texture _ src assuming that the target rectangular domain is Rec _ dst _ pain;
6. drawing upwards (see FIG. 9)
Assuming that a textured 3D model exists on the wall surface, the textured 3D model needs to be rendered upward. Assuming that the 3D model of the wall surface is node _ wall _1, that is, the node coordinate of the lower left corner of the rectangle of the 3D model of node _ wall _1 is recorded as wall _ node _ LD (-5, 0, 0) and the node coordinate of the upper right corner is recorded as wall _ node _ RT (5, 4, 0); suppose that the texture 3D model is texture _ src, i.e., the node coordinates of the lower left corner of the rectangle of the texture _ src 3D model are registered as texture _ node _ LD (0, 1, 0) and the node coordinates of the upper right corner are registered as texture _ node _ RT (4, 3, 0); let the coordinates of each node nodes _ dst of the target rendering area, i.e. the four nodes of the rectangle of the nodes _ dst, be: recording the coordinates of the nodes at the upper left corner as dst _ node _ LT, the coordinates of the nodes at the lower left corner as dst _ node _ LD, the coordinates of the nodes at the upper right corner as dst _ node _ RT, and the coordinates of the nodes at the lower right corner as dst _ node _ RD; the specific coordinates of each node in the target drawing area are as follows: dst _ node _ LT (0, 4, 0), dst _ node _ LD (0, 1, 0), dst _ node _ RT (4, 4, 0), dst _ node _ RD (4, 1, 0);
1) spread upward
Assuming that the size of the horizontal translation for the texture is tx and the size of the vertical translation for the texture is ty; transmitting the texture 3D model information, the coordinates of each node _ dst of the target drawing area, the size tx of horizontal translation of the texture and the size ty of vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
2) is stretched upwards
And forming a target rectangular field to be drawn according to the four nodes of the nodes _ dst, and finally drawing the texture pattern texture _ src in a filling manner on the whole rectangular field Rec _ dst _ pain by assuming that the target rectangular field is Rec _ dst _ pain.
7. Drawn downwards (see fig. 10)
Assuming that a textured 3D model exists on the wall surface, the textured 3D model needs to be rendered vertically. Assuming that the 3D model of the wall surface is node _ wall _1, that is, the node coordinate of the lower left corner of the rectangle of the 3D model of node _ wall _1 is recorded as wall _ node _ LD (-5, 0, 0) and the node coordinate of the upper right corner is recorded as wall _ node _ RT (5, 4, 0); suppose that the texture 3D model is texture _ src, i.e., the node coordinates of the lower left corner of the rectangle of the texture _ src 3D model are registered as texture _ node _ LD (0, 1, 0) and the node coordinates of the upper right corner are registered as texture _ node _ RT (4, 3, 0); let the coordinates of each node nodes _ dst of the target rendering area, i.e. the four nodes of the rectangle of the nodes _ dst, be: recording the coordinates of the nodes at the upper left corner as dst _ node _ LT, the coordinates of the nodes at the lower left corner as dst _ node _ LD, the coordinates of the nodes at the upper right corner as dst _ node _ RT, and the coordinates of the nodes at the lower right corner as dst _ node _ RD; the specific coordinates of each node in the target drawing area are as follows: dst _ node _ LT (0, 3, 0), dst _ node _ LD (0, 0, 0), dst _ node _ RT (4, 3, 0), dst _ node _ RD (4, 0, 0);
1) spread downwards
Assuming that the size of the horizontal translation for the texture is tx and the size of the vertical translation for the texture is ty; transmitting the texture 3D model information, the coordinates of each node _ dst of the target drawing area, the size tx of horizontal translation of the texture and the size ty of vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
2) is stretched downwards
And forming a target rectangular field to be drawn according to the four nodes of the nodes _ dst, and finally drawing the texture pattern texture _ src in a filling manner on the whole rectangular field Rec _ dst _ pain by assuming that the target rectangular field is Rec _ dst _ pain.
8. Drawing of whole house
1) And (5) paving the whole house.
Acquiring the node coordinates of the 3D model of each wall surface one by one from node _ wall _ group, will perform: the whole wall in the whole wall drawing is tiled;
2) and (5) stretching the whole house.
Acquiring the node coordinates of the 3D model of each wall surface one by one from node _ wall _ group, will perform: and stretching the whole wall in the whole wall drawing.
Tiled drawing
Because the tiled drawing has common drawing characteristics, the tiled drawing is merged into tiled drawing submodules for uniform description. The specific technical scheme of the tiled drawing is as follows:
first step, transmitting required data: coordinates of each node and a texture pattern of the texture 3D model, each node of a target drawing area, and the size of horizontal translation and the size of vertical translation;
1) assuming that the texture pattern is texture _ src, assuming that the width of the texture pattern texture _ src is bmpWidth, and assuming that the height of the texture pattern texture _ src is bmpHeight;
2) the nodes of the texture 3D model comprise 4 nodes and form a rectangular domain, and the rectangular domain of the texture is assumed to be Rect _ texture _ pain; assume that the rectangular fields are the size of Rect _ texture _ picture length and width, respectively: texture _ line _ L and texture _ line _ W;
3) the nodes of the target drawing area also comprise 4 nodes and form a rectangular domain, and the rectangular domain of the target drawing area is assumed to be Rect _ dst _ pain; assuming that the rectangular field is the length and width dimensions of Rect _ dst _ pain respectively: dst _ line _ L and dst _ line _ W;
4) let the size of the horizontal translation be tx and let the size of the vertical translation be ty;
and secondly, the horizontal translation size dst _ tx in the target drawing area is texture _ line _ W _ tx/bmpWidth, the vertical translation size dst _ tx in the target drawing area is texture _ line _ L _ ty/bmpHeight, and then the rectangular domain Rect _ dst _ page of the target drawing area is tiled by using texture patterns as texture _ src according to dst _ tx and dst _ ty until the rectangular domain Rect _ dst _ page is fully tiled.
The present invention and its embodiments have been described above schematically, without limitation, and what is shown in the drawings is only one of the embodiments of the present invention, and the actual structure is not limited thereto. Therefore, if the person skilled in the art receives the teaching, without departing from the spirit of the invention, the person skilled in the art shall not inventively design the similar structural modes and embodiments to the technical solution, but shall fall within the scope of the invention.

Claims (8)

1. A wall texture drawing system is characterized in that: the device comprises a wall surface 3D model establishing module, a texture 3D model redrawing module and a wall surface texture drawing module;
the wall surface 3D model creating module records and stores three-dimensional coordinate information of a wall surface and transmits the information to the wall surface texture drawing module;
the texture 3D model creating module records and stores three-dimensional coordinate information and texture patterns of textures and transmits the three-dimensional coordinate information and the texture patterns to the texture 3D model redrawing module;
the texture 3D model redrawing module comprises two instructions of rotation and zooming, redraws the received three-dimensional coordinate information and texture patterns, and transmits the redrawed textures to the wall texture drawing module;
the wall texture drawing module comprises a plurality of wall surface drawing instructions, acquires three-dimensional coordinate information of the wall surface from the wall surface 3D model creating module, acquires redrawn textures and three-dimensional coordinate information of the textures from the texture 3D model redrawing module, and draws the textures of the wall surface according to the appointed wall surface drawing instructions.
2. The wall texture drawing system according to claim 1, wherein: the wall texture drawing module is internally provided with a tiling drawing submodule to finish tiling drawing operation in various wall drawing instructions.
3. The wall texture drawing system according to claim 2, wherein: the wall surface is generally rectangular, the 3D model creating module of the wall surface records and stores three-dimensional coordinates of four nodes, and for the wall body with the irregular shape, the smallest rectangle capable of accommodating the irregular shape is taken, and the four nodes of the rectangle are recorded.
4. A wall texture drawing system according to claim 3, wherein: the wall texture drawing module comprises the following instructions: whole wall tiling, horizontal tiling, left tiling, right tiling, vertical tiling, upward tiling, downward tiling, full house tiling, whole wall stretching, horizontal stretching, left stretching, right stretching, vertical stretching, upward stretching, downward stretching, full house stretching.
5. A method for texture rendering using the texture rendering system of claim 4, comprising the steps of:
initializing wall 3D model information, recording three-dimensional coordinates of four nodes of a 3D model of a wall by a wall 3D model creation module, forming a multi-surface wall in a room, recording the three-dimensional coordinates of each node of the multi-surface wall 3D model as a wall 3D model group, namely a node _ wall _ group, and transmitting the three-dimensional coordinates of the nodes contained in the node _ wall _ group to a wall texture drawing module;
initializing texture 3D model information, recording three-dimensional coordinates and texture patterns of four nodes of the texture 3D model by a texture 3D model creating module, and transmitting the three-dimensional coordinates and the texture patterns of the nodes contained in the texture model to a texture 3D model redrawing module;
step three, redrawing the texture, and when zooming, respectively sending two redrawing instructions to the texture 3D model redrawing module: scaling the texture width and scaling the texture length; when rotating, appointing a corresponding rotating angle; if no redrawing instruction is executed, transmitting the three-dimensional coordinates and the texture patterns of the nodes contained in the original texture 3D model to a wall texture drawing module;
and fourthly, drawing the wall texture, wherein the wall texture drawing module receives wall 3D model group information, namely node _ wall _ group, from the wall 3D model creating module, receives texture 3D model information from the texture 3D model redrawing module, and draws the texture of the wall according to different wall drawing instructions.
6. The wall texture drawing method according to claim 5, characterized in that: and (5) zooming and rotating in the third step to keep the coordinates of the central point of the model unchanged, and finally obtaining the three-dimensional coordinates of the four nodes of the texture after redrawing.
7. The wall texture drawing method according to claim 6, characterized in that: in the fourth step, various tiled drawing instructions in different wall drawing instructions have the same drawing characteristics, as follows:
firstly, acquiring coordinates of each node and a texture pattern of a texture 3D model, each node of a target drawing area, and the size of horizontal translation and the size of vertical translation;
1) assuming that the texture pattern is texture _ src, the width of the texture pattern texture _ src is bmpWidth, and the height of the texture pattern texture _ src is bmpHeight;
2) the nodes of the texture 3D model include 4 nodes and form a rectangular field, and it is assumed that the texture rectangular field is a rec _ texture _ picture, and the length and width of the rectangular field rec _ texture _ picture are respectively: texture _ line _ L and texture _ line _ W;
3) the nodes of the target rendering area also include 4 nodes, and form a rectangular domain, and it is assumed that the target rendering area rectangular domain is Rect _ dst _ pain, and the length and width of the rectangular domain Rect _ dst _ pain are respectively: dst _ line _ L and dst _ line _ W;
4) assuming that the size of the horizontal translation is tx and the size of the vertical translation is ty;
and secondly, the horizontal translation size dst _ tx in the target rendering area is texture _ line _ W _ tx/bmpWidth, the vertical translation size dst _ ty in the target rendering area is texture _ line _ L _ ty/bmpHeight, and the rectangular domain Rect _ dst _ page of the target rendering area is tiled by using texture patterns as texture _ src according to dst _ tx and dst _ ty until the rectangular domain Rect _ dst _ page is tiled.
8. The wall texture drawing method according to claim 7, characterized in that: the specific drawing mode in the fourth step is as follows: acquiring a 3D model node _ wall _1 of a wall surface to be drawn from a node _ wall _ group, wherein the coordinates of four nodes of the wall surface are wall _ nodes, and the specific coordinates of a corresponding target drawing domain and a rectangular domain constructed by the coordinates of the four nodes are obtained according to an instruction and are the target rectangular domain Rect _ dst _ pain to be drawn;
when tiling is performed, the size of horizontal translation of the texture is assumed to be tx, and the size of vertical translation of the texture is assumed to be ty; transmitting the texture 3D model information, the coordinates wall _ nodes of the wall 3D model, the size tx of the horizontal translation of the texture and the size ty of the vertical translation of the texture to a tiled drawing submodule together, and finishing the drawing of the texture by the tiled drawing submodule;
when stretching is performed, the texture pattern texture _ src is drawn in a full manner to the entire target rectangular field Rect _ dst _ pain.
CN202010309644.4A 2020-04-20 2020-04-20 Wall surface texture drawing system and method Active CN111640182B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010309644.4A CN111640182B (en) 2020-04-20 2020-04-20 Wall surface texture drawing system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010309644.4A CN111640182B (en) 2020-04-20 2020-04-20 Wall surface texture drawing system and method

Publications (2)

Publication Number Publication Date
CN111640182A true CN111640182A (en) 2020-09-08
CN111640182B CN111640182B (en) 2023-04-07

Family

ID=72331711

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010309644.4A Active CN111640182B (en) 2020-04-20 2020-04-20 Wall surface texture drawing system and method

Country Status (1)

Country Link
CN (1) CN111640182B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002019273A2 (en) * 2000-08-29 2002-03-07 Harris Corporation Texture mapping system used for creating three-dimensional urban models
US20100290712A1 (en) * 2009-05-13 2010-11-18 Seiko Epson Corporation Image processing method and image processing apparatus
CN102117491A (en) * 2009-12-30 2011-07-06 新奥特(北京)视频技术有限公司 Texture data drawing method and device in three-dimensional modeling
CN106959808A (en) * 2017-03-29 2017-07-18 王征 A kind of system and method based on gesture control 3D models
CN107154076A (en) * 2017-06-02 2017-09-12 王征 It is a kind of can dynamic self-defined 3D moulded dimensions system and method
CN107274493A (en) * 2017-06-28 2017-10-20 河海大学常州校区 A kind of three-dimensional examination hair style facial reconstruction method based on mobile platform
CN108053474A (en) * 2017-12-29 2018-05-18 湖南城市学院 A kind of new city three-dimensional modeling control system and method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002019273A2 (en) * 2000-08-29 2002-03-07 Harris Corporation Texture mapping system used for creating three-dimensional urban models
US20100290712A1 (en) * 2009-05-13 2010-11-18 Seiko Epson Corporation Image processing method and image processing apparatus
CN102117491A (en) * 2009-12-30 2011-07-06 新奥特(北京)视频技术有限公司 Texture data drawing method and device in three-dimensional modeling
CN106959808A (en) * 2017-03-29 2017-07-18 王征 A kind of system and method based on gesture control 3D models
CN107154076A (en) * 2017-06-02 2017-09-12 王征 It is a kind of can dynamic self-defined 3D moulded dimensions system and method
CN107274493A (en) * 2017-06-28 2017-10-20 河海大学常州校区 A kind of three-dimensional examination hair style facial reconstruction method based on mobile platform
CN108053474A (en) * 2017-12-29 2018-05-18 湖南城市学院 A kind of new city three-dimensional modeling control system and method

Also Published As

Publication number Publication date
CN111640182B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN111247561B (en) Method for reconstructing three-dimensional space scene based on photographing
CN103810744B (en) It is backfilled a little in cloud
US9282321B2 (en) 3D model multi-reviewer system
US20140125654A1 (en) Modeling and Editing Image Panoramas
CN107330978B (en) Augmented reality modeling experience system and method based on position mapping
CN101303772A (en) Method for modeling non-linear three-dimensional human face based on single sheet image
KR20150124112A (en) Method for Adaptive LOD Rendering in 3-D Terrain Visualization System
WO2023207963A1 (en) Image processing method and apparatus, electronic device, and storage medium
Curless et al. 3D Photography
CN109242966A (en) A kind of 3D panorama model modeling method based on laser point cloud data
CN107610213A (en) A kind of three-dimensional modeling method and system based on panorama camera
Sandnes Sketching 3D immersed experiences rapidly by hand through 2D cross sections
CN204695673U (en) A kind of for the three-dimensional digital sand table in urban planning and construction
CN103295258A (en) Novel multifunctional atmospheric science data graphic rendering engine
CN111640182B (en) Wall surface texture drawing system and method
CN101511034A (en) Truly three-dimensional stereo display method facing Skyline
Wang et al. Research and design of digital museum based on virtual reality
KR102662058B1 (en) An apparatus and method for generating 3 dimension spatial modeling data using a plurality of 2 dimension images acquired at different locations, and a program therefor
US7064767B2 (en) Image solution processing method, processing apparatus, and program
CN109829963A (en) A kind of image drawing method and device calculate equipment and storage medium
Chen et al. An integrated image and sketching environment for archaeological sites
CN104463784B (en) A kind of Zoom method of 2.5D models
CN106846472A (en) A kind of method and device that photomap is generated based on panoramic table
JP7518196B2 (en) Method, apparatus and program for constructing 3D geometry
KR20190056694A (en) Virtual exhibition space providing method using 2.5 dimensional object tagged with digital drawing element

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