CN106898051A - The visual field elimination method and server of a kind of virtual role - Google Patents
The visual field elimination method and server of a kind of virtual role Download PDFInfo
- Publication number
- CN106898051A CN106898051A CN201710244220.2A CN201710244220A CN106898051A CN 106898051 A CN106898051 A CN 106898051A CN 201710244220 A CN201710244220 A CN 201710244220A CN 106898051 A CN106898051 A CN 106898051A
- Authority
- CN
- China
- Prior art keywords
- coordinate value
- value
- coordinate
- virtual role
- server
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T19/00—Manipulating 3D models or images for computer graphics
- G06T19/006—Mixed reality
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/003—Reconstruction from projections, e.g. tomography
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Graphics (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Image Generation (AREA)
- Processing Or Creating Images (AREA)
Abstract
The embodiment of the invention discloses the visual field elimination method and server of a kind of virtual role, for preventing the perspective type of client plug-in, it is to avoid the rounding error produced by rasterization process.In the method, server projects on the projection plane of the second virtual role barrier, obtains barrier convex polygon on a projection plane, and barrier is between the first virtual role and the second virtual role;Server carries out rasterization process to convex polygon;Server determines whether convex polygon is completely covered the second virtual role projected area shared on a projection plane according to the result of rasterization process;If convex polygon is completely covered the projected area of the second virtual role, server weeding out within sweep of the eye from the first virtual role by the second virtual role sends first visual field and rejects result to client;If convex polygon is not completely covered the projected area of the second virtual role, server sends second visual field and rejects result to client.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of virtual role visual field elimination method and server.
Background technology
In current virtual scene, client needs to carry out visual field rejecting (occlusion for virtual role
Culling), it refers to judge whether a certain virtual role can see the judgement side taken during other virtual role that the visual field is rejected
Formula, visual field rejecting is carried out by client-side, can reject other roles sightless for virtual role or object.
In the prior art, client carries out rasterization process by barrier, so as to barrier is converted into screen picture
Element.The rasterization process of client is split as multiple triangles to realize after being typically to project on barrier, do so it is good
Place can be that multiple triangles are carried out with simple, unified and quickly computing, and client-side can use graphics process
Device (Graphics Processing Unit, GPU) carries out concurrent operation.
In the prior art, it is that the visual field that virtual role is carried out rejects in client-side to complete, but if client
The plug-in of perspective type has been opened at end, and the role or object that the role of client-side to be seen are then unrestricted, prior art
The visual field of middle client-side is rejected easily has cheating.In addition, triangle is being converted into screen pixels by client
During, it is necessary to the image of barrier is split as into multiple triangles, so as to reduce the efficiency of rasterisation.Even if two in addition
Triangle leans on extremely near, after being converted into screen pixels, still has and occurs that a pixel gap separates two pixel triangles,
So as to cause the rounding error produced by rasterization process.
The content of the invention
The visual field elimination method and server of a kind of virtual role are the embodiment of the invention provides, for by server one
Side carries out visual field rejecting for virtual role, prevents the perspective type of client plug-in, while improving the efficiency of rasterisation, it is to avoid light
Rounding error produced by gated process.
In order to solve the above technical problems, the embodiment of the present invention provides following technical scheme:
In a first aspect, the embodiment of the present invention provides a kind of visual field elimination method of virtual role, including:
Server projects to barrier on the projection plane of the second virtual role, obtains the barrier in the projection
Convex polygon in plane, the barrier is between the first virtual role and second virtual role;
The server carries out rasterization process to the convex polygon;
It is empty that the server determines whether the convex polygon is completely covered described second according to the result of rasterization process
Intend the shared projected area on the projection plane of role;
If the convex polygon is completely covered the projected area of second virtual role, the server is by described second
Virtual role is weeded out within sweep of the eye from first virtual role, and sending first visual field to client rejects result, institute
Virtual scene of the client where for showing first virtual role is stated, result is rejected in first visual field to be included:It is described
Within sweep of the eye rejecting of second virtual role from first virtual role;
If the convex polygon is not completely covered the projected area of second virtual role, the server is to described
Client sends second visual field and rejects result, and result is rejected in second visual field to be included:Second virtual role is in described
First virtual role is within sweep of the eye.
Second aspect, the embodiment of the present invention also provides a kind of server, including:
Barrier projection module, the projection plane for barrier to be projected to the second virtual role, obtains the barrier
Hinder convex polygon of the thing on the projection plane, the barrier be in the first virtual role and second virtual role it
Between;
Rasterization process module, for carrying out rasterization process to the convex polygon;
Projection judge module, described in determining whether the convex polygon be completely covered according to the result of rasterization process
The shared projected area on the projection plane of second virtual role;
Module is rejected in the visual field, if the projected area of second virtual role is completely covered for the convex polygon, will
Second virtual role the weeding out within sweep of the eye from first virtual role, sends first visual field and rejects to client
As a result, the virtual scene that the client is used for where showing first virtual role, result bag is rejected in first visual field
Include:Within sweep of the eye rejecting of second virtual role from first virtual role;
Sending module, if the projected area of second virtual role is not completely covered for the convex polygon, to
The client sends second visual field and rejects result, and result is rejected in second visual field to be included:Second virtual role is in
First virtual role is within sweep of the eye.
As can be seen from the above technical solutions, the embodiment of the present invention has advantages below:
In embodiments of the present invention, server first projects to barrier on the projection plane of the second virtual role, obtains
To barrier convex polygon on a projection plane, the barrier is between the first virtual role and the second virtual role.Clothes
Business device carries out rasterization process to convex polygon, and server determines whether convex polygon covers completely according to the result of rasterization process
The virtual role of lid second projected area shared on a projection plane.If convex polygon is completely covered the projection of the second virtual role
Area, server weeding out within sweep of the eye from the first virtual role by the second virtual role sends first and regards to client
Result is rejected in open country, and result is rejected in first visual field to be included:Within sweep of the eye rejecting of second virtual role from the first virtual role.If
Convex polygon is not completely covered the projected area of the second virtual role, and server sends second visual field and rejects knot to client
Really, second visual field is rejected result and is included:Second virtual role is in the first virtual role within sweep of the eye.Due to of the invention real
Apply in example by server-side as virtual role carries out visual field rejecting, server sends the visual field and rejects result, clothes to client
Business device only needs to inform the virtual role that be may occur in which in the visual field of the first virtual role of client local terminal, so as to prevent client
Perspective type it is plug-in.Server can carry out rasterization process to convex polygon in the embodiment of the present invention simultaneously, and without again
Multiple triangles are split as, therefore the efficiency of rasterisation can be improved, it is to avoid the rounding error produced by rasterization process.
Brief description of the drawings
A kind of process blocks schematic diagram of the visual field elimination method of Fig. 1 virtual roles provided in an embodiment of the present invention;
Fig. 2 is the projection process schematic diagram of barrier provided in an embodiment of the present invention;
Fig. 3-a are the scanning algorithm initial procedure schematic diagram of rasterization process provided in an embodiment of the present invention;
Fig. 3-b are the scanning algorithm ergodic process schematic diagram of rasterization process provided in an embodiment of the present invention;
Fig. 4-a are a kind of composition structural representation of server provided in an embodiment of the present invention;
Fig. 4-b are the composition structural representation of another server provided in an embodiment of the present invention;
Fig. 4-c are the composition structural representation of another barrier projection module provided in an embodiment of the present invention;
Fig. 5 is that the visual field elimination method of virtual role provided in an embodiment of the present invention is applied to the composition structure of server and shows
It is intended to.
Specific embodiment
The visual field elimination method and server of a kind of virtual role are the embodiment of the invention provides, for by server one
Side carries out visual field rejecting for virtual role, prevents the perspective type of client plug-in, while improving the efficiency of rasterisation, it is to avoid light
Rounding error produced by gated process.
To enable that goal of the invention of the invention, feature, advantage are more obvious and understandable, below in conjunction with the present invention
Accompanying drawing in embodiment, is clearly and completely described, it is clear that disclosed below to the technical scheme in the embodiment of the present invention
Embodiment be only a part of embodiment of the invention, and not all embodiments.Based on the embodiment in the present invention, this area
The every other embodiment that technical staff is obtained, belongs to the scope of protection of the invention.
Term " comprising " and " having " in description and claims of this specification and above-mentioned accompanying drawing and they
Any deformation, it is intended that covering is non-exclusive to be included, and so as to a series of process comprising units, method, system, product or is set
It is standby to be not necessarily limited to those units, but may include not listing clearly or solid for these processes, method, product or equipment
Other units having.
It is described in detail individually below.
One embodiment of the visual field elimination method of virtual role of the present invention, specifically can apply to server-side execution
The visual field is rejected, and to client transmission is in other virtual roles within the vision, such as in game after the visual field is rejected
Reject in the visual field that game role is carried out under scene.Refer to shown in Fig. 1, the virtual role that one embodiment of the invention is provided is regarded
Wild elimination method, may include steps of:
101st, server projects on the projection plane of the second virtual role barrier, obtains barrier in projection plane
On convex polygon, barrier be between the first virtual role and the second virtual role.
In embodiments of the present invention by server for the first virtual role carries out visual field rejecting, it is first determined first void
Intend other virtual roles occurred in virtual scene where role, by other virtual roles definition in addition to the first virtual role
It is the second virtual role, does not limit, in embodiments of the present invention can be with the application scenarios where the first virtual role
There is the 3rd virtual role, the 4th virtual role etc., rejecting of the server to the 3rd virtual role, the 4th virtual role is also referred to
Can server appear in the first virtual angle in subsequent embodiment to the rejecting process of the second virtual role with the second virtual role
Color within sweep of the eye as a example by be described in detail.
In embodiments of the present invention, also there is the second virtual role in the virtual scene where the first virtual role, the
Also there is barrier between one virtual role and the second virtual role, the barrier can be with stage property (such as room in virtual scene
Room, trees) or other virtual roles in addition to the second virtual role, the barrier may shelter from the second virtual role,
So as to the first virtual role cannot observe second virtual role from the visual angle of oneself.Server gets appear in first
Barrier in virtual scene, for example, obtain the position coordinates of the barrier, picture shape and size of the barrier etc..Then
Server gets the projection plane of the second virtual role, and barrier is projected on the projection plane of the second virtual role, obtains
To barrier convex polygon on a projection plane, wherein barrier convex polygon on a projection plane can be various shapes
Convex polygon, for example can be convex pentagon, relatively long side or convex N-gon, the value of N is not limited.
In some embodiments of the invention, barrier is projected to server the throwing of the second virtual role in step 101
Can be specifically that barrier is projected to described by server by the way of perspective projection and/or orthogonal projection in shadow plane
On the projection plane of two virtual roles.Perspective projection belongs to central projection, and it is to project barrier from certain center of projection
Resulting figure on single perspective plane.The projection plane of orthogonal projection is cut on ground sphere a bit, and viewpoint is thrown in unlimited distance
Shadow light is straight line parallel to each other, and perpendicular with projection plane, can show hemisphere.
In some embodiments of the invention, the visual field elimination method of virtual role provided in an embodiment of the present invention can be with
Comprise the following steps:
A1, server obtain first position coordinate of first virtual role in virtual scene;
A2, server are judged from first position coordinate to second place coordinate according to the visual angle that the first virtual role is used
Between straight line on whether there is barrier, second place coordinate is position coordinates of second virtual role in virtual scene;
If A3, from first position coordinate to the straight line second place coordinate do not exist barrier, server is to visitor
Family end sends A Third Position and rejects result, and A Third Position rejects result to be included:Second virtual role is regarded the first virtual role
In wild scope;
If A4, there is barrier from first position coordinate to the straight line second place coordinate, triggering performs as follows
Step 101:Server projects to barrier on the projection plane of the second virtual role.
Wherein, server can also judge before step 101 is performed by way of described in step A1 and step A2
Whether occurs barrier in the virtual scene where the first virtual role, server determines the first of the first virtual role first
The second place coordinate of position coordinates, the second virtual role, then will set up straight line, according to first between the two position coordinateses
The visual angle that virtual role is used judges to whether there is obstacle from first position coordinate to the straight line second place coordinate
Thing, when barrier is clipped between two virtual roles, the barrier may stop that a virtual role is not virtual by another
Role observes, if performing step in the absence of barrier from first position coordinate to the straight line second place coordinate
A3, server sends A Third Position and rejects result to client, and A Third Position rejects result to be included:Second virtual role is first
Within sweep of the eye, i.e., the second virtual role is visible for the first virtual role to virtual role.If from first position
Coordinate is triggered and performs foregoing step 101 again to there is barrier on the straight line between second place coordinate, in this case.
102nd, server carries out rasterization process to convex polygon.
In embodiments of the present invention, barrier can be obtained on the projection plane of the second virtual role one it is convex many
Side shape, it is not necessary to which the convex polygon is divided into multiple triangles again directly can just be carried out at rasterisation to the convex polygon
Reason, so as to save the expense that segmentation polygon is multiple triangles, it is not necessary to carry out rasterization process to multiple triangles, so that
The treatment effeciency of rasterisation can be improved.
Server can carry out rasterization process for convex polygon in the embodiment of the present invention, so as to by the top of convex polygon
Point data is converted to screen pixels, and the screen pixels can be stored in frame buffer zone.Convex polygon is the projection shape of barrier
Shape, it can be the pixel on screen for correspondence position, light by the projection of shape of barrier that convex polygon carries out rasterization process
The essence of gated is coordinate transform, geometry discretization.
In some embodiments of the invention, server carries out rasterization process to convex polygon in step 104, including such as
Lower step:
Step 1, server obtain the position coordinates on all summits of convex polygon;
Step 2, server select the first coordinate value and according to change in coordinate axis direction from the position coordinates on all summits
Two coordinate values, the first coordinate value, the second coordinate value are the maximum coordinate value among and min coordinates value determined according to change in coordinate axis direction, or
First coordinate value, the second coordinate value are the min coordinates value and maximum coordinate value among determined according to change in coordinate axis direction;
Step 3, server are since the first coordinate value along the side of convex polygon respectively according to clockwise direction and inverse time
Pin direction travels through each summit of convex polygon, during each summit is traveled through, after carrying out line to the summit after traversal
The figure of composition is rasterized, until completing rasterization process when eventually arriving at the second coordinate value.
Wherein, all convex polyhedrons for serving as shelter, cuboid, by being all convex many after perspective projection or orthogonal projection
Side shape, first determines the position coordinates on all summits of convex polygon, the maximum coordinates in then finding out on change in coordinate axis direction
Value and min coordinates value, can be since maximum coordinate value among according to each of clockwise and counterclockwise traversal convex polygon
Individual summit, it is also possible to according to each top of clockwise and counterclockwise traversal convex polygon since min coordinates value
Point.During each summit is traveled through, the figure for carrying out being constituted after line to the summit after traversal is rasterized.Need
It is bright, need to travel through each summit of convex polygon successively in step 3, such as along the adjacent edge of convex polygon
Traveled through, the figure for carrying out being constituted after line one by one to the summit after traversal is rasterized, and is not meeting termination condition
Before need that step 3 is performed a plurality of times.
Further, in some embodiments of the invention, foregoing step 3 specifically may include steps of:
Step 31, server since the first coordinate value, along convex polygon side respectively according to clockwise and it is inverse
Clockwise gets the 3rd coordinate value and 4-coordinate value, the corresponding summit of the 3rd coordinate value, the corresponding top of 4-coordinate value
Point summit all corresponding with the first coordinate value is adjacent;
First coordinate value is assigned to current vertex Vcw clockwise by step 32, server, the 3rd coordinate value is assigned to suitable
First coordinate value is assigned to current vertex Vccw counterclockwise by the next summit Vcwn of hour hands, Vcwn=next (Vcw), server,
4-coordinate value is assigned to next summit Vccwp, Vccwp=prev (Vccw) counterclockwise;
Step 33, server are rasterized to the common portion that the first line segment and second line segment are constituted in convex polygon
Treatment, the first line segment includes:Line between the corresponding summits of Vcw and the corresponding summits of Vcwn, second line segment includes:Vccw pairs
Line between the corresponding summit in summit and Vccwp answered;
Step 34, server select the absolute value minimum of the difference between the first coordinate value from Vcwn and Vccwp
Coordinate value, if the absolute value of difference is minimum between Vcwn and the first coordinate value, along the side of convex polygon according to side clockwise
To Five Axis value is found, the 3rd coordinate value is assigned to Vcw, Five Axis value is assigned to Vcwn, then re-execute step
Rapid 33, the corresponding summit of Five Axis value summit corresponding with the 3rd coordinate value is adjacent;If poor between Vccwp and the first coordinate value
The absolute value of value is minimum, then find the 6th coordinate value according to counter clockwise direction along the side of convex polygon, and 4-coordinate value is assigned
It is worth to Vccw, the 6th coordinate value is assigned to Vccwp, then re-executes step 33, the corresponding summit of the 6th coordinate value and the
The corresponding summit of 4-coordinate value is adjacent;When the value of Vcw and Vccw is all not equal to the second coordinate value, re-execute step 33 and
Step 34, rasterization process is completed when the value of Vcw or Vccw is equal to the second coordinate value.
Specifically, in step 31, two on convex polygon of the corresponding summit of the first coordinate value are first got adjacent
Summit, the i.e. corresponding summit of the 3rd coordinate value and the corresponding summit of 4-coordinate value.In the step 32, according to clockwise and
Counterclockwise respectively there is an array, the array for using is traveled through clockwise is:Vcwn-Vcw, both meet following relation:Vcwn
=next (Vcw), the array for using is traveled through counterclockwise is:Vccwp-Vccw, both meet following relation:Vccwp=prev
(Vccw).Carry out initial assignment, the 3rd the-the first coordinate value of coordinate value in step 32 to array clockwise and array counterclockwise first
Vcwn-Vcw is assigned to, the coordinate value of 4-coordinate value-the first is assigned to Vccwp-Vccw.
After completing to two initial assignments of array, step 33 is performed, server exists to the first line segment and second line segment
The common portion of composition carries out rasterization process in convex polygon, and first line segment includes:The corresponding summits of Vcw are corresponding with Vcwn
Summit between line, the second line segment includes:Line between the corresponding summits of Vccw and the corresponding summits of Vccwp.Step
The common portion that rapid 33 pairs of two line segments are constituted in convex polygon is rasterized can specifically include following process:From Vccw
And the minimum coordinate value 1 of absolute value of the difference and the first coordinate value between is chosen in Vcw, chosen from Vccwp and Vcwn and the
The coordinate value 2 of the maximum absolute value of difference between one coordinate value, then be in coordinate value 1 and sit corresponding to convex polygon internal coordinate value
Visuals between scale value 2 is identified as the result of rasterization process.
After completing to the first step rasterization process in convex polygon, array is continued as along the side of convex polygon
Vcwn-Vcw and Vccwp-Vccw updates coordinate value, and server is selected poor between the first coordinate value from Vcwn and Vccwp
The minimum coordinate value of the absolute value of value, if the absolute value of difference is minimum between Vcwn and the first coordinate value, along convex polygon
Side according to clockwise direction find Five Axis value, the 3rd coordinate value is assigned to Vcw, Five Axis value is assigned to
Vcwn, then re-executes step 33, and the corresponding summit of Five Axis value summit corresponding with the 3rd coordinate value is adjacent;If
The absolute value of difference is minimum between Vccwp and the first coordinate value, then find the according to counter clockwise direction along the side of convex polygon
Six coordinate values, Vccw is assigned to by 4-coordinate value, and the 6th coordinate value is assigned into Vccwp, then re-executes step 33, the
The corresponding summit of six coordinate values summit corresponding with 4-coordinate value is adjacent;When the value of Vcw and Vccw is all not equal to the second seat
During scale value, step 33 and step 34 are re-executed, completed at rasterisation when the value of Vcw or Vccw is equal to the second coordinate value
Reason.By the execution repeatedly of step 33 and step 34, the side of convex polygon is constantly traversed, until there is one in Vcw and Vccw
Value first reaches the second coordinate value, can now complete rasterization process.
In some embodiments of the invention, when change in coordinate axis direction is y direction, the first coordinate value, the second coordinate value
Be according to y direction determine maximum coordinate value among and min coordinates value, in Vcwn and Vccwp between the first coordinate value difference
The minimum coordinate value of absolute value be the maximum coordinate value of value in Vcwn and Vccwp;
When change in coordinate axis direction is y direction, the first coordinate value, the second coordinate value are to be determined most according to y direction
The minimum coordinate value of the absolute value of difference is between the first coordinate value in small coordinate value and maximum coordinate value among, Vcwn and Vccwp
The minimum coordinate value of value in Vcwn and Vccwp;
When change in coordinate axis direction is X direction, the first coordinate value, the second coordinate value are to be determined most according to X direction
Global coordinate value and min coordinates value, the minimum coordinate value of the absolute value of difference is between the first coordinate value in Vcwn and Vccwp
The maximum coordinate value of value in Vcwn and Vccwp;
When change in coordinate axis direction is X direction, the first coordinate value, the second coordinate value are to be determined most according to X direction
Global coordinate value and min coordinates value, the minimum coordinate value of the absolute value of difference is between the first coordinate value in Vcwn and Vccwp
The minimum coordinate value of value in Vcwn and Vccwp.
Specifically, step 31 to the rasterization process order of the figure of polygonal each summit composition of step 34 convexity can
It is various to have, such as scanned from longitudinal axis maximum vertex to longitudinal axis minimum vertex, can also be minimum to transverse axis with transverse axis maximum vertex
Scan on summit, it is also possible to scanned from minimum vertex to maximum vertex respectively, entered according to transverse axis/longitudinal axis, maximum vertex/minimum vertex
Row combination of two is classified, and one has four kinds of scan modes, no matter by which kind of rasterization process sequentially, can complete to convex many
The rasterization process of side shape.
103rd, server determines whether convex polygon is completely covered the second virtual role and exists according to the result of rasterization process
Shared projected area on projection plane.
In embodiments of the present invention, after server completes rasterization process to convex polygon, according to the knot of rasterization process
Fruit determines whether convex polygon is completely covered the second virtual role projected area shared on a projection plane.If the second virtual angle
Color projected area shared on a projection plane is all covered by convex polygon, then the second virtual role is blocked by barrier, this
When need perform step 104.If the second virtual role projected area shared on a projection plane is not complete by convex polygon institute
All standing, then the first virtual role can see the second virtual role, now need perform step 105.
In some embodiments of the invention, step 103 server determines convex polygon according to the result of rasterization process
Whether the projected area of second virtual role is completely covered, including:
The projected area of the second virtual role is divided into multiple projection grids by B1, server;
B2, server determine whether convex polygon is completely covered the institute of the second virtual role according to the result of rasterization process
There is projection grid.
Wherein, in order to determine whether convex polygon is completely covered the projected area of the second virtual role, can be empty by second
The projected area for intending role is divided into multiple projection grids.Convex polygon can be completely covered all projections of the second virtual role
Grid, then illustrate that barrier can shelter from the second virtual role, and convex polygon is not completely covered the institute of the second virtual role
There is projection grid, then illustrate that barrier can not shelter from the second virtual role.The sizing grid of the projection grid determines grating
Change the precision problem for the treatment of, there is a problem of precise decreasing if projection grid is very big, it is computationally intensive if projection grid very little
Increased problem.
Further, the projection grid in abovementioned steps B1 can in the following way calculate sizing grid:
Grid=Distance × 2 × tan (α/2);
Wherein, Grid represents the sizing grid of projection grid, and Distance represents the first virtual role and the second virtual angle
The distance between color, tan represents tan symbol, and α represents the view parameter of the first virtual role.
Specifically, by adjusting view parameter, can be done between computational accuracy and amount of calculation and compromised, grid is smaller, meter
Calculate precision higher.For example, view parameter can determine according to virtual scene, classics game camera can be 60 degree,
The value of embodiment of the present invention view parameter can be slightly less than 60 degree, and such as view parameter can be 58 degree.
If the 104, convex polygon is completely covered the projected area of the second virtual role, server is by the second virtual role from
Weeding out within sweep of the eye for one virtual role, first visual field rejecting result is sent to client, and client is used to show first
Virtual scene where virtual role, result is rejected in first visual field to be included:Second virtual role is from the visual field of the first virtual role
In the range of reject.
In embodiments of the present invention, if convex polygon is completely covered the projected area of the second virtual role, second is virtual
Role is sightless for the first virtual role, and server is by the second virtual role from the visual field model of the first virtual role
Weeded out in enclosing, sending first visual field to client rejects result, and result is rejected in first visual field to be included:Second virtual role is from
The rejecting within sweep of the eye of one virtual role.Wherein, the virtual scene that client is used for where showing the first virtual role, the visitor
Family end can only receive other virtual roles within the vision of the first virtual role from server so that client cannot make
It is plug-in with perspective type, if the first virtual role do not occur other virtual roles within sweep of the eye or to occur other virtual
The frequency of role is relatively low, then server can reduce the frequency that game data is sent to client, so as to save under server
Row flow.
If the 105, convex polygon is not completely covered the projected area of the second virtual role, server sends the to client
Result is rejected in two visuals field, and result is rejected in second visual field to be included:Second virtual role is in the first virtual role within sweep of the eye.
In embodiments of the present invention, if convex polygon is not completely covered the projected area of the second virtual role, illustrate
Barrier will not completely shelter from the second virtual role, and the second virtual role is visible, clothes for the first virtual role
Business device sends second visual field and rejects result to client, and result is rejected in second visual field to be included:It is empty that second virtual role is in first
Intend role within sweep of the eye.Wherein, the virtual scene that client is used for where showing the first virtual role, the client can only
Other virtual roles within the vision of the first virtual role are received from server so that client cannot use perspective class
Type is plug-in, if the first virtual role other virtual roles does not occur or the frequency of other virtual roles occur within sweep of the eye
Rate is relatively low, then server can reduce the frequency that game data is sent to client, so as to save the downlink traffic of server.
Description by above example to the embodiment of the present invention, in embodiments of the present invention, server is by obstacle
Thing is projected on the projection plane of the second virtual role, obtains barrier convex polygon on a projection plane, and barrier is in
Between first virtual role and the second virtual role.Server carries out rasterization process to convex polygon, and server according to
The result of rasterization process determines whether convex polygon is completely covered the second virtual role perspective plane shared on a projection plane
Product.If convex polygon is completely covered the projected area of the second virtual role, server is by the second virtual role from the first virtual angle
Weeding out within sweep of the eye for color, first visual field rejecting result is sent to client, and result is rejected in first visual field to be included:Second is empty
Intend within sweep of the eye rejecting of the role from the first virtual role.If convex polygon is not completely covered the projection of the second virtual role
Area, server sends second visual field and rejects result to client, and result is rejected in second visual field to be included:Second virtual role is in
First virtual role is within sweep of the eye.Due to being picked for virtual role carries out the visual field by server-side in the embodiment of the present invention
Remove, server sends the visual field and rejects result to client, and server only needs to inform the first virtual role of client local terminal
The virtual role that be may occur in which in the visual field, so as to prevent the perspective type of client plug-in.While server in the embodiment of the present invention
Rasterization process can be carried out to convex polygon, and without being split as multiple triangles again, therefore the effect of rasterisation can be improved
Rate, it is to avoid the rounding error produced by rasterization process.
For ease of being better understood from and implementing the such scheme of the embodiment of the present invention, corresponding application scenarios of illustrating below come
It is specifically described.
The visual field of the first virtual role is rejected and is no longer completed by client in the embodiment of the present invention, to prevent client
Cheating, specifically can be by server for the first virtual role carries out visual field rejecting, and it refers to judge a certain virtual that the visual field is rejected
Whether role can see the judgment mode taken during other virtual role, and the visual field is rejected is a difficulty and part and parcel,
In scene of game (such as play dota) if in client-side open extension it is seen that other roles, can there is client in this
The problem of cheating is held, is inequitable for other clients.Visual field rejecting is carried out by server-side, can be rejected
Other roles sightless for virtual role or object, the server are only sent in the first virtual role to client
Other virtual roles within the vision, it is plug-in such that it is able to realize anti-perspective type well, can also save a large amount of flows.
The visual field that client-side is carried out in the prior art is rejected can be by the special graphic process unit of graphics process
(Graphics Processing Unit, GPU) is completed, but is generally not present GPU in server, and server is rasterized
Precision can do appropriate choice with operation efficiency, therefore server-side needs to be applied to the efficient convex polygon grating of server
Change.In the scheme that the server visual field is rejected key component is the efficiency of convex polygon rasterisation, all shelters that serve as
Convex polyhedron, cuboid, by being all convex polygon after perspective projection or rectangular projection.
Refer to shown in Fig. 2, be the projection process schematic diagram of barrier provided in an embodiment of the present invention, A and B is virtual
Role, virtual role A is represented with camera, and B is represented with projection plane, and barrier is in virtual role A and virtual role B.Service
Device is summarized as follows for the principle that virtual role A carries out visual field rejecting:
1st, each virtual role has a projection plane, and virtual role projected area on a projection plane compares actor model
Greatly, compensating the communication delay of server and client side.Such as virtual role A hides behind a barrier, at this moment virtual angle
Color B can't see virtual role A in the client of oneself, but virtual role B determines that cut-through thing goes to attack virtual role A.It is empty
Intend role B and go to one it can be seen that the position moment of virtual role A, empty due to network communication delay in the client of oneself
Intend role B and also can't see virtual role A in the position of server, so as to cause delay issue, the appropriate throwing for increasing actor model A
Shadow plane sizes, can allow virtual role B in server earlier see virtual role A, it is possible to reduce server and client
The communication delay at end.
When the 2nd, determining the whether visible virtual role B of virtual role A, can be from the video camera of virtual role A to virtual role B
Launch one or more ray, if any one ray clear is blocked, the visible virtual role B of virtual role A.
If the 3, there is barrier centre, all barriers are projected to virtually by perspective projection or/and orthogonal projection
The projection plane of role B, and the projection grid of projected light gated to virtual role B.
If the 4, the whole projected area of virtual role B is all covered by barrier, the invisible virtual roles of virtual role A
B, otherwise can be determined that the visible virtual role B of virtual role A.In addition, in order to ensure fair play, while amount of calculation is reduced,
The amphicheirality in the visual field is realized, if i.e. virtual role A can see virtual role B, virtual role B is it can be seen that virtual role
A。
Wherein, the sizing grid of projection plane is determined that be separated by far, precision drops by the distance and view parameter of A and B
It is low, reduce amount of calculation.Near, the precision increase of rasterization process is being separated by, can also increase judgement precision, formula is as follows:
Grid=Distance × 2 × tan (α/2).
By adjusting view parameter, can be done between computational accuracy and amount of calculation and compromised, grid is smaller, and computational accuracy is got over
It is high.
An efficiency light gated convex polygon algorithm is proposed in the embodiment of the present invention, for regarding that server-side is realized
Open country is rejected, and the rasterization process to convex polygon is next illustrated so that reference axis is longitudinal axis y as an example.Convex polygon light
Gated algorithm receives convex polygon vertical array as input, and summit can be being arranged in array clockwise or counterclockwise.Should
Algorithm is described as follows:
1st, two minimum and maximum summits of convex polygon y values are found, Vymax, Vymin is named respectively.Y values are convex polygon
The y values of the two-dimensional coordinate system that plane where shape is set up, convex polygon is expressed as two-dimensional coordinate point sequence in the coordinate system, for example
(0,0), (0,1), (1,0) sequence represents a triangle.
2nd, summit Vcw=Vccw=Vymax is initialized, the descendant vertex Vcwn=next (Vcw) of Vcw is initialized, initially
Change the preceding Vccwp=prev apicad (Vccw) of Vccw.Mark after initialization is that the embodiment of the present invention is carried as shown in Fig. 3-a
The scanning algorithm initial procedure schematic diagram of the rasterization process of confession.Vcw represents the summit (clockwise) by traversal clockwise,
Vccw represents the summit (counter-clockwise) by inverse traversal clockwise.
3rd, the common portion of line segment Vcw-Vcwn and line segment Vccw-Vccwp is rasterized, the dash area in such as Fig. 3-a is
The result of rasterization process, concrete mode is:The y values of y value smallers in Y1=Vccw and Vcw are made, Y2=Vccwp and Vcwn is made
The y values of middle y values the greater, meeting y in convex polygon>=Y2 and y<The point V of=Y1 applies top shadow, used as rasterization process
As a result.
4th, the y values of Vccwp and Vcwn are compared, y values the greater is moved along the side of convex polygon and moved a step, as shown in Fig. 3-b,
It is the scanning algorithm ergodic process schematic diagram of rasterization process provided in an embodiment of the present invention.If Vccw or Vcw are equal to
Vymin, algorithm terminates, and is otherwise transferred to step 3.If the y values of Vccwp are big, as shown in Fig. 3-a, then Vccwp and Vccw is by inverse
Hour hands make a move backward, i.e. Vccw=Vccwp, Vccwp=prev (Vccwp), situation shown in Fig. 3-b are developed into, if Vcwn
Y values it is big, then Vcwn and Vcw by taking one pace forward clockwise, i.e. Vcw=Vcwn, Vcwn=next (Vcwn).
By foregoing illustration, server-side can directly rasterize convex polygon in the embodiment of the present invention
Shape, without convex polygon is split triangularity, efficiency high, the rounding error also not produced by triangular slits.Therefore
During triangle is converted into screen pixels, even if two triangles lean on extremely near, after being converted into screen pixels, still
A pixel gap is likely to see to separate two pixel triangles.The rasterisation provided in the other embodiment of the present invention is convex more
The algorithm of side shape can be performed by CPU, operate in server end.This programme is swept from longitudinal axis maximum vertex to longitudinal axis minimum vertex
Retouch, can expand to and be scanned to transverse axis minimum vertex with transverse axis maximum vertex, it is also possible to respectively from minimum vertex to maximum vertex
Scanning, according to transverse axis/longitudinal axis and maximum vertex/minimum vertex classification, one has four kinds of scan modes.
It should be noted that for foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as a series of
Combination of actions, but those skilled in the art should know, the present invention not by described by sequence of movement limited because
According to the present invention, some steps can sequentially or simultaneously be carried out using other.Secondly, those skilled in the art should also know
Know, embodiment described in this description belongs to preferred embodiment, involved action and module is not necessarily of the invention
It is necessary.
For ease of preferably implementing the such scheme of the embodiment of the present invention, the phase for implementing such scheme is also provided below
Close device.
Refer to shown in Fig. 4-a, a kind of server 400 provided in an embodiment of the present invention can include:Barrier projective module
Block 401, rasterization process module 402, the projection judge module 403, visual field reject module 404, sending module 405, wherein,
Barrier projection module 401, the projection plane for barrier to be projected to the second virtual role obtains described
Convex polygon of the barrier on the projection plane, the barrier is in the first virtual role and second virtual role
Between;
Rasterization process module 402, for carrying out rasterization process to the convex polygon;
Projection judge module 403, for determining whether the convex polygon is completely covered according to the result of rasterization process
The shared projected area on the projection plane of second virtual role;
Module 404 is rejected in the visual field, if the projected area of second virtual role is completely covered for the convex polygon,
By the second virtual role weeding out within sweep of the eye from first virtual role, send first visual field to client and pick
Division result, the virtual scene that the client is used for where showing first virtual role, result is rejected in first visual field
Including:Within sweep of the eye rejecting of second virtual role from first virtual role;
Sending module 405, if the projected area of second virtual role is not completely covered for the convex polygon,
Second visual field being sent to the client and rejecting result, result is rejected in second visual field to be included:At second virtual role
In first virtual role within sweep of the eye.
In some embodiments of the invention, refer to shown in Fig. 4-b, the server 400 also includes:Coordinate obtains mould
Block 406 and barrier judgment module 407, wherein,
The coordinate obtaining module 406, sits for obtaining first position of first virtual role in virtual scene
Mark;
The barrier judgment module 407, the visual angle for being used according to first virtual role is judged from described
To whether there is barrier on the straight line between second place coordinate, the second place coordinate is described the to first position coordinate
Position coordinates of two virtual roles in the virtual scene;If from the first position coordinate to the second place coordinate it
Between straight line on there is barrier, triggering performs the barrier projection module 401;
The sending module 404, if being additionally operable to from the first position coordinate to straight the second place coordinate
Do not exist barrier on line, sending A Third Position to the client rejects result, and the A Third Position rejects result to be included:Institute
The second virtual role is stated in first virtual role within sweep of the eye.
In some embodiments of the invention, the rasterization process module 402, specifically for performing following steps:
Step 1, the position coordinates on all summits of the acquisition convex polygon;
Step 2, the first coordinate value and second are selected from the position coordinates on all summits according to change in coordinate axis direction
Coordinate value, first coordinate value, second coordinate value are the maximum coordinate value among and most determined according to the change in coordinate axis direction
Small coordinate value, or first coordinate value, second coordinate value are the min coordinates value determined according to the change in coordinate axis direction
And maximum coordinate value among;
Step 3, since first coordinate value along the convex polygon side respectively according to clockwise and it is inverse
Clockwise travels through each summit of the convex polygon, during each summit is traveled through, the summit after traversal is carried out
The figure constituted after line is rasterized, until completing rasterization process when eventually arriving at second coordinate value.
In some embodiments of the invention, the rasterization process module 402, specifically for performing following steps:
Step 31, since first coordinate value, along the convex polygon side respectively according to clockwise and
Counterclockwise get the 3rd coordinate value and 4-coordinate value, the corresponding summit of the 3rd coordinate value, the 4-coordinate
It is worth corresponding summit summit all corresponding with first coordinate value adjacent;
Step 32, first coordinate value is assigned to current vertex Vcw clockwise, the 3rd coordinate value is assigned to
First coordinate value is assigned to current vertex counterclockwise by next summit Vcwn clockwise, the Vcwn=next (Vcw)
Vccw, next summit Vccwp counterclockwise, the Vccwp=prev (Vccw) are assigned to by the 4-coordinate value;
Step 33, the common portion that the first line segment and second line segment are constituted in the convex polygon is carried out at rasterisation
Reason, first line segment includes:Line between the corresponding summits of Vcw and the corresponding summits of the Vcwn, described second
Line segment includes:Line between the corresponding summits of Vccw and the corresponding summits of the Vccwp;
Step 34, the absolute value for selecting from the Vcwn and the Vccwp difference between first coordinate value
Minimum coordinate value, if the absolute value of difference is minimum between the Vcwn and first coordinate value, along described convex polygon
Five Axis value is found in the side of shape according to clockwise direction, and the 3rd coordinate value is assigned into the Vcw, and the described 5th is sat
Scale value is assigned to the Vcwn, then re-executes step 33, the corresponding summit of the Five Axis value and the 3rd coordinate
It is worth corresponding summit adjacent;If the absolute value of difference is minimum between the Vccwp and first coordinate value, along described convex
The 6th coordinate value is found in polygonal side according to counter clockwise direction, and the 4-coordinate value is assigned into the Vccw, will be described
6th coordinate value is assigned to the Vccwp, then re-executes step 33, the corresponding summit of the 6th coordinate value and described
The corresponding summit of 4-coordinate value is adjacent;When the value of the Vcw and the Vccw is all not equal to second coordinate value, again
Step 33 and step 34 are performed, is completed at rasterisation when the value of the Vcw or described Vccw is equal to second coordinate value
Reason.
In some embodiments of the invention, when the change in coordinate axis direction is y direction, first coordinate value, institute
It is the maximum coordinate value among and min coordinates value determined according to the y direction, the Vcwn and described to state the second coordinate value
In Vccwp between first coordinate value minimum coordinate value of the absolute value of difference to be taken in the Vcwn and Vccwp
It is worth maximum coordinate value;
When the change in coordinate axis direction is y direction, first coordinate value, second coordinate value are according to described
Y direction determine min coordinates value and maximum coordinate value among, in the Vcwn and Vccwp with first coordinate value it
Between difference the minimum coordinate value of absolute value be the Vcwn and the Vccwp in the minimum coordinate value of value;
When the change in coordinate axis direction is X direction, first coordinate value, second coordinate value are according to described
X direction determine maximum coordinate value among and min coordinates value, in the Vcwn and Vccwp with first coordinate value it
Between difference the minimum coordinate value of absolute value be the Vcwn and the Vccwp in the maximum coordinate value of value;
When the change in coordinate axis direction is X direction, first coordinate value, second coordinate value are according to described
X direction determine maximum coordinate value among and min coordinates value, in the Vcwn and Vccwp with first coordinate value it
Between difference the minimum coordinate value of absolute value be the Vcwn and the Vccwp in the minimum coordinate value of value.
In some embodiments of the invention, refer to shown in Fig. 4-c, the barrier projection module 401, including:
Mesh generation module 4011, for the projected area of second virtual role to be divided into multiple projection grids;
Grid Covering judgment module 4012, for whether determining the convex polygon according to the result of the rasterization process
All projection grids of second virtual role are completely covered.
In some embodiments of the invention, the projection grid calculates sizing grid in the following way:
Grid=Distance × 2 × tan (α/2);
Wherein, the Grid represents the sizing grid of the projection grid, and the Distance represents that described first is virtual
The distance between role and second virtual role, the tan represent tan symbol, and the α represents that described first is empty
Intend the view parameter of role.
Description more than to the embodiment of the present invention, in embodiments of the present invention, server is first by barrier
Project on the projection plane of the second virtual role, obtain barrier convex polygon on a projection plane, barrier is in the
Between one virtual role and the second virtual role.Server carries out rasterization process, and server to convex polygon according to light
The result of gated treatment determines whether convex polygon is completely covered the second virtual role projected area shared on a projection plane.
If convex polygon is completely covered the projected area of the second virtual role, server is by the second virtual role from the first virtual role
Weed out within sweep of the eye, sending first visual field to client rejects result, and result is rejected in first visual field to be included:Second virtual angle
Within sweep of the eye deletion of the color from the first virtual role.If convex polygon is not completely covered the perspective plane of the second virtual role
Product, server sends second visual field and rejects result to client, and result is rejected in second visual field to be included:Second virtual role is in the
One virtual role is within sweep of the eye.Due to being picked for virtual role carries out the visual field by server-side in the embodiment of the present invention
Remove, server sends the visual field and rejects result to client, and server only needs to inform the first virtual role of client local terminal
The virtual role that be may occur in which in the visual field, so as to prevent the perspective type of client plug-in.While server in the embodiment of the present invention
Rasterization process can be carried out to convex polygon, and without being split as multiple triangles again, therefore the effect of rasterisation can be improved
Rate, it is to avoid the rounding error produced by rasterization process.
Fig. 5 is a kind of server architecture schematic diagram provided in an embodiment of the present invention, and the server 1100 can be because of configuration or property
Can the different and larger difference of producing ratio, one or more central processing units (central processing can be included
Units, CPU) 1122 (for example, one or more processors) and memory 1132, one or more storage applications
The storage medium 1130 (such as one or more mass memory units) of program 1142 or data 1144.Wherein, memory
1132 and storage medium 1130 can be it is of short duration storage or persistently storage.The program stored in storage medium 1130 can include one
Individual or more than one module (diagram is not marked), each module can be included to the series of instructions operation in server.More enter
One step ground, central processing unit 1122 be could be arranged to be communicated with storage medium 1130, and storage medium is performed on server 1100
Series of instructions operation in 1130.
Server 1100 can also include one or more power supplys 1126, one or more wired or wireless nets
Network interface 1150, one or more input/output interfaces 1158, and/or, one or more operating systems 1141, example
Such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM etc..
The visual field elimination method step of the virtual role in above-described embodiment as performed by server can be based on Fig. 5 institutes
The server architecture for showing.
In addition it should be noted that, device embodiment described above be only it is schematical, wherein it is described as separate
The unit of part description can be or may not be it is physically separate, the part shown as unit can be or
Can not be physical location, you can with positioned at a place, or can also be distributed on multiple NEs.Can be according to reality
Some or all of module therein is selected the need for border to realize the purpose of this embodiment scheme.In addition, what the present invention was provided
In device embodiment accompanying drawing, the annexation between module represents between them there is communication connection, specifically can be implemented as one
Bar or a plurality of communication bus or holding wire.Those of ordinary skill in the art are without creative efforts, you can with
Understand and implement.
Through the above description of the embodiments, it is apparent to those skilled in the art that the present invention can be borrowed
Software is helped to add the mode of required common hardware to realize, naturally it is also possible to include application specific integrated circuit, specially by specialized hardware
Realized with CPU, private memory, special components and parts etc..Generally, all functions of being completed by computer program can
Easily realized with corresponding hardware, and, the particular hardware structure for realizing same function can also be various many
Sample, such as analog circuit, digital circuit or special circuit etc..But, it is more for the purpose of the present invention in the case of software program reality
It is now more preferably implementation method.Based on such understanding, technical scheme is substantially made to prior art in other words
The part of contribution can be embodied in the form of software product, and the computer software product is stored in the storage medium that can read
In, such as floppy disk, USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), the random access memory of computer
Device (RAM, Random Access Memory), magnetic disc or CD etc., including some instructions are used to so that a computer sets
Standby (can be personal computer, server, or network equipment etc.) performs the method described in each embodiment of the invention.
In sum, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to upper
Embodiment is stated to be described in detail the present invention, it will be understood by those within the art that:It still can be to upper
State the technical scheme described in each embodiment to modify, or equivalent is carried out to which part technical characteristic;And these
Modification is replaced, and does not make the spirit and scope of the essence disengaging various embodiments of the present invention technical scheme of appropriate technical solution.
Claims (14)
1. the visual field elimination method of a kind of virtual role, it is characterised in that including:
Server projects to barrier on the projection plane of the second virtual role, obtains the barrier in the projection plane
On convex polygon, the barrier be between the first virtual role and second virtual role;
The server carries out rasterization process to the convex polygon;
The server determines whether the convex polygon is completely covered the described second virtual angle according to the result of rasterization process
The shared projected area on the projection plane of color;
If the convex polygon is completely covered the projected area of second virtual role, the server is virtual by described second
Role weeds out within sweep of the eye from first virtual role, and sending first visual field to client rejects result, described the
Result is rejected in one visual field to be included:Within sweep of the eye rejecting of second virtual role from first virtual role;
If the convex polygon is not completely covered the projected area of second virtual role, the server is to the client
End sends second visual field and rejects result, and result is rejected in second visual field to be included:Second virtual role is in described first
Virtual role is within sweep of the eye.
2. method according to claim 1, it is characterised in that methods described also includes:
The server obtains first position coordinate of first virtual role in virtual scene;
The server is judged from the first position coordinate to second according to the visual angle that first virtual role is used
Put with the presence or absence of barrier on the straight line between coordinate, the second place coordinate is second virtual role described virtual
Position coordinates in scene;
If not existing barrier, the server from the first position coordinate to the straight line the second place coordinate
A Third Position being sent to the client and rejecting result, the A Third Position rejects result to be included:Second virtual role exists
First virtual role is within sweep of the eye;
If there is barrier from the first position coordinate to the straight line the second place coordinate, triggering performs as follows
Step:Server projects to barrier on the projection plane of the second virtual role.
3. method according to claim 1, it is characterised in that the server is carried out at rasterisation to the convex polygon
Reason, comprises the following steps:
Step 1, the server obtain the position coordinates on all summits of the convex polygon;
Step 2, the server select the first coordinate value according to change in coordinate axis direction from the position coordinates on all summits
With the second coordinate value, first coordinate value, second coordinate value are the maximum coordinates determined according to the change in coordinate axis direction
Value and min coordinates value, or first coordinate value, second coordinate value are the minimum determined according to the change in coordinate axis direction
Coordinate value and maximum coordinate value among;
Step 3, the server are since first coordinate value along the side of the convex polygon respectively according to side clockwise
Each summit of the convex polygon is traveled through to counter clockwise direction, during each summit is traveled through, to the top after traversal
The figure that point constituted after line is rasterized, until completing rasterization process when eventually arriving at second coordinate value.
4. method according to claim 3, it is characterised in that the step 3, including:
Step 31, the server since first coordinate value, along the side of the convex polygon respectively according to clockwise
Direction and counterclockwise get the 3rd coordinate value and 4-coordinate value, the corresponding summit of the 3rd coordinate value, described the
The corresponding summit of 4-coordinate value summit all corresponding with first coordinate value is adjacent;
First coordinate value is assigned to current vertex Vcw clockwise by step 32, the server, by the 3rd coordinate value
Next summit Vcwn clockwise is assigned to, be assigned to for first coordinate value by the Vcwn=next (Vcw), the server
Current vertex Vccw counterclockwise, next summit Vccwp, the Vccwp=prev counterclockwise are assigned to by the 4-coordinate value
(Vccw);
Step 33, the server carry out light to the common portion that the first line segment and second line segment are constituted in the convex polygon
Gated treatment, first line segment includes:Line between the corresponding summits of Vcw and the corresponding summits of the Vcwn, institute
Stating second line segment includes:Line between the corresponding summits of Vccw and the corresponding summits of the Vccwp;
Step 34, the server select the difference between first coordinate value from the Vcwn and the Vccwp
The minimum coordinate value of absolute value, if the absolute value of difference is minimum between the Vcwn and first coordinate value, along described
Five Axis value is found in the side of convex polygon according to clockwise direction, and the 3rd coordinate value is assigned into the Vcw, will be described
Five Axis value is assigned to the Vcwn, then re-executes step 33, the corresponding summit of the Five Axis value and described
The corresponding summit of three coordinate values is adjacent;If the absolute value of difference is minimum between the Vccwp and first coordinate value, along
The 6th coordinate value is found in the side of the convex polygon according to counter clockwise direction, and the 4-coordinate value is assigned into the Vccw,
6th coordinate value is assigned to the Vccwp, step 33 is then re-executed, the corresponding summit of the 6th coordinate value with
The corresponding summit of the 4-coordinate value is adjacent;When the value of the Vcw and the Vccw is all not equal to second coordinate value
When, step 33 and step 34 are re-executed, complete light when the value of the Vcw or described Vccw is equal to second coordinate value
Gated treatment.
5. method according to claim 4, it is characterised in that when the change in coordinate axis direction is y direction, described the
One coordinate value, second coordinate value are the maximum coordinate value among and min coordinates value determined according to the y direction, described
The minimum coordinate value of the absolute value of difference is the Vcwn and described between first coordinate value in the Vcwn and Vccwp
The maximum coordinate value of value in Vccwp;
When the change in coordinate axis direction is y direction, first coordinate value, second coordinate value are according to the longitudinal axis
Min coordinates value and maximum coordinate value among that direction determines, it is poor between first coordinate value in the Vcwn and Vccwp
The minimum coordinate value of the absolute value of value be the Vcwn and the Vccwp in the minimum coordinate value of value;
When the change in coordinate axis direction is X direction, first coordinate value, second coordinate value are according to the transverse axis
Maximum coordinate value among and min coordinates value that direction determines, it is poor between first coordinate value in the Vcwn and Vccwp
The minimum coordinate value of the absolute value of value be the Vcwn and the Vccwp in the maximum coordinate value of value;
When the change in coordinate axis direction is X direction, first coordinate value, second coordinate value are according to the transverse axis
Maximum coordinate value among and min coordinates value that direction determines, it is poor between first coordinate value in the Vcwn and Vccwp
The minimum coordinate value of the absolute value of value be the Vcwn and the Vccwp in the minimum coordinate value of value.
6. method according to claim 1, it is characterised in that the server determines institute according to the result of rasterization process
The projected area whether convex polygon is completely covered second virtual role is stated, including:
The projected area of second virtual role is divided into multiple projection grids by the server;
It is empty that the server determines whether the convex polygon is completely covered described second according to the result of the rasterization process
Intend all projection grids of role.
7. method according to claim 6, it is characterised in that it is big that the projection grid calculates grid in the following way
It is small:
Grid=Distance × 2 × tan (α/2);
Wherein, the Grid represents the sizing grid of the projection grid, and the Distance represents first virtual role
The distance between with second virtual role, the tan represents tan symbol, and the α represents the described first virtual angle
The view parameter of color.
8. a kind of server, it is characterised in that including:
Barrier projection module, the projection plane for barrier to be projected to the second virtual role, obtains the barrier
Convex polygon on the projection plane, the barrier is between the first virtual role and second virtual role;
Rasterization process module, for carrying out rasterization process to the convex polygon;
Projection judge module, for determining whether the convex polygon is completely covered described second according to the result of rasterization process
The shared projected area on the projection plane of virtual role;
Module is rejected in the visual field, if the projected area of second virtual role is completely covered for the convex polygon, will be described
Second virtual role is weeded out within sweep of the eye from first virtual role, and sending first visual field to client rejects knot
Really, the virtual scene that the client is used for where showing first virtual role, result is rejected in first visual field to be included:
Within sweep of the eye rejecting of second virtual role from first virtual role;
Sending module, if the projected area of second virtual role is not completely covered for the convex polygon, to described
Client sends second visual field and rejects result, and result is rejected in second visual field to be included:Second virtual role is in described
First virtual role is within sweep of the eye.
9. server according to claim 8, it is characterised in that the server also includes:Coordinate obtaining module and barrier
Hinder thing judge module, wherein,
The coordinate obtaining module, for obtaining first position coordinate of first virtual role in virtual scene;
The barrier judgment module, the visual angle for being used according to first virtual role is judged from the first position
To whether there is barrier on the straight line between second place coordinate, the second place coordinate is the described second virtual angle to coordinate
Position coordinates of the color in the virtual scene;If from the first position coordinate to the straight line the second place coordinate
On there is barrier, triggering performs the barrier projection module;
The sending module, if being additionally operable to not deposited from the first position coordinate to the straight line the second place coordinate
In barrier, send A Third Position to the client and reject result, the A Third Position rejects result to be included:Described second is empty
Intend role in first virtual role within sweep of the eye.
10. server according to claim 8, it is characterised in that the rasterization process module, specifically for performing such as
Lower step:
Step 1, the position coordinates on all summits of the acquisition convex polygon;
Step 2, the first coordinate value and the second coordinate are selected from the position coordinates on all summits according to change in coordinate axis direction
Value, first coordinate value, second coordinate value be according to the change in coordinate axis direction determine maximum coordinate value among and most sit for a while
Scale value, or first coordinate value, second coordinate value are the min coordinates value and most determined according to the change in coordinate axis direction
Global coordinate value;
Step 3, since first coordinate value along the convex polygon side respectively according to clockwise and counterclockwise
Direction travels through each summit of the convex polygon, during each summit is traveled through, line is carried out to the summit after traversal
The figure for constituting afterwards is rasterized, until completing rasterization process when eventually arriving at second coordinate value.
11. servers according to claim 10, it is characterised in that the rasterization process module, specifically for performing
Following steps:
Step 31, since first coordinate value, along the convex polygon side respectively according to clockwise and the inverse time
Pin direction gets the 3rd coordinate value and 4-coordinate value, the corresponding summit of the 3rd coordinate value, the 4-coordinate value pair
The summit answered summit all corresponding with first coordinate value is adjacent;
Step 32, first coordinate value is assigned to current vertex Vcw clockwise, the 3rd coordinate value is assigned to up time
First coordinate value is assigned to current vertex Vccw counterclockwise by the next summit Vcwn of pin, the Vcwn=next (Vcw),
The 4-coordinate value is assigned to next summit Vccwp counterclockwise, the Vccwp=prev (Vccw);
Step 33, rasterization process is carried out to the common portion that the first line segment and second line segment are constituted in the convex polygon,
First line segment includes:Line between the corresponding summits of Vcw and the corresponding summits of the Vcwn, the second line segment
Including:Line between the corresponding summits of Vccw and the corresponding summits of the Vccwp;
Step 34, the absolute value for selecting from the Vcwn and the Vccwp difference between first coordinate value are minimum
Coordinate value, if the absolute value of difference is minimum between the Vcwn and first coordinate value, along the convex polygon
While finding Five Axis value according to clockwise direction, the 3rd coordinate value is assigned to the Vcw, by the Five Axis value
The Vcwn is assigned to, step 33 is then re-executed, the corresponding summit of the Five Axis value and the 3rd coordinate value pair
The summit answered is adjacent;If the absolute value of difference is minimum between the Vccwp and first coordinate value, along described convex polygon
The 6th coordinate value is found in the side of shape according to counter clockwise direction, the 4-coordinate value is assigned into the Vccw, by the described 6th
Coordinate value is assigned to the Vccwp, then re-executes step 33, and the corresponding summit of the 6th coordinate value is sat with the described 4th
The corresponding summit of scale value is adjacent;When the value of the Vcw and the Vccw is all not equal to second coordinate value, re-execute
Step 33 and step 34, rasterization process is completed when the value of the Vcw or described Vccw is equal to second coordinate value.
12. servers according to claim 11, it is characterised in that when the change in coordinate axis direction is y direction, institute
It is the maximum coordinate value among and min coordinates value determined according to the y direction, institute to state the first coordinate value, second coordinate value
The minimum coordinate value of absolute value for stating the difference between first coordinate value in the Vcwn and Vccwp is the Vcwn and institute
State the coordinate value of value maximum in Vccwp;
When the change in coordinate axis direction is y direction, first coordinate value, second coordinate value are according to the longitudinal axis
Min coordinates value and maximum coordinate value among that direction determines, it is poor between first coordinate value in the Vcwn and Vccwp
The minimum coordinate value of the absolute value of value be the Vcwn and the Vccwp in the minimum coordinate value of value;
When the change in coordinate axis direction is X direction, first coordinate value, second coordinate value are according to the transverse axis
Maximum coordinate value among and min coordinates value that direction determines, it is poor between first coordinate value in the Vcwn and Vccwp
The minimum coordinate value of the absolute value of value be the Vcwn and the Vccwp in the maximum coordinate value of value;
When the change in coordinate axis direction is X direction, first coordinate value, second coordinate value are according to the transverse axis
Maximum coordinate value among and min coordinates value that direction determines, it is poor between first coordinate value in the Vcwn and Vccwp
The minimum coordinate value of the absolute value of value be the Vcwn and the Vccwp in the minimum coordinate value of value.
13. servers according to claim 8, it is characterised in that the barrier projection module, including:
Mesh generation module, for the projected area of second virtual role to be divided into multiple projection grids;
Grid Covering judgment module, for determining whether the convex polygon is completely covered according to the result of the rasterization process
All projection grids of second virtual role.
14. servers according to claim 13, it is characterised in that the projection grid calculates grid in the following way
Size:
Grid=Distance × 2 × tan (α/2);
Wherein, the Grid represents the sizing grid of the projection grid, and the Distance represents first virtual role
The distance between with second virtual role, the tan represents tan symbol, and the α represents the described first virtual angle
The view parameter of color.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710244220.2A CN106898051B (en) | 2017-04-14 | 2017-04-14 | A kind of visual field elimination method and server of virtual role |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710244220.2A CN106898051B (en) | 2017-04-14 | 2017-04-14 | A kind of visual field elimination method and server of virtual role |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106898051A true CN106898051A (en) | 2017-06-27 |
CN106898051B CN106898051B (en) | 2019-02-19 |
Family
ID=59196643
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710244220.2A Active CN106898051B (en) | 2017-04-14 | 2017-04-14 | A kind of visual field elimination method and server of virtual role |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106898051B (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108629180A (en) * | 2018-03-29 | 2018-10-09 | 腾讯科技(深圳)有限公司 | The determination method and apparatus of abnormal operation, storage medium, electronic device |
CN109045693A (en) * | 2018-07-26 | 2018-12-21 | 网易(杭州)网络有限公司 | Elimination method and device, the storage medium and electronic device of model |
CN110765975A (en) * | 2019-10-31 | 2020-02-07 | 腾讯科技(深圳)有限公司 | Method and device for judging cheating behaviors, storage medium and computer equipment |
CN110898432A (en) * | 2019-11-29 | 2020-03-24 | 腾讯科技(深圳)有限公司 | Demolition operation control method and device, storage medium, and electronic device |
CN111228821A (en) * | 2020-01-15 | 2020-06-05 | 腾讯科技(深圳)有限公司 | Method, device and equipment for intelligently detecting wall-penetrating plug-in and storage medium thereof |
CN111643896A (en) * | 2020-04-15 | 2020-09-11 | 完美世界(北京)软件科技发展有限公司 | Data processing method and device, storage medium and electronic device |
CN112044062A (en) * | 2020-08-27 | 2020-12-08 | 腾讯科技(深圳)有限公司 | Game picture rendering method, device, terminal and storage medium |
WO2021012557A1 (en) * | 2019-07-23 | 2021-01-28 | 网易(杭州)网络有限公司 | Method and device for information processing, and storage medium |
CN112562065A (en) * | 2020-12-17 | 2021-03-26 | 深圳市大富网络技术有限公司 | Rendering method, system and device of virtual object in virtual world |
JP2021140539A (en) * | 2020-03-06 | 2021-09-16 | Kddi株式会社 | Information system, terminal, server, and program |
CN113827984A (en) * | 2021-09-27 | 2021-12-24 | �田�浩 | Anti-cheating method and system for action game |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1949272A (en) * | 2006-11-23 | 2007-04-18 | 北京航空航天大学 | Method of complex situation quick drawing based on vision field rejecting and image buffer storage tech. |
CN102074004A (en) * | 2010-01-07 | 2011-05-25 | 董福田 | Method and device for determining type of barrier of spatial entity |
US20130207976A1 (en) * | 2010-06-30 | 2013-08-15 | Barry Lynn Jenkins | System and method of from-region visibility determination and delta-pvs based content streaming using conservative linearized umbral event surfaces |
CN106355644A (en) * | 2016-08-31 | 2017-01-25 | 北京像素软件科技股份有限公司 | Method and device for culling object models from three-dimensional video game pictures |
-
2017
- 2017-04-14 CN CN201710244220.2A patent/CN106898051B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1949272A (en) * | 2006-11-23 | 2007-04-18 | 北京航空航天大学 | Method of complex situation quick drawing based on vision field rejecting and image buffer storage tech. |
CN102074004A (en) * | 2010-01-07 | 2011-05-25 | 董福田 | Method and device for determining type of barrier of spatial entity |
US20130207976A1 (en) * | 2010-06-30 | 2013-08-15 | Barry Lynn Jenkins | System and method of from-region visibility determination and delta-pvs based content streaming using conservative linearized umbral event surfaces |
CN106355644A (en) * | 2016-08-31 | 2017-01-25 | 北京像素软件科技股份有限公司 | Method and device for culling object models from three-dimensional video game pictures |
Non-Patent Citations (1)
Title |
---|
季国红 等: ""三维游戏场景中动态物体的遮挡剔除算法"", 《微计算机信息(测控自动化)》 * |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108629180A (en) * | 2018-03-29 | 2018-10-09 | 腾讯科技(深圳)有限公司 | The determination method and apparatus of abnormal operation, storage medium, electronic device |
CN108629180B (en) * | 2018-03-29 | 2020-12-11 | 腾讯科技(深圳)有限公司 | Abnormal operation determination method and device, storage medium and electronic device |
CN109045693A (en) * | 2018-07-26 | 2018-12-21 | 网易(杭州)网络有限公司 | Elimination method and device, the storage medium and electronic device of model |
CN109045693B (en) * | 2018-07-26 | 2022-02-25 | 网易(杭州)网络有限公司 | Model eliminating method and device, storage medium and electronic device |
WO2021012557A1 (en) * | 2019-07-23 | 2021-01-28 | 网易(杭州)网络有限公司 | Method and device for information processing, and storage medium |
US11998839B2 (en) | 2019-07-23 | 2024-06-04 | Netease (Hangzhou) Network Co., Ltd. | Information processing method, apparatus and computer storage medium |
CN110765975A (en) * | 2019-10-31 | 2020-02-07 | 腾讯科技(深圳)有限公司 | Method and device for judging cheating behaviors, storage medium and computer equipment |
CN110898432A (en) * | 2019-11-29 | 2020-03-24 | 腾讯科技(深圳)有限公司 | Demolition operation control method and device, storage medium, and electronic device |
CN111228821A (en) * | 2020-01-15 | 2020-06-05 | 腾讯科技(深圳)有限公司 | Method, device and equipment for intelligently detecting wall-penetrating plug-in and storage medium thereof |
CN111228821B (en) * | 2020-01-15 | 2022-02-01 | 腾讯科技(深圳)有限公司 | Method, device and equipment for intelligently detecting wall-penetrating plug-in and storage medium thereof |
JP2021140539A (en) * | 2020-03-06 | 2021-09-16 | Kddi株式会社 | Information system, terminal, server, and program |
JP7319215B2 (en) | 2020-03-06 | 2023-08-01 | Kddi株式会社 | Information systems, terminals and programs |
CN111643896B (en) * | 2020-04-15 | 2021-12-28 | 完美世界(北京)软件科技发展有限公司 | Data processing method and device, storage medium and electronic device |
CN111643896A (en) * | 2020-04-15 | 2020-09-11 | 完美世界(北京)软件科技发展有限公司 | Data processing method and device, storage medium and electronic device |
CN112044062A (en) * | 2020-08-27 | 2020-12-08 | 腾讯科技(深圳)有限公司 | Game picture rendering method, device, terminal and storage medium |
CN112562065A (en) * | 2020-12-17 | 2021-03-26 | 深圳市大富网络技术有限公司 | Rendering method, system and device of virtual object in virtual world |
CN113827984A (en) * | 2021-09-27 | 2021-12-24 | �田�浩 | Anti-cheating method and system for action game |
CN113827984B (en) * | 2021-09-27 | 2023-12-12 | �田�浩 | Action game anti-plug-in method and system |
Also Published As
Publication number | Publication date |
---|---|
CN106898051B (en) | 2019-02-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106898051B (en) | A kind of visual field elimination method and server of virtual role | |
CN106296786B (en) | The determination method and device of scene of game visibility region | |
CN108648270B (en) | Unmanned aerial vehicle real-time three-dimensional scene reconstruction method capable of realizing real-time synchronous positioning and map construction | |
CN106548516B (en) | Three-dimensional roaming method and device | |
CN106157354B (en) | A kind of three-dimensional scenic switching method and system | |
TWI292552B (en) | Image processing method and apparatus | |
US8976168B2 (en) | Mesh generation from depth images | |
CN103226830A (en) | Automatic matching correction method of video texture projection in three-dimensional virtual-real fusion environment | |
CN109242961A (en) | A kind of face modeling method, apparatus, electronic equipment and computer-readable medium | |
WO2004111799A2 (en) | Systems and methods for using visual hulls to determine the number of people in a crowd | |
US7129951B2 (en) | Method and system for performing speculative collisions for a video game | |
CN104318605B (en) | Parallel lamination rendering method of vector solid line and three-dimensional terrain | |
KR20170086077A (en) | Using depth information for drawing in augmented reality scenes | |
CN110874812A (en) | Scene image drawing method and device in game and electronic terminal | |
EP4213102A1 (en) | Rendering method and apparatus, and device | |
US12045913B2 (en) | Method and apparatus for displaying virtual landscape picture, storage medium, and electronic device | |
WO2018214724A1 (en) | Object moving method and device, storage medium, and electronic device | |
Ohta et al. | Live 3D video in soccer stadium | |
CN111612898B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
Shiau et al. | Real-time network virtual military simulation system | |
Sudarsky et al. | Output-senstitive rendering and communication in dynamic virtual environments | |
Lee et al. | Panoramic mesh model generation from multiple range data for indoor scene reconstruction | |
CN106228509A (en) | Performance methods of exhibiting and device | |
CN114202607A (en) | System and method for hair rasterization | |
US20230123532A1 (en) | Method of generating multi-layer representation of scene and computing device implementing the same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |