CN106971423A - Method for drafting, device, equipment and the storage medium of cube figure - Google Patents

Method for drafting, device, equipment and the storage medium of cube figure Download PDF

Info

Publication number
CN106971423A
CN106971423A CN201710330073.0A CN201710330073A CN106971423A CN 106971423 A CN106971423 A CN 106971423A CN 201710330073 A CN201710330073 A CN 201710330073A CN 106971423 A CN106971423 A CN 106971423A
Authority
CN
China
Prior art keywords
coordinate
value
summit
cube
coordinate value
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
CN201710330073.0A
Other languages
Chinese (zh)
Other versions
CN106971423B (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.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics 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 Guangzhou Shiyuan Electronics Thecnology Co Ltd, Guangzhou Shirui Electronics Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201710330073.0A priority Critical patent/CN106971423B/en
Publication of CN106971423A publication Critical patent/CN106971423A/en
Application granted granted Critical
Publication of CN106971423B publication Critical patent/CN106971423B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means

Landscapes

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

Abstract

The invention discloses the method for drafting of cube figure, device, equipment and storage medium.This method includes:Obtain the first coordinate value that cursor graphical pointv in painting canvas forms the first graphical pointv;Corresponding present coordinate values when monitoring and obtaining the movement of cursor graphical pointv;According to the first coordinate value, present coordinate values and default standard reference information, it is determined that the absorption coordinate value of adsorption site needed for drawing the cube to be drawn;Determine that the first graphical pointv and adsorption site, to wait to draw cubical summit, according to absorption coordinate value and the first coordinate value, determine the coordinate value on remaining each summit and highlighted, the cube to be drawn is formed to connect each summit.Utilize this method, the coordinate value of key point needed for drawing cube can be determined in painting canvas, and determined to constitute the coordinate on cubical each summit according to key point, cubical accurate drafting is simply and easily realized, the Consumer's Experience of painting function in electronic whiteboard is thus preferably enhanced.

Description

Method for drafting, device, equipment and the storage medium of cube figure
Technical field
The present invention relates to electronic whiteboard technology field, more particularly to the method for drafting of cube figure, device, equipment and deposit Storage media.
Background technology
With the development of electronic technology, more and more electronic equipments with interactive function appear in the study of people, work Make and life in, electronic whiteboard is exactly common a kind of interactive function software in electronic equipment, with writing, annotation, paint with And the interactive function such as multimedia recreation.
When user paints on electronic whiteboard, if the geometric figure of two dimension, user can also show according on painting canvas Scale determine needed for dimension of picture, however, when carrying out three-dimensional cube of volume drawing, user is difficult to draw out one in painting canvas Individual length and width and high equal standard cube, thus significantly impact the usage experience of user.
The content of the invention
The embodiments of the invention provide the method for drafting of cube figure, device, equipment and storage medium, use can solve the problem that Family can not in electronic whiteboard the cubical problem of Fast Drawing.
On the one hand, the embodiments of the invention provide a kind of method for drafting of cube figure, including:
Obtain the first coordinate value that cursor graphical pointv in painting canvas forms the first graphical pointv;
Monitor and obtain corresponding present coordinate values when the cursor graphical pointv is moved in the painting canvas;
According to first coordinate value, present coordinate values and default standard reference information, it is determined that waiting to paint described in drawing The absorption coordinate value of adsorption site needed for cube processed;
Determine that first graphical pointv and adsorption site are waited to draw cubical summit to be described, and according to the absorption coordinate Value and the first coordinate value, it is determined that the coordinate value on remaining each summit of cube to be drawn and highlighting, to connect each top Point forms the cube to be drawn.
On the other hand, the embodiments of the invention provide a kind of drawing apparatus of cube figure, including:
First coordinate obtaining module, forms the first coordinate of the first graphical pointv for obtaining cursor graphical pointv in painting canvas Value;
Moving coordinate acquisition module, it is corresponding when the cursor graphical pointv is moved in the painting canvas for monitoring and obtaining Present coordinate values;
Coordinate obtaining module is adsorbed, for according to first coordinate value, present coordinate values and default canonical reference Information, it is determined that the absorption coordinate value of adsorption site needed for drawing the cube to be drawn;
Graphic plotting module, for determining that first graphical pointv and adsorption site are waited to draw cubical summit to be described, And according to the absorption coordinate value and the first coordinate value, it is determined that the coordinate value on remaining each summit of cube to be drawn and dashing forward Go out display, the cube to be drawn is formed to connect each summit.
Another aspect, the embodiments of the invention provide a kind of electronic equipment, including:
One or more processors;
Storage device, for storing one or more programs;
One or more of programs are by one or more of computing devices so that one or more of processors Realize the method for drafting of cube figure provided in an embodiment of the present invention.
Another further aspect, the embodiments of the invention provide a kind of computer-readable recording medium, is stored thereon with computer journey Sequence, the program realizes the method for drafting of cube figure provided in an embodiment of the present invention when being executed by processor.
In method for drafting, device, equipment and the storage medium of above-mentioned cube figure, cursor in painting canvas is obtained first and is painted First coordinate value of the first formed graphical pointv of system point;When then monitoring and obtaining mobile in painting canvas of cursor graphical pointv pair The present coordinate values answered;Determine that drafting is treated according to the first coordinate value, present coordinate values and default standard reference information afterwards The absorption coordinate value of adsorption site needed for drawing cube;It is final to determine the first graphical pointv and adsorption site to wait to draw cubical top Point, and the coordinate value on each summit of remaining in cube to be drawn is determined according to absorption coordinate value and the first coordinate value, with connection Each summit forms cube to be drawn.Method for drafting, device, equipment and the storage medium of above-mentioned cube figure, can draw Determine the coordinate value of crucial adsorption site needed for drawing cube in cloth, and according to crucial adsorption site determine to constitute it is cubical other The coordinate on summit, simply and easily realizes cubical drafting, thus preferably enhances painting function in electronic whiteboard Consumer's Experience.
Brief description of the drawings
Fig. 1 is a kind of schematic flow sheet of the method for drafting for cube figure that the embodiment of the present invention one is provided;
Fig. 2 a are a kind of schematic flow sheet of the method for drafting for cube figure that the embodiment of the present invention two is provided;
Fig. 2 b are the concrete operations flow chart of progress standard reference information determination in the embodiment of the present invention two;
Perspective view of the standard cube model in painting canvas when Fig. 2 c determine for progress standard reference information;
Fig. 2 d are the concrete operations flow chart of progress absorption coordinate value determination in the embodiment of the present invention two;
Fig. 2 e adsorb effect displaying figure when coordinate value is determined for progress first;
Fig. 2 f adsorb effect displaying figure when coordinate value is determined for progress second;
Fig. 2 g be according to the absorption coordinate value of adsorption site determination wait draw cubical exemplary plot;
Fig. 3 is a kind of structured flowchart of the drawing apparatus for cube figure that the embodiment of the present invention three is provided;
Fig. 4 is the hardware architecture diagram for a kind of electronic equipment that the embodiment of the present invention four is provided.
Embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention, rather than limitation of the invention.It also should be noted that, in order to just Part related to the present invention rather than entire infrastructure are illustrate only in description, accompanying drawing.
Embodiment one
Fig. 1 is a kind of schematic flow sheet of the method for drafting for cube figure that the embodiment of the present invention one is provided, this method Situation suitable for carrying out cube volume drawing electronic whiteboard, this method can be performed by the drawing apparatus of cube figure, Wherein the device can be realized by software and/or hardware, and may generally serve as the plug-in unit of electronic whiteboard with electronic equipment On.
In the present embodiment, the electronic equipment can be specifically that the mobile terminals such as mobile phone, tablet personal computer, notebook are set The fixed terminal devices with interactive function such as standby or desktop computer, intelligent tutoring blank.The present embodiment is excellent Choosing set its application scenarios as carried out under the interactive function of electronic whiteboard in the painting canvas of painting function module carry out cube Volume drawing, now based on the method for drafting that provides of the present invention, draftings length, width and height that painter can be allowed simple and quick are isometric to be stood Cube.
As shown in figure 1, a kind of method for drafting for cube figure that the embodiment of the present invention one is provided, including following operation:
Cursor graphical pointv forms the first coordinate value of the first graphical pointv in S101, acquisition painting canvas.
In the present embodiment, the painting canvas can specifically refer to carries out being shown on device screen during drawing operation in electronic whiteboard Operation interface.Usually, user can also pass through in painting canvas by finger or screen touch pen progress touch screen drawing in painting canvas Operation to mouse is painted, wherein, the cursor graphical pointv specifically can be regarded as responding touch screen or mouse action The drafting mark in painting canvas is shown in afterwards.
Specifically, user can click on mouse in the arbitrary region of painting canvas or click screen, and this step can be above-mentioned in response Cursor graphical pointv is triggered after operation the first graphical pointv is formed in painting canvas, and screen coordinate of first graphical pointv in equipment can be obtained Fasten corresponding pixel coordinate value, it is to be understood that the present embodiment is given tacit consent to the coordinate system residing for the painting canvas and drawn with first Point is origin, and its transverse and longitudinal coordinate axle having can be put down by the pixel coordinate value of the first graphical pointv to above-mentioned screen coordinate system Move and obtain, therefore, first coordinate value of first graphical pointv in coordinate system residing for painting canvas can be regarded as (0,0) in the present embodiment.
S102, monitor and obtain corresponding present coordinate values when the cursor graphical pointv is moved in the painting canvas.
It is understood that in painting process, can be slided by touch of the user to the dragging of mouse or on screen Move to trigger the movement of the cursor graphical pointv in painting canvas, this step can monitor the moving operation of cursor graphical pointv in the painting canvas, And cursor graphical pointv corresponding current pixel coordinate value in screen coordinate system can be obtained in real time, thus, according to above-mentioned current picture The pixel coordinate value of plain coordinate value and the first graphical pointv, can determine that cursor graphical pointv is right in coordinate system residing for painting canvas in real time The present coordinate values answered.
S103, according to above-mentioned first coordinate value, present coordinate values and default standard reference information, it is determined that drawing described The absorption coordinate value of adsorption site needed for cube to be drawn.
In the present embodiment, first coordinate value can specifically refer to above-mentioned first graphical pointv and have in coordinate system residing for painting canvas Some coordinate values (being typically designated as (0,0));The present coordinate values can specifically refer to current in painting canvas institute during the movement of cursor graphical pointv Have in place's coordinate system coordinate value (generally can according to current pixel coordinate value of the cursor graphical pointv in screen coordinate system and The pixel coordinate value of first graphical pointv is determined).
In addition, the standard reference information can specifically refer to and set in advance be used for the ginseng that adsorption site is determined during cube volume drawing Examine information.Specifically, projection coordinate is worth after the standard reference information can be projected according to standard square body Model into painting canvas It is determined that, wherein, the standard reference information can include a line and painting canvas in painting canvas as standard square body Model top surface Place axis of abscissas forms the angle value of angle, the angle value of angle is formed as two adjacent sides of standard square body top surface And corresponding transformation matrices the etc. during projection of standard square body Model, for adsorption site needed for follow-up drafting cube really It is fixed.
Usually, in progress cube volume drawing, it is necessary to ensure that drawn cubical long side, broadside and flash have Equal length value, when being painted in existing electronic whiteboard, user can not directly determine to ensure the top that cube length, width and height are equal Point, thus present embodiments provides cubical method for drafting, using by determining adsorption site as waiting to draw cubical summit, There is identical length to ensure to wait to draw cubical long side, broadside and flash.
Exemplarily, the operation for carrying out adsorption site determination can be described as:First using the first graphical pointv as wait draw cube The first summit on body top surface, while using mobile cursor graphical pointv as the second summit on cube top surface to be drawn, and Opposite vertexes of first summit with the second summit to constitute top surface can be set, now can determine that the first summit is fixing point, the second top Point is transfer point, is corresponded to when getting the movement of the second summit after present coordinate values, can be according to first coordinate on the first summit Value, the present coordinate values and standard reference information on the second summit, it is determined that constituting two other top of cube top surface to be drawn The present coordinate values of point;Cube to be drawn can be obtained according to the present coordinate values on the first summit and its excess-three summit afterwards Long side and broadside current length value, then may be assumed that the current length value of long side and broadside is equal, thus can determine that long side With the broadside ideal coordinates value that second summit should have when equal, this step using the ideal coordinates value as absorption coordinate value, Using its corresponding coordinate points as adsorption site, thus the second apex suction can be fixed on the corresponding position of the adsorption site.
It is understood that an adsorption site can be determined by aforesaid operations, it can only be protected according to identified adsorption site Demonstrate,prove and treat that the cubical long side of drafting and broadside are equal, it is impossible to ensure that flash is equal to long side and broadside, it is therefore desirable to it is determined that waiting to paint Next adsorption site needed for cube processed.
Exemplarily, determining the operation of next adsorption site can be expressed as:It is corresponding the second summit is fixed into adsorption site Behind position, the movement of cursor graphical pointv, and present coordinate values when determining to move in painting canvas are once again listened for;Then by the second top The line of point and cursor graphical pointv, which is regarded as, to be waited to draw cubical flash, according to the absorption coordinate value and light of the second vertex correspondence The present coordinate values of graphical pointv are marked, the current length value of flash is determined, the current length value and above-mentioned length of flash are may be assumed that afterwards The length value of side or broadside is equal, thus can determine that the ideal that flash time mark graphical pointv equal with long side or broadside should have Coordinate value, this step can using the ideal coordinates value as next adsorption site absorption coordinate value, while cursor graphical pointv can be inhaled It is attached to be fixed on the corresponding position of next adsorption site.
By aforesaid operations, the absorption coordinate value for drawing at least two adsorption sites needed for cube is finally determined.This Embodiment subsequent operation as waiting to draw cubical summit, thereby guarantees that the adsorption site of above-mentioned determination drawn cubical Length, width and height are equal.
S104, determine the first graphical pointv and adsorption site to wait to draw cubical summit, and according to absorption coordinate value and First coordinate value, it is determined that the coordinate value on remaining each summit of cube to be drawn and highlight, is formed with to connect each summit and waits to paint Cube processed.
In the present embodiment, first can be using first graphical pointv and identified adsorption site as waiting to draw cube The fixed vertices of body, afterwards, can be according to the above-mentioned coordinate value for having determined that the first graphical pointv and adsorption site, with reference to default standard Reference information determines the coordinate value on wherein each summit of cube to be drawn, and can highlight, and finally, connection is highlighted Each summit, so as to form the equal cube of length, width and height in painting canvas.
A kind of method for drafting for cube figure that the embodiment of the present invention one is provided, can be according to acquired first graphical pointv The first coordinate value, the present coordinate values and the default canonical reference for cube volume drawing of monitoring cursor graphical pointv believe Breath, determines to draw the adsorption site needed for cube in painting canvas, finally according to the adsorption site coordinate value and the first graphical pointv of determination The first coordinate value determine the coordinate value of each vertex correspondence in cube, cubical drafting is realized in painting canvas.Utilize the party Method, cubical drafting can be simply and easily realized in the painting canvas of electronic whiteboard, electronic whiteboard is thus preferably enhanced The Consumer's Experience of middle painting function.
Embodiment two
Fig. 2 a are a kind of schematic flow sheet of the method for drafting for cube figure that the embodiment of the present invention two is provided.The present invention Embodiment is optimized based on above-described embodiment, in the present embodiment, and optimization is added:Standard square body Model is projected Into the painting canvas, projection coordinate value of each summit in the painting canvas in the standard square body Model is obtained;According to each top Projection coordinate value of the point in the painting canvas, determines standard reference information of the standard square body Model in the painting canvas.
As shown in Figure 2 a, a kind of method for drafting for cube figure that the embodiment of the present invention two is provided, is specifically included as follows Operation:
It is understood that the present embodiment adds S201 and S202 on the basis of above-described embodiment, and then realize The determination of standard reference information.
S201, standard square body Model projected in painting canvas, obtain in standard square body Model each summit in painting canvas Projection coordinate value.
In the present embodiment, projection process can be carried out to standard square body Model first, obtain standard square body Model and exist Projection information in painting canvas, the determination of adsorption site during for follow-up cube of volume drawing.It should be noted that the present embodiment is adopted Standard square body Model can be built by constructor, and there is the standard square body Model constructed corresponding space to sit Mark information.The spatial coordinated information and the projective transformation matrix of selection that this step can have according to standard square body Model are real Projection of the existing standard square body Model to two-dimentional painting canvas;The projection in electronic device system function storehouse can also be directly invoked Required function set realizes the projection of standard square body Model.
Further, the present embodiment projects to standard square body Model in the painting canvas by described, obtains the standard Projection coordinate value of each summit in the painting canvas, is specifically optimized in square body Model:Called in the three-dimensional scenic of structure Default virtual perspective camera, is carried out according to the virtual perspective camera in the painting canvas to the standard square body Model of setting Projection;The projection coordinate of setting is called to determine function, according to the spatial value on each summit of standard square body Model, it is determined that Projection coordinate value of each summit in the painting canvas.
In this embodiment, it is preferred that realizing standard square body mould using the projection function set in operating system function library Type is to the projection of painting canvas, and it can be described as the detailed process of standard cube model projection to painting canvas:Three dimensional field is called first The constructor of scape builds a three-dimensional scenic;Then default virtual camera is added in the three-dimensional scenic, wherein, the void It is preferably virtual perspective camera to intend camera;Square constructor is called to build a rib a length of 1 in three-dimensional scenic afterwards Standard square body Model, the standard square body Model of structure projected into two dimension eventually through the virtual perspective camera of addition flat On face, and projection coordinate can be called to determine that function obtains standard square body mould according to the spatial coordinated information of standard square body Model Each summit of type corresponding projection coordinate's value on two dimensional surface.
S202, projection coordinate's value according to each summit in painting canvas, determine standard of the standard square body Model in painting canvas Reference information.
In the present embodiment, it can be worth according to projection coordinate of each summit in painting canvas, connection forms one in painting canvas The standard square body of plane.Further, the determination operation of standard reference information described in this step can be by shown in Fig. 2 b Operating procedure realize, wherein, Fig. 2 b be the embodiment of the present invention two in carry out standard reference information determination concrete operations flow Figure, meanwhile, perspective view of the standard cube model in painting canvas when Fig. 2 c determine for progress standard reference information.Such as Fig. 2 b Shown, carrying out the concrete operation step of standard reference information determination includes:
S2021, will in painting canvas represent standard square body Model top surface summit be designated as the first summit SP1, the second summit SP2, the 3rd summit SP3 and the 4th summit SP4, and the bottom surface summit relative with the SP2 is designated as the 6th summit SP6.
Exemplarily, as shown in Figure 2 c, painting canvas 20 be in screen coordinate system XOY in, the midpoint SP1 of painting canvas 20, point SP2, Point SP3 and point SP4 constitute the top surface of standard square body Model, while can determine that point SP1 and point SP2 is pair in top surface Summit;In addition, according to Fig. 2 c, the midpoint SP5 of painting canvas 20, point SP6, point SP7 and point SP8 respectively with point SP1, point SP2, Point SP3 and point SP4 is relative, and constitutes the bottom surface of standard square body Model.
S2022, by SP1 and SP3 formation side be designated as broadside SH1, by SP3 and SP2 formation while for it is long while SH2, and The side of SP2 and SP6 formation is designated as flash SH3.
Exemplarily, as shown in Figure 2 c, the point SP1 and point SP3 broadside SH1 for constituting standard square body Model, The point SP2 and point SP3 long side SH2 for constituting standard square body Model, meanwhile, point SP2 and point SP6's constitutes The broadside SH3 of standard square body Model.
S2023, according to SP1, SP2, SP3, SP4 and SP6 projection coordinate be worth, determine described SH1, SH2 and SH3 Length value, and determine that SH1 and SH2 forms the first angle value and the SH2 of angle and axis of abscissas institute shape where painting canvas Into the second angle value of angle.
Exemplarily, for ease of the expression of standard reference information, as shown in Figure 2 c, the present embodiment is using point SP1 as origin structure The xoy coordinate systems parallel to screen coordinate system XOY have been built, it is necessary to which projection coordinate's value of each point is in explanation, the present embodiment Xoy coordinate systems, thus the present embodiment can according to the projection coordinate of each point be worth determine SH1, SH2 and SH3 length value, simultaneously It can determine that above-mentioned each side is vectorial in xoy coordinate systems, such as, it may be determined that point SP1 and point SP3 vectorial V1, point SP3 and point SP2 Vectorial V2, and point SP1 and point SP4 vectorial V3, the vector at point SP1 and xoy coordinate systems midpoint (1,0) is V4.
In addition, as shown in Figure 2 c, it may be determined that it is β, SH2 and the place axis of abscissas institute of painting canvas 20 that SH1 and SH2, which forms angle, The angle of formation is designated as ɑ equivalent to the angle that x-axis in SH2 and xoy coordinate systems is formed.Specifically, the present embodiment can basis Vector product formula determines angle β the first angle value and angle ɑ the second angle value, connects above-mentioned example, it may be determined that the first of β Angle value be β=arccos (V1V2/ | V1 | | V2 |);And can determine that ɑ the second angle value for ɑ=arccos (V4V3/ |V4||V3|)。
S2024, the coordinate system for being presently in painting canvas are as the first coordinate system, and by the seat using SH2 as axis of abscissas Mark system regards the second coordinate system as.
Exemplarily, as shown in Figure 2 c, the coordinate system being presently in due to painting canvas 20 is xoy coordinate systems, therefore xoy coordinates System can be designated as the first coordinate system, while as can be seen that axis of abscissas in x`oy` coordinate systems is SH2, thus x`oy` coordinate systems The second coordinate system can be designated as.
S2025, according to the first angle value and the second angle value, determine the first coordinate system transformation be the second coordinate system when correspondence The first transformation matrix Mo, and the second coordinate system transformation be the first coordinate system when corresponding second transformation matrix Mo`.
Exemplarily, as shown in Figure 2 c, xoy coordinates are tied to the conversion of x`oy` coordinate systems, equivalent to xoy coordinate system up times Pin have rotated angle ɑ and be transformed to x`oy` coordinate systems, in the present embodiment, according to coordinate transform rule and conversion angle ɑ correspondences The second angle value, it may be determined that its corresponding transformation matrix Mo is represented by:It is designated as One transformation matrix;Meanwhile, x`oy` coordinates are tied to the conversion of xoy coordinate systems, the folder equivalent to x`oy` coordinate system rotate counterclockwises Angle ɑ is transformed to xoy, according to coordinate transform rule and the corresponding second angle values of conversion angle ɑ, it may be determined that its corresponding conversion Matrix Mo` is represented by:It is designated as the second transformation matrix.
S2026, it regard the first angle value, Mo and Mo` and described SH1, SH2 and SH3 length value as default mark Quasi- reference information.
In the present embodiment, SH1 and SH2 can be formed to angle β the first angle value, the first transformation matrix Mo, second Transformation matrix Mo` regards standard reference information as, while also regarding broadside SH1, long side SH2 and flash SH3 as canonical reference letter Breath, so that subsequent operation is used.
Cursor graphical pointv forms the first coordinate value of the first graphical pointv in S203, acquisition painting canvas.
Exemplarily, user's click mouse triggering cursor graphical pointv can be responded the first drafting is formed in the painting canvas Point, and the first coordinate system residing for the painting canvas can be built by origin of first graphical pointv, thus, described first draws First coordinate value of point can regard (0,0) as, it is to be understood that first coordinate system can be by screen coordinate system according to described Pixel coordinate value translation of first graphical pointv in screen coordinate system is obtained.
S204, monitor and obtain corresponding present coordinate values when the cursor graphical pointv is moved in the painting canvas.
Exemplarily, movement of the cursor graphical pointv in painting canvas can be monitored, and cursor graphical pointv can be obtained and is sat in screen Correspondence current pixel coordinate value in mark system, it is possible thereby to according to the current pixel coordinate value, determine cursor graphical pointv in painting canvas Present coordinate values in residing first coordinate system.
S205, according to the first coordinate value, present coordinate values and default standard reference information, it is determined that waiting to paint described in drawing The absorption coordinate value of adsorption site needed for cube processed.
In the present embodiment, can be according to first coordinate value of first graphical pointv in the first coordinate system, cursor graphical pointv Present coordinate values and predetermined standard square body Model projection after obtained the first angle value, the first transformation matrix And second standard reference information such as transformation matrix, it is determined that the absorption coordinate value of adsorption site needed for cube to be drawn.
Further, the determination operation of coordinate value is adsorbed in this step to be realized by the operating process shown in Fig. 2 d, Wherein, Fig. 2 d are the concrete operations flow chart of progress absorption coordinate value determination in the embodiment of the present invention two, meanwhile, Fig. 2 e are to carry out Effect displaying figure when first absorption coordinate value is determined;Fig. 2 f adsorb effect displaying figure when coordinate value is determined for progress second. As shown in Figure 2 d, carrying out the concrete operation step of absorption coordinate value determination includes:
S2051, using the first graphical pointv and cursor graphical pointv as two summits of top surface in cube to be drawn, remember respectively For P1 and P2, wherein, the P1 and P2 opposite vertexes each other in the top surface.
Exemplarily, as shown in Figure 2 e, XOY is the screen coordinate system of electronic equipment, and painting canvas 20 is in the screen coordinate system In, wherein, cursor graphical pointv triggers the origin that the first formed graphical pointv P1 is considered as coordinate system xoy residing for painting canvas 20, And P1 can regard a summit in cube top surface to be drawn as, its corresponding first coordinate value can be designated as (0,0), in painting canvas 20 The cursor graphical pointv of middle movement can as cube top surface to be drawn another summit P2, what it had in xoy coordinate systems Present coordinate values can be determined by S204.It is understood that, the present embodiment by point P1 and point P2 be set on top surface to pushing up Point.
S2052, the first coordinate value and P2 present coordinate values according to the first angle value, Mo and Mo` and P1, it is determined that treating Draw the present coordinate values of the 3rd summit P3 and the 4th summit P4 of top surface in cube in the first coordinate system.
Remaining summit in cube top surface to be drawn can be designated as the 3rd summit P3 and the 4th summit P4 respectively by this step, In the present embodiment, carry out when cube volume drawing is drawn, to ensure that institute's graphing is cube, it is necessary first to by point P1 with Point P4 forms the long H of ribP1P4Angle between x-axis is defaulted as ɑ, i.e. ensure HP1P4The angle value for forming angle with x-axis is Second angle value;Meanwhile, also need point P1 and point P3 forming the long H of the first ribP1P3It is long that the second rib is formed with point P3 and point P2 HP2P3Between angle be defaulted as β, i.e. ensure HP1P3With HP2P3The angle value of formed angle is the first angle value.
This step is according to the first angle recorded in coordinate values of the P1 and P2 in xoy coordinate systems and standard reference information Value, Mo and Mo`, it may be determined that point P3 and point P4 in xoy coordinate systems corresponding present coordinate values (point P3 and point P4 are only calculating Connection in the present coordinate values gone out, therefore Fig. 2 e between each point is represented by dashed line).Specifically, according to the first transformation matrix Mo, Point P1 and coordinate values of the point P2 on the second coordinate system x`oy` can be determined, wherein, P1`=P1*Mo;P2`=P2*Mo;By point P3` and point P4` are designated as point P3 and corresponding points of the point P4 in the second coordinate system respectively, then point P3` and point P4` are in x`oy` Coordinate value can be calculated by following formula:
P3`=[P1`.x-(P2`.y-P1`.y) * cot β, P2`.y] (1)
P4`=[P1`.x+ (P2`.x-P3`.x), P1`.y] (2)
Afterwards, according to the second transformation matrix Mo`, it may be determined that P3=P3`*Mo` and P4=P4`*Mo`, and then it can determine that The present coordinate values that point P3` and point P4` are transformed into rear corresponding point P3 and point P4 in xoy coordinate systems (show point P3 in Fig. 2 e With point P4 present position).
S2053, the first coordinate value and P2, P3 and P4 present coordinate values according to P1, determine the long H of the first ribP1P3 And the second long H of ribP2P3Current rib long value, and according to HP1P3And HP2P3Current rib long value and SH1 and SH2 length value, Determine HP1P3Corresponding first rate value R1 and HP2P3Corresponding second rate value R2.
In the present embodiment, the long H of the first ribP1P3Equivalent to waiting to draw cubical broadside, the long H of the second ribP2P3 It is equal to ensure to wait to draw cubical length, width and height, it is necessary first to ensure H equivalent to waiting to draw cubical long sideP1P3It is (wide Side) and HP2P3(long side) is equal.
Thus the present embodiment can according to point P1 the first coordinate value and point P2, point P3 and point P4 present coordinate values, Determine the long H of the first ribP1P3And the second long H of ribP2P3Current rib long value;Afterwards can be according to HP1P3And HP2P3Current rib it is long SH1 and SH2 length value, passes through formula R1=H in value and standard reference informationP1P3/SH1;R2=HP2P3/ SH2 determines HP1P3 Corresponding first rate value R1 and the HP2P3Corresponding second rate value R2, with by the corresponding rate value in each side according to follow-up The determination operation for adsorbing coordinate value ensures HP1P3(broadside) and HP2P3(long side) is equal.
S2054, when R1 and R2 difference is not more than given threshold, according to R1 and R2 and the first angle value, Mo and Mo `, it is determined that first absorption coordinate value of the first adsorption site needed for drawing the cube to be drawn in the first coordinate system.
In the present embodiment, to ensure to ensure H in cube to be drawnP1P3(broadside) and HP2P3(long side) is equal, can be by R1 It is compared with R2 value, and determines whether its difference is not more than given threshold, wherein, the given threshold can be write from memory by system Recognize setting, can also be manually set according to historical experience, it is 0.05 that the present embodiment, which preferably sets the given threshold,.
It should be noted that when R1 and R2 difference is more than given threshold, the present embodiment no longer carries out following absorption and sat The determination operation of scale value, but corresponding present coordinate values (this reality again after return S204 continuation acquisition cursor graphical pointv movements Apply illustration 2a not shown), and S205 (not shown in Fig. 2 a) is re-executed according to the new present coordinate values of cursor graphical pointv, And repeatable aforesaid operations are until the difference that this step determines R1 and R2 is less than or equal to given threshold.
Specifically, when R1 and R2 difference is not more than given threshold, determine the first adsorption site in the first coordinate system The process of first absorption coordinate value can be described as:Step (1), chooses R1 or R2 as standard ratio value R, this step using R1 as Exemplified by standard ratio value R, therefore it can determine that R=R1=HP1P3/ SH1, because R is standard ratio value, so it is believed that current HP1P3 For standard value, need to ensure that R2 is equal to R afterwards, to ensure to wait to draw cubical broadside (HP1P3) and long side (HP2P3) equal, this When, inversion formula H can be passed throughP2P3=(HP1P3/ SH1) * SH2 determine HP2P3Standard value;Step (2), it is determined that HP2P3Mark , can be according to H after quasi- valueP2P3Standard value, point P1 the first coordinate value and the first angle value, Mo and Mo`, determine a little The corresponding first absorption coordinate value of first adsorption site to be adsorbed P2 is (for ease of representing, directly by the first adsorption site to be determined It is designated as P21).
Specifically, the process of above-mentioned steps (2) can be described as:Determine cursor transfer point P2 in the first coordinate residing for painting canvas 20 Be when moving in xoy corresponding quadrant area, it is necessary to which explanation, the present embodiment is regarded the first adsorption site P21 as cursors and drawn Point to be adsorbed point P2, and point P2 is when being in different quadrants, can determine that point P2 is to be adsorbed according to different coordinate calculation formula The first adsorption site P21 it is corresponding first absorption coordinate value, wherein, coordinate calculation formula includes:
In first quartile:
P21`=[P1`.x+HP2P3*cotβ+H1,P1`.y–HP2P3*sinβ]
In the second quadrant:
P21`=[P1`.x+HP2P3*cotβ–H1,P1`.y–HP2P3*sinβ]
In third quadrant:
P21`=[P1`.x-HP2P3*cotβ–H1,P1`.y+HP2P3*sinβ]
In fourth quadrant:
P21`=[P1`.x-HP2P3*cotβ+H1,P1`.y+HP2P3*sinβ]
It should be noted that P1`=P1*Mo in above-mentioned formula, the HP2P3Obtained by being calculated according to standard ratio value Standard value, corresponding points of the point P21` equivalent to first adsorption site P21 x`oy` in the second coordinate system, wherein, according to P21=P21 `*Mo` can determine first absorption coordinate values of the first adsorption site P21 in the first coordinate system xoy.
Simultaneously, it can be seen that the quadrant when point P2 shown in Fig. 2 e is moved in the first coordinate system xoy residing for painting canvas 20 Region is fourth quadrant, thus can be determined according to the corresponding calculation formula of fourth quadrant P21 first absorption coordinate value (Fig. 2 e show Point P21 position is gone out).
S2055, P2 is adsorbed onto on the position of the first adsorption site, it is the first absorption coordinate to determine P2 present coordinate values Value, and after P2 is adsorbed onto first adsorption site, note cursor graphical pointv is P6, monitors and obtains when P6 is moved in painting canvas Present coordinate values.
Exemplarily, after the first absorption coordinate that the first adsorption site is determined according to S2054, this step can adsorb point P2 Onto the first adsorption site P21 position, and point P2 present coordinate values can be defined as the first absorption coordinate value.Such as Fig. 2 f institutes Show, point P2 is adsorbed onto on the first adsorption site P21 position, point P2 and point P21 are that also show point P2 in same point, Fig. 2 f to inhale It is attached to after point P21, the annexation (specifically being shown with thick dashed line) on four summits in cube top surface to be drawn.
Afterwards, cursor graphical pointv is also designated as P6 by this step, and cursor graphical pointv P6 responds the operation of user, with perpendicular to picture The axis of ordinates y of cloth 20 track movement, this step can monitor the movement of cursor graphical pointv, and obtain working as cursor graphical pointv P6 Preceding pixel coordinate value, finally obtains its present coordinate values in the first coordinate system xoy, Fig. 2 f according to the current pixel coordinate value Show current locations of the point P6 in xoy coordinate systems.
S2056, the present coordinate values according to the first of the P2 the absorption coordinate value and the P6, determine that Rhizoma Sparganii is long HP2P6Current rib long value, and according to the HP2P6Current rib long value and the SH3 length value, determine the HP2P6's 3rd rate value R3.
Exemplarily, as shown in figure 2f, point P2 (P21) is connected to form the long H of Rhizoma Sparganii with point P6P2P6, wherein, the described 3rd The long H of ribP2P6Equivalent to waiting to draw cubical flash, this step can according to the first of point P2 (P21) the absorption coordinate value and Point P6 present coordinate values, determine HP2P6Current rib long value.
In the present embodiment, according to HP2P6Current rib long value and standard reference information in SH3 length value, under H can be determined by stating formulaP2P6Corresponding first rate value R3:Wherein, R3=HP2P6/SH3。
S2057, when R3 and R1 and/or R2 difference is not more than given threshold, according to R1 and/or R2, first absorption sit Scale value and R3, it is determined that second absorption of the second adsorption site needed for drawing the cube to be drawn in the first coordinate system is sat Scale value.
In the present embodiment, the given threshold is preferably again 0.05;According to above-mentioned S2054 can by ensure R1 and R2 is equal to ensure to wait to draw cubical broadside (HP1P3) and long side (HP2P3) equal, this step, which need to be further determined that, to be waited to draw Cubical flash (HP2P6) while with broadside (HP1P3) and long side (HP2P3) equal, thus it needs to be determined that in cube to be drawn The second adsorption site.
Specifically, it is determined that the process of second absorption coordinate value of second adsorption site in the first coordinate system can be described as:Step Suddenly (1), R1 and/or R2 is chosen as standard ratio value R, exemplified by the present embodiment sheet is using R1 as standard ratio value R, therefore can be true Determine R=R1=HP1P3/ SH1, because R is standard ratio value, so equally it is believed that current HP1P3For standard value, to ensure to wait to paint Make cubical broadside (HP1P3) and flash (HP2P6) equal, it is necessary to ensure that R3, equal to R, now, can pass through inversion formula HP2P6= (HP1P3/ SH1) * SH3 acquisitions HP2P6Standard value;Step (2), it is determined that HP2P6Standard value after, can be according to HP2P6Standard The the first absorption coordinate value and formula P61=[P2.x, P2.y+H of value, point P2P2P6], it is determined that the second absorption to be adsorbed point P6 First adsorption site to be determined (for ease of representing, is directly designated as P61, Fig. 2 f are shown by the corresponding second absorption coordinate value of point Point P61 position), wherein, the HP2P6For the standard value obtained by being calculated according to standard ratio value.
S206, determine the first graphical pointv and adsorption site to wait to draw cubical summit, and according to absorption coordinate value and First coordinate value, it is determined that the coordinate value on remaining each summit of cube to be drawn and highlighting, forms described to connect each summit Cube to be drawn.
In the present embodiment, the first graphical pointv, the first adsorption site and the second adsorption site of determination can be defined as treating Cubical fixed vertices are drawn, can be believed afterwards according to the coordinate value of above-mentioned each fixed vertices and default canonical reference Breath, it is determined that coordinate value of each summit of remaining in cube to be drawn in coordinate system xoy where painting canvas.
Specifically, this step determines the coordinate value on remaining each summit of cube to be drawn by operations described below:By the P6 On the position for being adsorbed onto second adsorption site, it is the described second absorption coordinate value to determine the present coordinate values of the P6;According to The first coordinate value of the P1, P2 the first absorption coordinate value and P6 the second absorption coordinate value and the first angle value, Mo and Mo`, it is determined that the coordinate value on remaining each summit of cube to be drawn and highlighting, to connect each summit on painting canvas Form the cube to be drawn.
It is understood that it is determined that after the second adsorption site P61 the second absorption coordinate value, this step equally can be by point P6 is adsorbed onto on the second adsorption site P61 position, and point P6 present coordinate values can be defined as into the second absorption coordinate value.Fig. 2 g Cubical exemplary plot is drawn for waiting of being determined according to the absorption coordinate value of adsorption site, as shown in Figure 2 g, point P6 is adsorbed onto second On adsorption site P61 position, labeled as P6 (P61).
In the present embodiment, can be according to the first graphical pointv P1 the first coordinate value and the first adsorption site P2 (P21) First absorption coordinate value, point P3` under the second coordinate system x`oy` is determined again by the formula (1) and formula (2) in the present embodiment With point P4` coordinate value, thus further according to the second transformation matrix Mo` and point P3` and point P4` coordinate value, the first seat is determined Point P3 and point P4 coordinate value under mark system xoy, and can highlight.
Further, the summit in this implementation on cube top surface to be drawn be P1, P2, P3 and P4, and point P5, P6, P7 and P8 are the summit corresponding with the premises respectively on cube bottom surface to be drawn, and therefore, the present embodiment can basis The point P3 and point P4 coordinate value determined, and HP2P6Standard value, according to following formula determine respectively point P5, point P7 with And point P8 coordinate value and highlight:
P5=[P1.X, P2.Y+H3]
P7=[P3.X, P3.Y+H3]
P8=[P4.X, P4.Y+H3]
In the present embodiment, each summit that is above-mentioned determining and highlighting can be attached, is consequently formed institute The cube to be drawn (as shown in Figure 2 g) needed, it was determined that long side, broadside in the cube to be drawn drawn out And flash is equal.
A kind of method for drafting for cube figure that the embodiment of the present invention two is provided, specifically adds standard reference information It is determined that operation, while the determination operation of adsorption site needed for embodying cube to be drawn, final according to identified adsorption site The coordinate value on each summit of cube to be drawn is obtained, and connects to form cube to be drawn., can be in electronics using this method Cubical drafting is simply and easily realized in the painting canvas of blank, the use of painting function in electronic whiteboard is thus preferably enhanced Experience at family.
Embodiment three
Fig. 3 is a kind of structured flowchart of the drawing apparatus for cube figure that the embodiment of the present invention three is provided.This method is fitted Situation for carrying out cube volume drawing in electronic whiteboard, the wherein device can be realized by software and/or hardware, and typically may be used As the plug-in unit of electronic whiteboard on electronic equipment.As shown in figure 3, the device includes:First coordinate obtaining module 31st, moving coordinate acquisition module 32, absorption coordinate obtaining module 33 and graphic plotting module 34.
Wherein, the first coordinate obtaining module 31, for obtaining cursor graphical pointv in painting canvas forms the first graphical pointv One coordinate value;
Moving coordinate acquisition module 32, for monitoring and obtaining correspondence when the cursor graphical pointv is moved in the painting canvas Present coordinate values;
Coordinate obtaining module 33 is adsorbed, for joining according to first coordinate value, present coordinate values and default standard Information is examined, it is determined that the absorption coordinate value of adsorption site needed for drawing the cube to be drawn;
Graphic plotting module 34, for determining that first graphical pointv and adsorption site are waited to draw cubical top to be described Point, and according to the absorption coordinate value and the first coordinate value, it is determined that the coordinate value on remaining each summit of cube to be drawn And highlight, form the cube to be drawn to connect each summit.
In the present embodiment, the device obtains cursor graphical pointv institute shape in painting canvas by the first coordinate obtaining module 31 first Into the first coordinate value of the first graphical pointv;Then monitored by moving coordinate acquisition module 32 and obtain the cursor graphical pointv and existed Corresponding present coordinate values when being moved in the painting canvas;Afterwards by adsorbing coordinate obtaining module 33 according to first coordinate Value, present coordinate values and default standard reference information, it is determined that the absorption of adsorption site needed for drawing the cube to be drawn Coordinate value;Determine that first graphical pointv and adsorption site are waited to draw cubical top to be described eventually through graphic plotting module 34 Point, and according to the absorption coordinate value and the first coordinate value, it is determined that the coordinate value on remaining each summit of cube to be drawn And highlight, form the cube to be drawn to connect each summit.
A kind of drawing apparatus for cube figure that the embodiment of the present invention three is provided, can be according to acquired first graphical pointv The first coordinate value, the present coordinate values and the default canonical reference for cube volume drawing of monitoring cursor graphical pointv believe Breath, determines to draw the adsorption site needed for cube in painting canvas, finally according to the adsorption site coordinate value and the first graphical pointv of determination The first coordinate value determine the coordinate value of each vertex correspondence in cube, cubical drafting is realized in painting canvas.Utilize the dress Put, cubical drafting can be simply and easily realized in the painting canvas of electronic whiteboard, electronic whiteboard is thus preferably enhanced The Consumer's Experience of middle painting function.
Further, the device, which also optimizes, includes:
Projection coordinate's acquisition module 35, for standard square body Model to be projected in the painting canvas, obtains the standard Projection coordinate value of each summit in the painting canvas in square body Model;
Reference information determining module 36, for being worth according to projection coordinate of each summit in the painting canvas, determines the mark Standard reference information of the quasi- pros' body Model in the painting canvas.
On the basis of above-mentioned optimization, projection coordinate's acquisition module 35, specifically for:
Default virtual perspective camera is called in the three-dimensional scenic of structure, is drawn according to the virtual perspective camera described The standard square body Model of setting is projected in cloth;
The projection coordinate of setting is called to determine function, according to the spatial value on each summit of standard square body Model, Determine projection coordinate value of each summit in the painting canvas.
Further, reference information determining module 36, specifically for:
The summit that the standard square body Model top surface is represented in the painting canvas is designated as the first summit SP1, the second summit SP2, the 3rd summit SP3 and the 4th summit SP4, and the bottom surface summit relative with the SP2 is designated as the 6th summit SP6;Will The side of the SP1 and SP3 formation is designated as broadside SH1, by the SP3 and SP2 formation while for it is long while SH2, and by the SP2 Flash SH3 is designated as with the side of SP6 formation;It is worth according to described SP1, SP2, SP3, SP4 and SP6 projection coordinate, it is determined that described SH1, SH2 and SH3 length value, and determine the SH1 and SH2 formed angle the first angle value and the SH2 and Axis of abscissas where painting canvas forms the second angle value of angle;The coordinate system that the painting canvas is presently in is used as the first coordinate System, and regard the coordinate system using the SH2 as axis of abscissas as second coordinate system;Pressed from both sides according to the first angle value and second Angle value, determines corresponding first transformation matrix Mo when first coordinate system transformation is second coordinate system, and described the Corresponding second transformation matrix Mo` when two coordinate system transformations are first coordinate system;By the first angle value, Mo and Mo` And described SH1, SH2 and SH3 length value are used as default standard reference information.
On the basis of above-mentioned optimization, coordinate obtaining module 33 is adsorbed, specifically for:
Using first summit and the cursor graphical pointv as two summits of top surface in the cube to be drawn, point P1 and P2 are not designated as, wherein, the P1 and P2 opposite vertexes each other in the top surface;According to the first angle value, Mo and Mo` And the first coordinate value and P2 present coordinate values of the P1, it is determined that in the cube to be drawn top surface the 3rd summit P3 With present coordinate values of the 4th summit P4 in first coordinate system;According to the first coordinate value and the P2 of the P1, P3 and P4 present coordinate values, determine the long H of the first ribP1P3And the second long H of ribP2P3Current rib long value, and according to described HP1P3And HP2P3Current rib long value and SH1 and SH2 length value, determine the HP1P3Corresponding first rate value R1 and institute State HP2P3Corresponding second rate value R2;When the R1 and the R2 difference are not more than given threshold, according to the R1 and R2 and the first angle value, Mo and Mo`, it is determined that the first adsorption site needed for drawing the cube to be drawn is described the The first absorption coordinate value in one coordinate system;On the position that the P2 is adsorbed onto to first adsorption site, determine the P2's Present coordinate values are the described first absorption coordinate value, and after the P2 is adsorbed onto first adsorption site, remember cursor graphical pointv For P6, monitor and obtain the present coordinate values when P6 is moved in the painting canvas;According to the first of the P2 the absorption coordinate The present coordinate values of value and the P6, determine the long H of Rhizoma SparganiiP2P6Current rib long value, and according to the HP2P6Current rib it is long The length value of value and the SH3, determines the HP2P6The 3rd rate value R3;When the R3 and R1 and/or R2 difference When value is not more than the given threshold, according to the R1 and/or R2, the first absorption coordinate value and the R3, it is determined that painting Second absorption coordinate value of second adsorption site in the first coordinate system needed for the system cube to be drawn.
Further, graphic plotting module 34, specifically for:
On the position that the P6 is adsorbed onto to second adsorption site, the present coordinate values for determining the P6 are described second Adsorb coordinate value;According to the first coordinate value of the P1, P2 first absorption coordinate value and P6 second absorption coordinate value and The first angle value, Mo and Mo`, it is determined that the coordinate value on remaining each summit of cube to be drawn and highlight, with Each summit is connected on the painting canvas and forms the cube to be drawn.
Example IV
Fig. 4 is the hardware architecture diagram for a kind of electronic equipment that the embodiment of the present invention four is provided, as shown in figure 4, this hair The electronic equipment that bright example IV is provided, including:
Processor 41 and storage device 42.Processor in the electronic equipment can be one or more, with one in Fig. 4 Exemplified by processor 41, processor 41 and storage device 42 in the electronic equipment are connected also by bus or other modes, Fig. 4 In exemplified by being connected by bus.
It is understood that the electronic equipment of the present embodiment can allow user with the interactive function of integrated electronic blank Painted.
Storage device 42 in the electronic equipment is as a kind of computer-readable recording medium, available for storage one or many Individual program, described program can be cube in software program, computer executable program and module, such as embodiment of the present invention Corresponding programmed instruction/the module of method for drafting of figure is (for example, the mould in the drawing apparatus of cube figure shown in accompanying drawing 3 Block, including:First coordinate obtaining module 31, moving coordinate acquisition module 32, absorption coordinate obtaining module 33 and graphic plotting Module 34).Processor 41 is stored in software program, instruction and module in storage device 42 by operation, so as to perform electricity The various function application of sub- equipment and data processing, that is, realize the method for drafting of cube graph shape in above method embodiment.
Storage device 42 may include storing program area and storage data field, wherein, storing program area can storage program area, Application program needed at least one function;Storage data field can be stored uses created data etc. (as above according to equipment State the default standard reference information of embodiment).In addition, storage device 42 can include high-speed random access memory, can be with Including nonvolatile memory, for example, at least one disk memory, flush memory device or other non-volatile solid state memories Part.In some instances, storage device 42 can further comprise the memory remotely located relative to processor 41, and these are long-range Memory can pass through network connection to equipment.The example of above-mentioned network includes but is not limited to internet, intranet, local Net, mobile radio communication and combinations thereof.
Also, when one or more program included by above-mentioned electronic equipment is held by one or more of processors 41 During row, program is proceeded as follows:
Obtain the first coordinate value that cursor graphical pointv in painting canvas forms the first graphical pointv;Monitor and obtain the cursor and paint Corresponding present coordinate values when system point is moved in the painting canvas;According to first coordinate value, present coordinate values and default Standard reference information, it is determined that the absorption coordinate value of adsorption site needed for drawing the cube to be drawn;Determine that described first paints Make point and adsorption site to wait to draw cubical summit to be described, and coordinate value and the first coordinate value are adsorbed according to described, it is determined that The coordinate value on remaining each summit of cube to be drawn simultaneously is highlighted, and is formed with to connect each summit and described is waited to draw cube Body.
In addition, the embodiment of the present invention also provides a kind of computer-readable recording medium, computer program is stored thereon with, should Program controlled device realizes the method for drafting for the cube figure that the embodiment of the present invention one or embodiment two are provided when performing, should Method includes:Obtain the first coordinate value that cursor graphical pointv in painting canvas forms the first graphical pointv;Monitor and obtain the cursor Graphical pointv corresponding present coordinate values when being moved in the painting canvas;According to first coordinate value, present coordinate values and pre- If standard reference information, it is determined that the absorption coordinate value of adsorption site needed for drawing the cube to be drawn;Determine described first Graphical pointv and adsorption site are waited to draw cubical summit to be described, and adsorb coordinate value and the first coordinate value according to described, really The coordinate value on remaining each summit of cube to be drawn simultaneously is highlighted, and is formed with to connect each summit and described is treated drafting cube Body.
By the description above with respect to embodiment, it is apparent to those skilled in the art that, the present invention It can be realized by software and required common hardware, naturally it is also possible to realized by hardware, but the former is more in many cases Good embodiment.Understood based on such, what technical scheme substantially contributed to prior art in other words Part can be embodied in the form of software product, and the computer software product can be stored in computer-readable recording medium In, such as floppy disk, read-only storage (Read-Only Memory, ROM), the random access memory (Random of computer Access Memory, RAM), flash memory (FLASH), hard disk or CD etc., including some instructions are to cause a computer to set Standby (can be personal computer, server, or network equipment etc.) performs the method described in each embodiment of the invention.
Note, above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art it is various it is obvious change, Readjust and substitute without departing from protection scope of the present invention.Therefore, although the present invention is carried out by above example It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also Other more equivalent embodiments can be included, and the scope of the present invention is determined by scope of the appended claims.

Claims (10)

1. a kind of method for drafting of cube figure, it is characterised in that including:
Obtain the first coordinate value that cursor graphical pointv in painting canvas forms the first graphical pointv;
Monitor and obtain corresponding present coordinate values when the cursor graphical pointv is moved in the painting canvas;
According to first coordinate value, present coordinate values and default standard reference information, it is determined that waiting to draw vertical described in drawing The absorption coordinate value of adsorption site needed for cube;
Determine that first graphical pointv and adsorption site wait to draw cubical summit to be described, and according to the absorption coordinate value with And first coordinate value, it is determined that the coordinate value on remaining each summit of cube to be drawn and highlighting, to connect each summit shape Into the cube to be drawn.
2. according to the method described in claim 1, it is characterised in that also include:
Standard square body Model is projected in the painting canvas, each summit is in the painting canvas in the acquisition standard square body Model In projection coordinate value;
According to projection coordinate value of each summit in the painting canvas, mark of the standard square body Model in the painting canvas is determined Quasi- reference information.
3. method according to claim 2, it is characterised in that described that standard square body Model is projected into the painting canvas In, projection coordinate value of each summit in the painting canvas in the standard square body Model is obtained, including:
Default virtual perspective camera is called in the three-dimensional scenic of structure, according to the virtual perspective camera in the painting canvas The standard square body Model of setting is projected;
The projection coordinate of setting is called to determine function, according to the spatial value on each summit of standard square body Model, it is determined that Projection coordinate value of each summit in the painting canvas.
4. method according to claim 2, it is characterised in that the projection coordinate according to each summit in the painting canvas Value, determines standard reference information of the standard square body Model in the painting canvas, including:
By the summit that the standard square body Model top surface is represented in the painting canvas be designated as the first summit SP1, the second summit SP2, 3rd summit SP3 and the 4th summit SP4, and the bottom surface summit relative with the SP2 is designated as the 6th summit SP6;
By the SP1 and SP3 formation side be designated as broadside SH1, by the SP3 and SP2 formation while for it is long while SH2, and by The side of the SP2 and SP6 formation is designated as flash SH3;
It is worth according to described SP1, SP2, SP3, SP4 and SP6 projection coordinate, determines described SH1, SH2 and SH3 length Value, and determine that the SH1 and SH2 forms the first angle value and the SH2 of angle and axis of abscissas institute shape where painting canvas Into the second angle value of angle;
The coordinate system that the painting canvas is presently in is as the first coordinate system, and by the coordinate using the SH2 as axis of abscissas System regards the second coordinate system as;
According to the first angle value and the second angle value, determine first coordinate system transformation be second coordinate system when pair The the first transformation matrix Mo answered, and second coordinate system transformation be first coordinate system when corresponding second transformation matrix Mo`;
It regard the first angle value, Mo and Mo` and described SH1, SH2 and SH3 length value as default canonical reference Information.
5. method according to claim 4, it is characterised in that it is described according to first coordinate value, present coordinate values with And default standard reference information, it is determined that the absorption coordinate value of adsorption site needed for drawing the cube to be drawn, including:
It regard first graphical pointv and the cursor graphical pointv as two summits of top surface in the cube to be drawn, difference P1 and P2 are designated as, wherein, the P1 and P2 opposite vertexes each other in the top surface;
According to the first angle value, Mo and the Mo` and P1 the first coordinate value and P2 present coordinate values, it is determined that described Present coordinate values of the 3rd summit P3 and the 4th summit P4 of top surface in first coordinate system in cube to be drawn;
According to the first coordinate value of the P1 and described P2, P3 and P4 present coordinate values, the long H of the first rib is determinedP1P3And The long H of second ribP2P3Current rib long value, and according to the HP1P3And HP2P3Current rib long value and SH1 and SH2 length value, Determine the HP1P3Corresponding first rate value R1 and the HP2P3Corresponding second rate value R2;
When the R1 and the R2 difference are not more than given threshold, according to the R1 and R2 and the first angle value, Mo and Mo`, it is determined that first absorption of the first adsorption site needed for drawing the cube to be drawn in first coordinate system Coordinate value;
On the position that the P2 is adsorbed onto to first adsorption site, it is the described first absorption to determine the present coordinate values of the P2 Coordinate value, and after the P2 is adsorbed onto first adsorption site, note cursor graphical pointv is P6, monitors and obtains the P6 in institute State present coordinate values when being moved in painting canvas;
According to the first of the P2 the absorption coordinate value and the present coordinate values of the P6, the long H of Rhizoma Sparganii is determinedP2P6Current rib Long value, and according to the HP2P6Current rib long value and the SH3 length value, determine the HP2P6The 3rd rate value R3;
When the R3 and the R1 and/or R2 difference are not more than the given threshold, according to the R1 and/or R2, described First absorption coordinate value and the R3, it is determined that the second adsorption site needed for drawing the cube to be drawn is in the first coordinate system In second absorption coordinate value.
6. method according to claim 5, it is characterised in that the absorption coordinate value and institute according to the adsorption site The first coordinate value is stated, it is determined that the coordinate value on each summit of cube to be drawn and highlighting, institute is formed to connect each summit Cube to be drawn is stated, including:
On the position that the P6 is adsorbed onto to second adsorption site, it is the described second absorption to determine the present coordinate values of the P6 Coordinate value;
According to the first coordinate value of the P1, P2 the first absorption coordinate value and P6 the second absorption coordinate value and described first Angle value, Mo and Mo`, it is determined that the coordinate value on remaining each summit of cube to be drawn and highlighting, with the painting canvas Upper each summit of connection forms the cube to be drawn.
7. a kind of drawing apparatus of cube figure, it is characterised in that including:
First coordinate obtaining module, forms the first coordinate value of the first graphical pointv for obtaining cursor graphical pointv in painting canvas;
Moving coordinate acquisition module, it is corresponding current when the cursor graphical pointv is moved in the painting canvas for monitoring and obtaining Coordinate value;
Coordinate obtaining module is adsorbed, for according to first coordinate value, present coordinate values and default standard reference information, It is determined that the absorption coordinate value of adsorption site needed for drawing the cube to be drawn;
Graphic plotting module, for determining that first graphical pointv and adsorption site are waited to draw cubical summit, and root to be described According to the absorption coordinate value and the first coordinate value, it is determined that the coordinate value and protrusion on remaining each summit of cube to be drawn show Show, the cube to be drawn is formed to connect each summit.
8. device according to claim 7, it is characterised in that also include:
Projection coordinate's acquisition module, for standard square body Model to be projected in the painting canvas, obtains the standard square body Projection coordinate value of each summit in the painting canvas in model;
Reference information determining module, for being worth according to projection coordinate of each summit in the painting canvas, determines the standard square Standard reference information of the body Model in the painting canvas.
9. a kind of electronic equipment, it is characterised in that including:
One or more processors;
Storage device, for storing one or more programs;
One or more of programs are by one or more of computing devices so that one or more of processors are realized The method for drafting of cube figure as any one of claim 1-6.
10. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the program is by processor The method for drafting of the cube figure as any one of claim 1-6 is realized during execution.
CN201710330073.0A 2017-05-11 2017-05-11 Drawing method, device and equipment of cubic graph and storage medium Active CN106971423B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710330073.0A CN106971423B (en) 2017-05-11 2017-05-11 Drawing method, device and equipment of cubic graph and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710330073.0A CN106971423B (en) 2017-05-11 2017-05-11 Drawing method, device and equipment of cubic graph and storage medium

Publications (2)

Publication Number Publication Date
CN106971423A true CN106971423A (en) 2017-07-21
CN106971423B CN106971423B (en) 2020-11-06

Family

ID=59331614

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710330073.0A Active CN106971423B (en) 2017-05-11 2017-05-11 Drawing method, device and equipment of cubic graph and storage medium

Country Status (1)

Country Link
CN (1) CN106971423B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107798715A (en) * 2017-10-19 2018-03-13 广州视睿电子科技有限公司 Alignment adsorption method, device, computer equipment and the storage medium of solid figure
CN107895388A (en) * 2017-11-13 2018-04-10 广州视睿电子科技有限公司 Color filling method, device, computer equipment and the storage medium of figure
CN107978018A (en) * 2017-12-22 2018-05-01 广州视源电子科技股份有限公司 Construction method, device, electronic equipment and the storage medium of solid figure model
CN109636875A (en) * 2018-12-18 2019-04-16 深圳市沃特沃德股份有限公司 Pattern drawing method, device and storage medium
CN110489693A (en) * 2019-07-23 2019-11-22 北京字节跳动网络技术有限公司 A kind of method, apparatus of drawing 3 D graphics, medium and electronic equipment
CN112000402A (en) * 2020-07-01 2020-11-27 佛山市青松科技股份有限公司 VMS screen content management method, device and storage medium
CN113554725A (en) * 2020-04-24 2021-10-26 西安诺瓦星云科技股份有限公司 Multi-pattern moving adsorption method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178816A (en) * 2007-12-07 2008-05-14 桂林电子科技大学 Body drafting visual method based on surface sample-taking
CN103177135A (en) * 2011-12-23 2013-06-26 鸿富锦精密工业(深圳)有限公司 Imaging establishing system and imaging establishing method of three-dimensional coordinate system
CN104866121A (en) * 2014-02-21 2015-08-26 上海市七宝中学 Drawing system and drawing method for three-dimensional model
US20150321103A1 (en) * 2014-05-08 2015-11-12 Sony Computer Entertainment Europe Limited Image capture method and apparatus
CN105068727A (en) * 2015-08-18 2015-11-18 百度在线网络技术(北京)有限公司 Realization method and device for drawing tool
US20160377724A1 (en) * 2015-06-24 2016-12-29 Blackmore Sensors and Analytics Inc. Method and system for three dimensional digital holographic aperture synthesis

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178816A (en) * 2007-12-07 2008-05-14 桂林电子科技大学 Body drafting visual method based on surface sample-taking
CN103177135A (en) * 2011-12-23 2013-06-26 鸿富锦精密工业(深圳)有限公司 Imaging establishing system and imaging establishing method of three-dimensional coordinate system
CN104866121A (en) * 2014-02-21 2015-08-26 上海市七宝中学 Drawing system and drawing method for three-dimensional model
US20150321103A1 (en) * 2014-05-08 2015-11-12 Sony Computer Entertainment Europe Limited Image capture method and apparatus
US20160377724A1 (en) * 2015-06-24 2016-12-29 Blackmore Sensors and Analytics Inc. Method and system for three dimensional digital holographic aperture synthesis
CN105068727A (en) * 2015-08-18 2015-11-18 百度在线网络技术(北京)有限公司 Realization method and device for drawing tool

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李靓 等: "《Maya建模》", 31 December 2013 *
黄声享 等: "《GPS几何监测系统的三维可视化设计与初步实现》", 《测绘工程》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107798715A (en) * 2017-10-19 2018-03-13 广州视睿电子科技有限公司 Alignment adsorption method, device, computer equipment and the storage medium of solid figure
CN107798715B (en) * 2017-10-19 2020-12-29 广州视睿电子科技有限公司 Alignment adsorption method and device for three-dimensional graph, computer equipment and storage medium
CN107895388A (en) * 2017-11-13 2018-04-10 广州视睿电子科技有限公司 Color filling method, device, computer equipment and the storage medium of figure
CN107895388B (en) * 2017-11-13 2022-04-12 广州视睿电子科技有限公司 Method and device for filling colors of graph, computer equipment and storage medium
CN107978018A (en) * 2017-12-22 2018-05-01 广州视源电子科技股份有限公司 Construction method, device, electronic equipment and the storage medium of solid figure model
CN107978018B (en) * 2017-12-22 2022-07-05 广州视源电子科技股份有限公司 Method and device for constructing three-dimensional graph model, electronic equipment and storage medium
CN109636875A (en) * 2018-12-18 2019-04-16 深圳市沃特沃德股份有限公司 Pattern drawing method, device and storage medium
CN109636875B (en) * 2018-12-18 2023-09-08 深圳市沃特沃德信息有限公司 Graph drawing method, device and storage medium
CN110489693A (en) * 2019-07-23 2019-11-22 北京字节跳动网络技术有限公司 A kind of method, apparatus of drawing 3 D graphics, medium and electronic equipment
CN113554725A (en) * 2020-04-24 2021-10-26 西安诺瓦星云科技股份有限公司 Multi-pattern moving adsorption method and device
CN112000402A (en) * 2020-07-01 2020-11-27 佛山市青松科技股份有限公司 VMS screen content management method, device and storage medium
CN112000402B (en) * 2020-07-01 2024-04-02 佛山市青松科技股份有限公司 VMS screen content management method, device and storage medium

Also Published As

Publication number Publication date
CN106971423B (en) 2020-11-06

Similar Documents

Publication Publication Date Title
CN106971423A (en) Method for drafting, device, equipment and the storage medium of cube figure
Murugappan et al. Shape-It-Up: Hand gesture based creative expression of 3D shapes using intelligent generalized cylinders
Le et al. An augmented reality application with hand gestures for learning 3D geometry
US8248419B2 (en) Generation of cubic Bezier control points in computer graphics systems
CN107230239A (en) Pattern drawing method, device and equipment
Abu Rumman et al. Position‐based skinning for soft articulated characters
Powell et al. A scalable image processing framework for gigapixel mars and other celestial body images
Banu Augmented Reality system based on sketches for geometry education
Kang et al. Editing 3D models on smart devices
Huang et al. A dynamic slicing algorithm for conformal additive manufacturing
US8334869B1 (en) Method and apparatus for modeling 3-D shapes from a user drawn curve
US9805499B2 (en) 3D-consistent 2D manipulation of images
CN110570357A (en) mirror image implementation method, device, equipment and storage medium based on UE4 engine
Setti et al. A canonical set of operations for editing dashboard layouts in virtual reality
Liu et al. Fontrl: Chinese font synthesis via deep reinforcement learning
US10573033B2 (en) Selective editing of brushstrokes in a digital graphical image based on direction
Lee et al. Data‐driven kinematic control for robotic spatial augmented reality system with loose kinematic specifications
US20200098194A1 (en) Virtual Reality Anchored Annotation Tool
US7330183B1 (en) Techniques for projecting data maps
US8605109B1 (en) Trend density plot
Vanukuru et al. Dual phone AR: Exploring the use of phones as controllers for mobile augmented reality
Angelidis et al. Space deformations and their application to shape modeling
Papagiannakis et al. Mixed-reality geometric algebra animation methods for gamified intangible heritage
JP7378865B1 (en) Method and program for generating images of three-dimensional objects
Oldknow Mathematics from still and video images

Legal Events

Date Code Title Description
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