CN102819853A - Curve rendering method and system - Google Patents
Curve rendering method and system Download PDFInfo
- Publication number
- CN102819853A CN102819853A CN2011101624278A CN201110162427A CN102819853A CN 102819853 A CN102819853 A CN 102819853A CN 2011101624278 A CN2011101624278 A CN 2011101624278A CN 201110162427 A CN201110162427 A CN 201110162427A CN 102819853 A CN102819853 A CN 102819853A
- Authority
- CN
- China
- Prior art keywords
- curve
- sampled
- sampling
- rendering
- delta
- 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
Links
Images
Abstract
The invention discloses a curve rendering method and a system. The curve rendering method includes by means of the sampling of curves to be rendered, the curves are cut to be a series of sampling points on the curves, and pixels which are closest to the sampling points are rendered so as to complete the rendering for the curves. The curve rendering method and the system have the advantages that the process of point-by-point tracking curve can be avoided, and thereby the problems caused by fault slope calculation can be prevented.
Description
Technical field
The present invention relates to the graphics process field, relate more specifically to a kind of curve rendering intent and system.
Background technology
Two dimension (2D) curve is played up (that is, curve plotting) and is meant, thus to the two-dimensional curve that will draw carry out rasterizing and obtain a series of pixels and describe this curve, and realize playing up to this curve through these a series of pixels are played up.2D curve commonly used in the computer graphics comprises second order Bei Saier curve, three rank Bei Saier curve and elliptic curves.The main thought of known 2D curve plotting method is to seek the nearest pixel of distance Curve one by one from the starting point of curve, through the pixel of seeking being played up the drafting of accomplishing curve.In the process of seeking the nearest pixel of distance Curve, common way is to judge the locations of pixels that next needs are drawn according to curve at the slope of current pixel.Because the shape of curve is very irregular, in some cases, curve is at slope and curve self slope of current pixel and misfit, thereby obtains the location of pixels of mistake, makes whole piece curve plotting mistake.
Summary of the invention
In view of above problem, the present invention proposes a kind of curve rendering intent and system of novelty.
Curve rendering intent according to the embodiment of the invention comprises: the curve through needs are played up is sampled, and is a series of sampled points that are positioned on the curve with curve segmentation; Pixel through the sampled point of adjusting the distance is nearest is played up, and accomplishes playing up for curve.
Wherein, slope absolute value on the curve is carried out the sampling of x direction less than 1 part, slope absolute value on the curve is carried out the sampling of y direction greater than 1 part.Curve is a two-dimensional curve, and according to the resolution of display window curve is carried out the two dimension sampling.Find out the sampled point when x direction or y direction are sampled to curve through following processing: utilize the parametric equation x=x (t) of curve, y=y (t) calculates the stepping step delta t of parametric t when x direction or y direction are sampled to curve
xPerhaps Δ t
yUtilize stepping step delta t
xPerhaps Δ t
y, and the parametric equation of curve calculate the coordinate of the sampled point when x direction or y direction are sampled to curve.
Curve rendering system according to the embodiment of the invention comprises: the curve segmentation unit, be used for sampling through the curve that needs are played up, and be a series of sampled points that are positioned on the curve with curve segmentation; The curve rendering unit is used for playing up through the nearest pixel of the sampled point of adjusting the distance, and accomplishes playing up for curve.
Wherein, the curve segmentation unit carries out the sampling of x direction to slope absolute value on the curve less than 1 part, slope absolute value on the curve is carried out the sampling of y direction greater than 1 part.Curve is a two-dimensional curve, and the curve segmentation unit carries out the two dimension sampling according to the resolution of display window to curve.The sampled point when x direction or y direction are sampled to curve is found out through following processing in the curve segmentation unit: utilize the parametric equation x=x (t) of curve, y=y (t) calculates the stepping step delta t of parametric t when x direction or y direction are sampled to curve
xPerhaps Δ t
yUtilize stepping step delta t
xPerhaps Δ t
y, and the parametric equation of curve calculate the coordinate of the sampled point when x direction or y direction are sampled to curve.
The process that can avoid the pointwise aircraft pursuit course according to the curve rendering system and the method for the embodiment of the invention, thus the problem that produces owing to the slope calculations mistake can be avoided.
Description of drawings
From below in conjunction with understanding the present invention better the description of accompanying drawing specific embodiments of the invention, wherein:
Fig. 1 shows the block diagram according to the curve rendering system of the embodiment of the invention;
Fig. 2 shows the process flow diagram according to the curve rendering intent of the embodiment of the invention; And
Fig. 3 shows the mode example of curve being sampled according to the curve rendering system of the embodiment of the invention and method.
Embodiment
To describe the characteristic and the exemplary embodiment of various aspects of the present invention below in detail.Many details have been contained in following description, so that complete understanding of the present invention is provided.But, it will be apparent to one skilled in the art that the present invention can implement under the situation of some details in not needing these details.Description in the face of embodiment only is in order through example of the present invention is shown the clearer understanding to the present invention to be provided down.Any concrete configuration and the algorithm that are proposed below the present invention never is limited to, but any modification, replacement and the improvement that under the prerequisite that does not break away from spirit of the present invention, have covered coherent element, parts and algorithm.
The present invention proposes a kind of curve and play up thinking; At first curve is carried out the two dimension sampling according to the resolution of display window; Thereby curve segmentation is become a series of sampled points that are positioned on the curve, draw the drafting that the nearest pixel of distance sample is accomplished the whole piece curve then.This method can be avoided the process of traditional pointwise aircraft pursuit course, thereby can avoid the problem that produces owing to the slope calculations mistake.
Fig. 1 shows the block diagram according to the curve rendering system of the embodiment of the invention.Fig. 2 shows the process flow diagram according to the curve rendering intent of the embodiment of the invention.Below in conjunction with Fig. 1 and Fig. 2, curve rendering system and method according to the embodiment of the invention are described.
As shown in Figure 1, comprise curve segmentation unit 102 and curve rendering unit 104 according to the curve rendering system of the embodiment of the invention.Wherein, curve segmentation unit 102 is used for sampling through the curve that needs are played up, and is a series of sampled points (that is execution in step S202) that are positioned on the curve with curve segmentation; Curve rendering unit 104 is used for playing up through the nearest pixel of the sampled point of adjusting the distance, and accomplishes play up (that is the execution in step S204) to curve.
Particularly, in curve rendering system and method according to the embodiment of the invention, slope absolute value carries out the sampling of x direction on the curve that needs are played up less than 1 part; Slope absolute value carries out the sampling of y direction on the curve that needs are played up greater than 1 part.Fig. 3 shows the mode example of curve being sampled according to embodiment of the invention curve rendering system and method.
Specifying below according to the curve rendering system of the embodiment of the invention and method is how to find out a series of sampled points on the curve.In computer graphics, the 2D curve generally includes elliptic curve, secondary Bei Saier function curve and three Bei Saier function curves.The curvilinear equation of these curves all is to describe with the form of parametric equation usually, i.e. x=x (t), the form of y=y (t) (wherein, y=f (x)).
When the x direction is sampled to curve, suppose that sampling interval is [x
0, x
m], then calculative sample point coordinate is (x
0, f (x
0)), (x
0+ 1, f (x
0+ 1)), (x
0+ 2, f (x
0+ 2)) ... (x
m, f (x
m)).According to the parametric equation of curve, when calculating a series of (t
0, t
1, t
2... t
m) satisfy x (t
0)=x
0, x (t
1)=x
0+ 1 ... x (t
m)=x
m, then can obtain f (x
0)=y (t
0), f (x
0+ 1)=y (t
1) ... f (x
n)=y (t
n).
Equally, when when the y direction is sampled to curve, suppose that sampling interval is [y
0, y
n], then calculative sample point coordinate is (f
-1(y
0), y
0), (f
-1(y
0+ 1), y
0+ 1), (f
-1(y
0+ 2), y
0+ 2) ... (f
- 1(y
n), y
n).According to the parametric equation of curve, when calculating a series of (t
0, t
1, t
2... t
n) satisfy y (t
0)=y
0, y (t
1)=y
0+ 1 ... y (t
n)=y
n, then can obtain f
-1(y
0)=y (t
0), f
-1(y
0+ 1)=y (t
1) ... f
-1(y
n)=y (t
n).
Be the method for sampling below for secondary Bezier, three Beziers and elliptic curve.
The secondary Bezier
Its parametric equation is following form:
t∈[0,1]
When the x direction is sampled less than 1 part to the slope absolute value on the secondary Bezier, the process of the coordinate of calculating sampling point is following:
Above-mentioned approximate solutions of equations does
The coordinate of sampled point can be through stepping Δ t
xAnd calculate x (t), y (t) obtains.
Through similar method,, can obtain when when the y direction is sampled greater than 1 part to the slope absolute value on the secondary Bezier
The coordinate of sampled point can be through stepping Δ t
yAnd calculate x (t), y (t) obtains.
After curve segmentation is become a series of sampled points, only need be to drawing the drafting that just can accomplish the whole piece curve from the nearest pixel of sampled point.
Three Beziers
Its parametric equation is:
t∈[0,1]
When in the x direction to the slope absolute value on three Beziers during less than 1 part sampling, the process of the coordinate of calculating sampling point is following:
x(t+Δt)-x(t)=a
x(t+Δt)
3+b
x(t+Δt)
2+c
x(t+Δt)+d
x-(a
xt
3+b
xt
2+c
xt+d
x)
=a
x(3t
2Δt+3tΔt
2+Δt
3)+b
x(2tΔt+Δt
2)+c
xΔt
=a
xΔt
3+(3a
xt+b
x)Δt
2+(3a
xt
2+2b
xt+c
x)Δt
Above-mentioned approximate solutions of equations does
The coordinate of sampled point can and calculate x (t) through stepping Δ tx, and y (t) obtains.
Through similar method, when, obtaining during the slope absolute value on three Beziers greater than 1 part sampling in the y direction
The coordinate of sampled point can be through stepping Δ t
yAnd calculate x (t), y (t) obtains.
After curve segmentation is become a series of sampled points, only need be to drawing the drafting that just can accomplish the whole piece curve from the nearest pixel of sampled point.
Elliptic curve
Its parametric equation does
x(t)=acost-bsint
y(t)=ccost+dsint
t∈[0,2π]
When the x direction is sampled less than 1 part to the slope absolute value on the elliptic curve, the process of the coordinate of calculating sampling point is following:
x(t+Δt)=a(costcosΔt-sintsinΔt)-b(sintcosΔt+costsinΔt)
=(acost-bsint)cosΔt-(asint+bcost)sinΔt
Above-mentioned approximate solutions of equations does
The coordinate of sampled point can be through stepping Δ t
xAnd calculate x (t), y (t) obtains.
Through similar method,, can obtain when when the y direction is sampled greater than 1 part to the slope absolute value on the elliptic curve
The coordinate of sampled point can be through stepping Δ t
yAnd calculate x (t), y (t) obtains.
After curve segmentation is become a series of sampled points, only need be to drawing the drafting that just can accomplish the whole piece curve from the nearest pixel of sampled point.
Curve rendering system and method method according to the embodiment of the invention have been avoided the process of pointwise aircraft pursuit course, thereby have avoided the problem that produces owing to the slope calculations mistake.
Below the present invention has been described with reference to specific embodiment of the present invention; But those skilled in the art all understand; Can carry out various modifications, combination and change to these specific embodiments, and can not break away from the spirit and scope of the present invention that limit accompanying claims or its equivalent.
Can come execution in step with hardware or software as required.Notice that without departing from the scope of the invention, the process flow diagram that can in this instructions, provide adds step, therefrom removes step or revise step wherein.In general, process flow diagram just is used for indicating a kind of possible sequence of the basic operation that is used to realize function.
The universal digital computer of embodiments of the invention programming capable of using, utilize special IC, PLD, field programmable gate array, light, chemistry, biological, system quantum or nanometer engineering, assembly and mechanism to realize.In general, function of the present invention can be realized by any means known in the art.Can use distributed or networked system, assembly and circuit.The communication of data or to transmit can be wired, wireless or through any other means.
Also will recognize, based on the needs of application-specific, one or more can perhaps even in some cases being removed or being deactivated in the key element shown in the accompanying drawing by more separating or more integrated mode realizes.Program or code that realization can be stored in the machine readable media are carried out above-mentioned any method to allow computing machine, also within the spirit and scope of the present invention.
In addition, it only is exemplary that any signal arrows in the accompanying drawing should be considered to, rather than restrictive, only if concrete indication is arranged in addition.Separate or the ability of combination when not knowing when term is also contemplated as to make, the combination of assembly or step also will be considered to put down in writing.
Claims (10)
1. curve rendering intent comprises:
Curve through needs are played up is sampled, and is a series of sampled points that are positioned on the said curve with said curve segmentation;
Play up through the nearest pixel of said sampled point of adjusting the distance, accomplish playing up for said curve.
2. curve rendering intent according to claim 1 is characterized in that, slope absolute value on the said curve is carried out the sampling of x direction less than 1 part.
3. curve rendering intent according to claim 1 is characterized in that, slope absolute value on the said curve is carried out the sampling of y direction greater than 1 part.
4. curve rendering intent according to claim 1 is characterized in that, said curve is a two-dimensional curve, and according to the resolution of display window said curve is carried out the two dimension sampling.
5. according to claim 2 or 3 described curve rendering intents, it is characterized in that, find out the sampled point when x direction or y direction are sampled to said curve through following processing:
Utilize the parametric equation x=x (t) of said curve, y=y (t) calculates the stepping step delta t of parametric t when x direction or y direction are sampled to said curve
xPerhaps Δ t
y
Utilize stepping step delta t
xPerhaps Δ t
y, and the parametric equation of said curve calculate the coordinate of the sampled point when x direction or y direction are sampled to said curve.
6. curve rendering system comprises:
The curve segmentation unit is used for sampling through the curve that needs are played up, and is a series of sampled points that are positioned on the said curve with said curve segmentation;
The curve rendering unit is used for playing up through the nearest pixel of said sampled point of adjusting the distance, and accomplishes playing up for said curve.
7. curve rendering system according to claim 6 is characterized in that, said curve segmentation unit carries out the sampling of x direction less than 1 part to slope absolute value on the said curve.
8. curve rendering system according to claim 6 is characterized in that, said curve segmentation unit carries out the sampling of y direction greater than 1 part to slope absolute value on the said curve.
9. curve rendering system according to claim 6 is characterized in that, said curve is a two-dimensional curve, and said curve segmentation unit carries out the two dimension sampling according to the resolution of display window to said curve.
10. according to claim 7 or 8 described curve rendering systems, it is characterized in that the sampled point when x direction or y direction are sampled to said curve is found out through following processing in said curve segmentation unit:
Utilize the parametric equation x=x (t) of said curve, y=y (t) calculates the stepping step delta t of parametric t when x direction or y direction are sampled to said curve
xPerhaps Δ t
y
Utilize stepping step delta t
xPerhaps Δ t
y, and the parametric equation of said curve calculate the coordinate of the sampled point when x direction or y direction are sampled to said curve.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110162427.8A CN102819853B (en) | 2011-06-10 | 2011-06-10 | Curve rendering intent and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110162427.8A CN102819853B (en) | 2011-06-10 | 2011-06-10 | Curve rendering intent and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102819853A true CN102819853A (en) | 2012-12-12 |
CN102819853B CN102819853B (en) | 2015-11-25 |
Family
ID=47303956
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110162427.8A Expired - Fee Related CN102819853B (en) | 2011-06-10 | 2011-06-10 | Curve rendering intent and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102819853B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104243929A (en) * | 2014-09-26 | 2014-12-24 | 武汉烽火众智数字技术有限责任公司 | Display method for visual range of camera on electronic map |
CN104537698A (en) * | 2014-12-26 | 2015-04-22 | 北京航天飞行控制中心 | Curvature self-adaption orbit drawing method |
CN109978968A (en) * | 2019-04-10 | 2019-07-05 | 广州虎牙信息科技有限公司 | Video rendering method, apparatus, equipment and the storage medium of Moving Objects |
CN113077530A (en) * | 2021-05-06 | 2021-07-06 | 衡阳师范学院 | Traditional curved surface pane construction method and device and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101189642A (en) * | 2005-06-06 | 2008-05-28 | 松下电器产业株式会社 | Curve plotting device, curve plotting method, parking support device, and vehicle |
CN101901488A (en) * | 2009-05-25 | 2010-12-01 | 富士通株式会社 | Method and device for curve approximation and method and device for controlling graphics display |
CN101911123A (en) * | 2008-01-15 | 2010-12-08 | 三菱电机株式会社 | Graphic drawing device and graphic drawing method |
US20110131483A1 (en) * | 2009-11-27 | 2011-06-02 | Fujifilm Corporation | Page description data processing apparatus, page description data processing method, and recording medium |
-
2011
- 2011-06-10 CN CN201110162427.8A patent/CN102819853B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101189642A (en) * | 2005-06-06 | 2008-05-28 | 松下电器产业株式会社 | Curve plotting device, curve plotting method, parking support device, and vehicle |
CN101911123A (en) * | 2008-01-15 | 2010-12-08 | 三菱电机株式会社 | Graphic drawing device and graphic drawing method |
CN101901488A (en) * | 2009-05-25 | 2010-12-01 | 富士通株式会社 | Method and device for curve approximation and method and device for controlling graphics display |
US20110131483A1 (en) * | 2009-11-27 | 2011-06-02 | Fujifilm Corporation | Page description data processing apparatus, page description data processing method, and recording medium |
Non-Patent Citations (3)
Title |
---|
HONGJI YANG ET AL: "A Pixel Level Algorithm for Drawing Curves", 《PROCEEDINGS OF THE 6TH CHINESE AUTOMATION & COMPUTER SCIENCE CONFERENCE》 * |
L. ALBERTI ET AL: "Topology and arrangement computation of semi-algebraic planar curves", 《COMPUTER AIDED GEOMETRIC DESIGN》 * |
方美娥 等: "实平面奇异代数曲线的全局B样条逼近", 《软件学报》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104243929A (en) * | 2014-09-26 | 2014-12-24 | 武汉烽火众智数字技术有限责任公司 | Display method for visual range of camera on electronic map |
CN104537698A (en) * | 2014-12-26 | 2015-04-22 | 北京航天飞行控制中心 | Curvature self-adaption orbit drawing method |
CN104537698B (en) * | 2014-12-26 | 2017-11-28 | 北京航天飞行控制中心 | A kind of adaptive track method for drafting of curvature |
CN109978968A (en) * | 2019-04-10 | 2019-07-05 | 广州虎牙信息科技有限公司 | Video rendering method, apparatus, equipment and the storage medium of Moving Objects |
CN113077530A (en) * | 2021-05-06 | 2021-07-06 | 衡阳师范学院 | Traditional curved surface pane construction method and device and electronic equipment |
CN113077530B (en) * | 2021-05-06 | 2022-06-24 | 衡阳师范学院 | Traditional curved surface pane construction method and device and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN102819853B (en) | 2015-11-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9644976B2 (en) | Building missing movement path of an object | |
KR20200044108A (en) | Method and apparatus for estimating monocular image depth, device, program and storage medium | |
CN102819853A (en) | Curve rendering method and system | |
CN110782654A (en) | Traffic capacity estimation method and device for congestion area and data processing equipment | |
US9684947B2 (en) | Indicating availability of indoor content on a digital map | |
US10198941B2 (en) | Method and apparatus for evaluating traffic approaching a junction at a lane level | |
JP5312815B2 (en) | Map enlargement display device | |
US20150073692A1 (en) | Driver feedback for fuel efficiency | |
EP2889830A1 (en) | Image enlargement method and apparatus | |
JP2006227767A (en) | Map processor, navigation device and map display method | |
JP2020030806A5 (en) | ||
KR101484278B1 (en) | Method and apparatus for displaying map using non-linear compression | |
CN106092116A (en) | The generation of a kind of optimum travel route based on navigation terminal, air navigation aid and device | |
US10366473B2 (en) | Providing traffic mirror content to a driver | |
US20150242674A1 (en) | System and Method for Conflating Datasets | |
US20210046943A1 (en) | Point cloud occlusion mapping for autonomous vehicles | |
CN104251707A (en) | Map loading method and apparatus for navigation | |
CN111104076B (en) | Map display method, map display device and storage medium | |
CN113792061A (en) | Map data updating method and device and electronic equipment | |
US10706049B2 (en) | Method and apparatus for querying nondeterministic graph | |
US9846819B2 (en) | Map image display device, navigation device, and map image display method | |
KR20120029707A (en) | Method and navigation for displaying traffic estimating information | |
CN102110306A (en) | Method and system for triangulating concave polygon | |
US20100328349A1 (en) | System and method for fitting images in an electronic device | |
WO2020258222A1 (en) | Method and system for identifying object |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20151125 Termination date: 20180610 |