CN110860088A - Rendering method and device of small map in racing game and game terminal - Google Patents

Rendering method and device of small map in racing game and game terminal Download PDF

Info

Publication number
CN110860088A
CN110860088A CN201911116200.2A CN201911116200A CN110860088A CN 110860088 A CN110860088 A CN 110860088A CN 201911116200 A CN201911116200 A CN 201911116200A CN 110860088 A CN110860088 A CN 110860088A
Authority
CN
China
Prior art keywords
distance
small map
minimap
rendering
display area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911116200.2A
Other languages
Chinese (zh)
Other versions
CN110860088B (en
Inventor
唐弢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201911116200.2A priority Critical patent/CN110860088B/en
Publication of CN110860088A publication Critical patent/CN110860088A/en
Application granted granted Critical
Publication of CN110860088B publication Critical patent/CN110860088B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/53Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game
    • A63F13/537Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game using indicators, e.g. showing the condition of a game character on screen
    • A63F13/5378Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game using indicators, e.g. showing the condition of a game character on screen for displaying an additional top view, e.g. radar screens or maps
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/803Driving vehicles or craft, e.g. cars, airplanes, ships, robots or tanks
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/807Gliding or sliding on surfaces, e.g. using skis, skates or boards
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/05Geographic models
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/80Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game specially adapted for executing a specific type of game
    • A63F2300/8017Driving on land or water; Flying
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/80Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game specially adapted for executing a specific type of game
    • A63F2300/8041Skating using skis, skates or board

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Remote Sensing (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Optics & Photonics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application provides a rendering method and device of small maps in a racing game and a game terminal, relates to the technical field of games, and can solve the technical problems that the workload of hand-drawing each small map is large, and the game manufacturing cost is high. The method comprises the following steps: determining a route of a virtual track in a racing game scene; generating a vertex and a vertex index of the small map model based on the route and a preset track width aiming at the small map; rendering the minimap model in the minimap display area. In one possible implementation, the route is a centerline of the virtual racetrack.

Description

Rendering method and device of small map in racing game and game terminal
Technical Field
The application relates to the technical field of games, in particular to a rendering method and device of a small map in a racing game and a game terminal.
Background
The racing games comprise speed games such as driving games, skateboard games, skating games, walking games or running games.
For example, a racing game, which is a racing game, refers to a game in which a player drives a virtual vehicle in the game, travels from a starting point to an ending point on a virtual road in the game, and ranks the virtual vehicle at a fixed time. The player can control the accelerator, the brake, the steering wheel, the hand brake, the gear and the like of the virtual vehicle in the game in the modes of a handle, a keyboard, a mobile phone touch key and the like, so that the driving behavior and experience in the approaching reality are realized.
Currently, in a racing game, to facilitate a player's judgment of a road ahead, a small map of a virtual track is displayed on a graphical user interface. The existing minimap adopts a method of rendering a hand-drawn map into a display picture. However, the hand-drawing of each small map requires a large amount of work, which results in a high game production cost.
Disclosure of Invention
The invention aims to provide a rendering method and device of a small map in a racing game and a game terminal, and aims to solve the technical problems that the workload of hand-drawing each small map is large, and the game making cost is high.
In a first aspect, an embodiment of the present application provides a method for rendering a minimap in a racing game, which is applied to a game terminal having a graphical User Interface (UI), where the graphical User Interface is preconfigured with a minimap display area, and the method includes:
determining a route of a virtual track in a racing game scene;
generating a vertex and a vertex index of the small map model based on the route and a preset track width aiming at the small map;
rendering the minimap model in the minimap display area.
In one possible implementation, the route is a centerline of the virtual racetrack.
In one possible implementation, the step of generating vertices and vertex indices of the minimap model based on the route and a preset course width for the minimap comprises:
selecting a plurality of first target points at equal intervals on the central line based on a preset interval;
respectively taking the first target points as vertical feet, and determining a plurality of second target points with equal vertical distances, wherein the vertical distances are determined according to the preset track width aiming at the small map;
and taking a plurality of second target points as vertexes of a triangular surface of the small map model, and determining a vertex index.
In one possible implementation, the centerline is comprised of a plurality of consecutive line segments; based on the preset distance, the step of selecting a plurality of first target points at equal intervals on the central line comprises the following steps:
for each of the first target points:
determining a first distance from the first target point to the starting point of the central line based on a preset distance;
and determining a first line segment where the first target point is located in a plurality of continuous line segments according to the first distance, and taking the coordinate of the first position of the first line segment corresponding to the first target point as the coordinate of the first target point.
In one possible implementation, the step of rendering the minimap model in the minimap display area includes:
determining a current second position of a target virtual object in the racing game in the scene;
rendering a portion of the minimap model corresponding to the second location in the minimap display area.
In one possible implementation, the step of rendering a portion of the minimap model corresponding to the minimap model at the second location in the minimap display area includes:
determining the coordinates of an alignment point of the camera according to the second position;
determining a projection matrix of the camera according to the alignment point coordinates and the coordinate offset of the camera and the target virtual object;
mapping the small map model into a two-dimensional road plane according to the projection matrix;
rendering a portion of the two-dimensional road plane corresponding to the second location in the small map display area.
In one possible implementation, the step of mapping the minimap model to a two-dimensional road plane according to the projection matrix includes:
mapping the vertex coordinates of the triangular surface of the small map model into two-dimensional display coordinates according to the projection matrix;
and offsetting the two-dimensional display coordinate according to the preset display position of the small map display area to obtain a two-dimensional positioning coordinate for the small map display area.
In one possible implementation, the step of rendering a portion of the two-dimensional road plane corresponding to the second location in the small map display area includes:
discarding the two-dimensional positioning coordinates exceeding the small map display area according to the two-dimensional positioning coordinates and the preset display size of the small map display area;
and rendering the display effect corresponding to the residual two-dimensional positioning coordinates in the small map display area.
In one possible implementation, the display effect includes a blur effect; rendering the display effect corresponding to the remaining two-dimensional positioning coordinates in the small map display area, wherein the rendering step comprises the following steps:
for each remaining two-dimensional positioning coordinate, determining a third distance between the two-dimensional positioning coordinate and the center of the small map display area, and rendering a fuzzy effect corresponding to the third distance in the small map display area.
In one possible implementation, a first threshold and a second threshold are configured in advance, and the first threshold is smaller than the second threshold;
for the two-dimensional positioning coordinate with the third distance between the first threshold and the second threshold, the fuzzy effect corresponding to the third distance is that the closer the distance to the center of the small map display area is, the lower the transparency is;
for the two-dimensional positioning coordinates for which the third distance is less than the first threshold, the blurring effect corresponding to the third distance is opaque;
for the two-dimensional positioning coordinates where the third distance is greater than the second threshold, the blurring effect corresponding to the third distance is completely transparent.
In one possible implementation, a third threshold and a fourth threshold are preconfigured, and the third threshold is greater than the fourth threshold; rendering a blur effect corresponding to the third distance in the small map display area, including:
for each of the two-dimensional positioning coordinates, determining a center-of-distance percentage from the third distance, wherein the larger the third distance, the smaller the center-of-distance percentage;
wherein, for the two-dimensional positioning coordinate with the distance center percentage between the third threshold and the fourth threshold, the blurring effect corresponding to the third distance is that the smaller the distance center percentage is, the lower the transparency is;
for the two-dimensional positioning coordinates for which the distance center percentage is less than the fourth threshold, the blur effect corresponding to the third distance is opaque;
for the two-dimensional positioning coordinates for which the center percentage of distance is greater than the third threshold, the blurring effect corresponding to the third distance is completely transparent.
In one possible implementation, the step of determining a projection matrix of the camera based on the alignment point coordinates and the coordinate offset of the camera from the target virtual object comprises:
determining a current directly-above direction of the camera;
and determining a projection matrix of the camera according to the alignment point coordinate, the coordinate offset and the right-above direction.
In a second aspect, a minimap rendering device in a racing game is provided, which is applied to a game terminal having a graphical user interface, where the graphical user interface is configured with a minimap display area in advance, and the device includes:
the determining module is used for determining a route of a virtual track in a racing game scene;
the generating module is used for generating a vertex and a vertex index of the small map model based on the route and the preset track width aiming at the small map;
and the rendering module is used for rendering the small map model in the small map display area.
In a third aspect, an embodiment of the present application further provides a game terminal, including a memory and a processor, where the memory stores a computer program executable on the processor, and the processor implements the method of the first aspect when executing the computer program.
In a fourth aspect, this embodiment of the present application further provides a computer-readable storage medium storing machine executable instructions, which, when invoked and executed by a processor, cause the processor to perform the method of the first aspect.
The embodiment of the application brings the following beneficial effects:
according to the rendering method, device and game terminal of the minimap in the racing game, firstly, the route of the virtual track in the racing game scene is determined, the vertex and vertex index of the minimap model are generated based on the route and the preset track width of the minimap, then the minimap model is rendered in the minimap display area, the vertex and vertex index can be generated through the route of the virtual track and the preset track width in the minimap, the automatic generation of the minimap model is realized, and the generated minimap model can be directly rendered in the minimap display area, so that compared with the existing hand-drawn picture, the minimap does not need to be made in advance, and the game making cost is reduced.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the detailed description of the present application or the technical solutions in the prior art, the drawings needed to be used in the detailed description of the present application or the prior art description will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a touch terminal according to an embodiment of the present disclosure;
fig. 3 is a schematic view of an application scenario of a touch terminal according to an embodiment of the present application;
fig. 4 is a schematic flow chart of a rendering method of a minimap in a racing game according to an embodiment of the present application;
FIG. 5 is a diagram illustrating a structure of vertices and vertex indices provided by an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a graphical user interface for displaying a racing game provided by an embodiment of the present application;
fig. 7 is a schematic structural diagram of a center line and a door in the method for rendering a mini map in a racing game provided in the embodiment of the present application;
fig. 8 is a schematic structural diagram of a minimap model displayed in a minimap display area according to an embodiment of the present disclosure;
FIG. 9 is a schematic structural diagram of another graphical user interface for displaying a racing game provided in an embodiment of the present application;
FIG. 10 is a schematic diagram of another configuration of a graphical user interface for displaying a racing game provided by an embodiment of the present application;
fig. 11 provides a schematic structural diagram of a minimap rendering device in a racing game.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "comprising" and "having," and any variations thereof, as referred to in the embodiments of the present application, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Currently, in a racing game, in order to facilitate a player to determine a road ahead, a small map as a virtual track is displayed on a UI. The UE4 engine provides the function of displaying a picture in a rendered screen, and most current minimaps employ a method of rendering a hand-drawn map in a displayed screen. While the UE4 engine also provides the functionality to render a model into a display.
In the prior art, a producer draws a map by hand, adds the map to a picture rendered by an engine, and finally provides the map to a display device to be displayed to a player. The existing scheme has the following disadvantages:
the workload of making each map by hand drawing is large, the modification of an actual virtual scene is not facilitated, and if the virtual scene is modified, the small map also needs to be correspondingly redrawn; the use of the graphic storage mode has large occupied storage space, slow loading during game running and large occupied memory, which may reduce game performance, and for example, the size of 512 × 512 needs to occupy 1M storage space or memory without compression. Meanwhile, one track needs one hand-drawn map, and the storage space occupied by the track is finally 1M multiplied by the number of the tracks; the map resource is a 2D scene, and can only provide an overhead view, and the effect of a 3D scene cannot be realized.
Based on this, the rendering method and device for the small maps in the racing game and the game terminal provided by the embodiment of the application can solve the technical problems that the workload of hand-drawing each small map is large, and the game manufacturing cost is high.
In order to facilitate understanding of the embodiment, first, a method, an apparatus and a game terminal for rendering a small map in a racing game disclosed in the embodiment of the present application are described in detail.
The rendering method of the small map in the racing game in the embodiment of the application can be applied to game terminals capable of running games, such as touch terminals, game machines, Personal Computers (PCs) and the like.
The embodiment of the present application takes a touch terminal as an example for description. The touch terminal includes a touch screen for presenting a graphical user interface and receiving an operation for the graphical user interface and a processor.
In some embodiments, when the touch terminal operates the graphical user interface, the graphical user interface may be used to operate content local to the touch terminal, and may also be used to operate content of the peer server.
For example, as shown in fig. 1, fig. 1 is a schematic view of an application scenario provided in the embodiment of the present application. The application scenario may include a touch terminal (e.g., a cell phone 102) and a server 101, and the touch terminal may communicate with the server 101 through a wired network or a wireless network. The touch terminal is used for running a virtual desktop, and can interact with the server 101 through the virtual desktop to operate the content in the server 101.
The touch terminal of the present embodiment is described by taking the mobile phone 102 as an example. The handset 102 includes Radio Frequency (RF) circuitry 110, memory 120, a touch screen 130, a processor 140, and the like. Those skilled in the art will appreciate that the handset configuration shown in fig. 2 is not intended to be limiting and may include more or fewer components than those shown, or may combine certain components, or split certain components, or arranged in different components. Those skilled in the art will appreciate that the touch screen 130 is part of a User Interface (UI) and that the cell phone 102 may include fewer than or the same User Interface as illustrated.
The RF circuitry 110 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (short messaging Service), etc.
The memory 120 may be used to store software programs and modules, and the processor 140 executes various functional applications and data processing of the handset 102 by executing the software programs and modules stored in the memory 120. The memory 120 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the stored data area may store data created from use of the handset 102, and the like. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The touch screen 130 may be used to display a graphical user interface and receive user operations with respect to the graphical user interface. A particular touch screen 130 may include a display panel and a touch panel. The display panel may be configured in the form of an LCD (Liquid crystal display), an OLED (Organic Light-Emitting Diode), and the like. The touch panel may collect contact or non-contact operations of a user on or near the touch panel (for example, as shown in fig. 3, operations of the user on or near the touch panel using any suitable object or accessory such as a finger 103, a stylus pen, etc.), and generate preset operation instructions. In addition, the touch panel may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction and gesture of a user, detects signals brought by touch operation and transmits the signals to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into information that can be processed by the processor, sends the information to the processor 140, and receives and executes a command sent by the processor 140. In addition, the touch panel may be implemented by various types such as a resistive type, a capacitive type, an infrared ray, a surface acoustic wave, and the like, and may also be implemented by any technology developed in the future. Further, the touch panel may cover the display panel, a user may operate on or near the touch panel covered on the display panel according to a graphical user interface displayed by the display panel, the touch panel detects an operation thereon or nearby and transmits the operation to the processor 140 to determine a user input, and the processor 140 provides a corresponding visual output on the display panel in response to the user input. In addition, the touch panel and the display panel can be realized as two independent components or can be integrated.
The processor 140 is the control center of the handset 102, connects various parts of the entire handset using various interfaces and lines, and performs various functions and processes of the handset 102 by running or executing software programs and/or modules stored in the memory 120 and calling data stored in the memory 120, thereby performing overall monitoring of the handset.
The handset 102 also includes a power supply (e.g., a battery) for powering the various components, which may be logically coupled to the processor 140 via a power management system to manage charging, discharging, and power consumption via the power management system.
Embodiments of the present invention are further described below with reference to the accompanying drawings.
Fig. 4 is a schematic flow chart of a rendering method of a small map in a racing game according to an embodiment of the present application. The method is applied to a game terminal with a graphical user interface, and the graphical user interface is configured with a small map display area in advance. As shown in fig. 4, the method includes:
s410, determining a route of the virtual track in the racing game scene.
The racing game may be a racing game such as a driving game, a skateboard game, a skating game, a walking race or a running race, and the embodiment of the present application takes the racing game as an example of a racing game. In the scene of a racing game, there are virtual vehicles and virtual tracks.
The virtual track refers to an area where a target virtual object manipulated by a player can go in a virtual scene of the racing game, and a large number of virtual tracks can be selected by the player. In this embodiment, the virtual track refers to an area in a racing game where a virtual vehicle manipulated by a player can be driven.
The route of the virtual racetrack may be the edge lines along the roads on either side of the racetrack; or the center line of the track; it may also be a track, in which the distance ratio to the two side edges of the track is always constant, for example, the distance ratio of the track to the two side edges of the track is always 4: 6.
and S420, generating vertexes and vertex indexes of the small map model based on the route and the preset track width aiming at the small map.
The small map can be a thumbnail map of the virtual game scene, and the thumbnail map can be processed again based on the virtual game scene so as to highlight virtual roads and important places in the map and ignore information such as actual terrain and ground surface color. In this embodiment, the minimap may display a thumbnail map including a virtual track in the virtual game scene, or may display only information of the virtual track.
The model refers to an object in a virtual scene, and the basic unit is a vertex and a surface, for example, a square has 12 vertices and 6 surfaces. The minimap model represents a description of a three-dimensional (3D) object using a defined language structure or data structure, which may include geometric, viewpoint, texture, and lighting information.
The model can be made by using an animation rendering and making software tool, and the minimap model in the embodiment of the application can be made by using three-dimensional animation rendering and making software (3D Studio Max, 3D Max) based on a PC system.
The preset track width for the minimap refers to a preset width of the track in the minimap model, which is generally smaller than the width of the virtual track in step S410.
For the vertices and vertex indices, it should be noted that in the 3D game, a surface is composed of vertices and vertex indices. The vertex contains a 3-dimensional coordinate (x, y, z) representing the world coordinates of the vertex in the 3D game. The vertex indices are arrays of 3 integers representing the faces of the three vertices.
For example, as shown in fig. 5, the parallelogram plane includes four vertexes v0, v1, v2, v3, and the index [0,1,2] indicates a triangular plane composed of vertexes v0, v1, and v2, and [1,2,3] indicates a triangular plane composed of vertexes v1, v2, and v3, so that the index of the entire parallelogram plane is [0,1,2,1,2,3 ].
And S430, rendering the minimap model in a minimap display area.
The small map display area may be of any shape, such as square, oval, etc. The minimap display area may also be located anywhere in the graphical user interface, for example, at the top left or bottom left corner of the graphical user interface. As shown in fig. 6, a minimap display area 601 is located in the upper right corner of the graphical user interface.
Rendering refers to the process of converting virtual objects from a model to a generated image in a computer drawing by software to provide the generated image to a display for display.
In this embodiment of the application, the minimap model may be generated through steps S410 and S420, and then the process of rendering the minimap model may be completed through step S430.
The vertex and the vertex index can be generated through the route of the virtual track and the preset track width in the minimap, and the automatic generation of the minimap model is realized. Because the generated small map model can be directly rendered into the final picture, compared with the existing hand-drawn picture, the small map does not need to be manufactured in advance, and the game manufacturing cost is reduced. In addition, a plurality of small maps with larger memories are omitted, the storage space and the occupation of the memories are saved, and the running efficiency of the game is improved.
The above steps are described in detail below.
In some embodiments, the route may have multiple representations. As an example, the route is located on a center line of the track, and based on this, the route is a center line of the virtual track. The center line may be based on a center line generated by the virtual track, or may be directly determined from a center line set in advance when the virtual track is designed.
By using the center line of the virtual track as the route of the virtual track, the track in the finally obtained small map model can better accord with the exact position of the virtual track.
Based on this, a minimap model may be generated based on the centerline to reduce deviations in track positions in the resulting minimap model. As an example, the step S420 may include the following steps:
a, selecting a plurality of first target points at equal intervals on a central line based on a preset interval;
step b, respectively taking the first target points as vertical feet, determining a plurality of second target points with equal vertical distances, wherein the vertical distances are determined according to the preset track width aiming at the small map;
and c, taking the plurality of second target points as the vertexes of the triangular surface of the small map model, and determining a vertex index.
For the step a, a plurality of first target points of the selected center line may be equally spaced from the start point to the end point of the center line, wherein the spacing may be a preset spacing.
For the step b, for each first target point, two second target points are respectively determined on two sides of the central line, a straight line formed by the two second target points and the first target point is perpendicular to the central line, and the distances between the two second target points and the first target point are equal, wherein the equal distance is determined according to the preset track width for the small map.
Furthermore, for each first target point, two second target points corresponding to each first target point may be determined in various ways.
As an example, two parallel lines equidistant from the center line may be determined, and then two second target points corresponding to the first target point may be determined on the two parallel lines. For example, the step b may include the steps of:
determining two parallel lines which are equidistant and parallel to the central line on two sides of the central line, wherein the equidistant distance is determined according to the preset track width aiming at the small map; the normal of the central line is determined at the first target point, and the two intersections of the normal with the two parallel lines are taken as two second target points. Wherein, the normal is a direction parallel to the ground of the track and perpendicular to the line segment.
As another example, a normal perpendicular to the centerline may be determined and two second object points equidistant from the first object point may be determined on the normal. For example, the step b may include the steps of:
determining a normal to the centerline at the first target point; wherein, the normal is the direction parallel to the ground of the track and vertical to the line segment; two second target points which are positioned at two sides of the first target point and are equidistant from the first target point are determined on the normal line, wherein the distance of the equal distance is determined according to the preset track width aiming at the small map.
Of course, as another example, it is also possible to determine line segments perpendicular to the center line and having the same length, and then determine the second target point according to end points of the two ends of the line segments. For example, the step b may further include the steps of:
determining a normal of the centre line at the first target point, the normal being parallel to the track ground and perpendicular to the line segment; generating a line segment which passes through the first target point and takes the first target point as a central point on the normal line, wherein the length of the line segment is determined according to the preset track width aiming at the small map; and taking the end points at the two ends of the line segment as two second target points.
The line segment may be referred to as a gate 701, and as shown in fig. 7, the tangential direction of the center point (i.e., the first target point 702) of each gate at the centerline 703 is perpendicular to the gate 701.
For step c above, as an example, a vertex and a vertex index may be determined from the two endpoints of the door 701, and then a minimap model may be generated. For example, let the two endpoints of the nth gate be the vertex Vn and the vertex Vn+1Two end points of the (n + 1) th gate are used as vertexes Vn+2And vertex Vn+3The vertexes of the two triangular surfaces formed are Vn and Vn respectively+1、Vn+2And Vn+1、Vn+2、Vn+3The face between the nth gate and the n +1 th gate is indexed by vertex [ Vn, Vn +1,Vn+2,Vn+1,Vn+2,Vn+3]And (4) forming.
Through the steps a, b and c, the minimap model obtained by the vertex and the vertex index can be more suitable for the virtual track in the racing game scene, so that the finally obtained minimap model is more vivid.
Based on the above steps a, b and c, the coordinates of the first target point can be calculated according to the preset distance, so as to calculate more accurate coordinates of the first target point. As one example, the centerline is composed of a plurality of continuous line segments; the step a may include the steps of:
for each first target point:
step d, determining a first distance from the first target point to the starting point of the central line based on the preset distance;
and e, determining a first line segment where the first target point is located in the plurality of continuous line segments according to the first distance, and taking the coordinate of the first position of the first line segment corresponding to the first target point as the coordinate of the first target point.
For a center line composed of a plurality of continuous line segments, the center line is exemplarily composed of a plurality of continuous line segments S1, S2, S3, … Sn, each line segment S is composed of front and rear end points Vs and Ve, where Vs is a starting end point and Ve is an ending end point. Each endpoint V consists of one world coordinate (x, y, z). A continuous line segment means that the end point Ve for the preceding line segment is the end point Vs of the following line segment. For each line segment S, the length L of the line segment S can be calculated from the vector obtained by subtracting the two end points. In the embodiment of the present application, the sum of the lengths of N line segments may be denoted as En, and En is obtained by accumulating the lengths L of the first N line segments S.
For the above steps D and e, exemplarily, a plurality of first target points H are equidistantly selected on the central line based on the length D of the preset interval1、H2、H3… Hy. For each first target point H, the coordinates thereof may be accumulated for N line segments S according to the line segment SAnd calculating the length En and the length D of the preset interval. For example, for the ith first target point HiThe coordinates of (a) may be calculated in the following manner:
first, the ith first target point H is obtainediOn the second segment S, the length of En can be compared by (i × D). If En is satisfied<i*D<En+1The ith point is on the segment Sn of the centerline. The ratio P of the first target point Hi to the starting end point Vs (vs.x, vs.y, vs.z) of the line segment Sn near the line segment S can be obtained from (D × i-En)/(En + 1-En). Then HiThe coordinates of (H.x, H.y, H.z) are:
H.x=Vs.x+(Ve.x–Vs.x)*P;
H.y=Vs.y+(Ve.y–Vs.y)*P;
H.z=Vs.z+(Ve.z–Vs.z)*P;
where, (ve.x, ve.y, ve.z) is the coordinate of the end point Ve of the line segment S.
Next, after obtaining the coordinates of the first target point, for the step b, the coordinates of the second target point may be calculated by using the preset track width for the minimap, the normal, and the coordinates of the first target point Hi. The description will be continued by taking the door X01 as an example.
For each first target point H, a gate is generated at H, the center point of the gate is H, the length of the gate is a preset track width for the minimap, and is set as C. And producing y gates, wherein the end points of the two ends of each gate are the second target points. The coordinates of the second target point may be calculated from the coordinates of the first target point and the preset track width C for the minimap.
For example, for each segment S on the central line, there is a corresponding normal line parallel to the ground of the track and perpendicular to the segment S, and the normal line of the nth segment Sn on the central line is Nn; the two endpoint coordinates of the door (coordinates of the second target point) calculation process may be:
by adding and subtracting C/2 × N to and from Hi (H.x, H.y, H.z), respectively, according to the preset length C of the gate, the coordinates of the two end points (the coordinates of the second target point) HS and HE of the gate can be obtained. The coordinates of HS (hs.x, hs.y, hs.z) and HE (he.x, he.y, he.z) are:
HS.x=H.x+C/2*Nn.x;
HS.y=H.y+C/2*Nn.y;
HS.z=H.z+C/2*Nn.z;
HE.x=H.x–C/2*Nn.x;
HE.y=H.y–C/2*Nn.y;
HE.z=H.z–C/2*Nn.z。
next, after obtaining the coordinates of the two end points (second target points), for step c, the minimap model may be generated by obtaining the vertex and the vertex index from the coordinates of the two end points (coordinates of the second target points). The description will be continued by taking the door X01 as an example.
The coordinates of the second target point are taken as the vertex, i.e. the list of HS and HE mentioned above: v1=HS1,V2=HE1,V3=HS2… and so on. It can be seen that V2n-1=HSn,V2n=HenAnd then [1,2,3, 2,3, 4, 3, 4, 5, 4, 5, 6 …]The vertex index rule in this embodiment may be derived that the vertex indexes corresponding to the vertices in this embodiment are [ V2n-1, V2n, V2n +1, V2n, V2n +1, V2n +2]And so on.
The calculated coordinates of the first target point can be more accurate through the line segments divided by the preset distance and the central line, and the coordinates of the more accurate second target point can be conveniently determined subsequently. And then, the calculated coordinates of the second target point can be more accurate by aiming at the preset track width of the small map and the coordinates of the first target point, so that more reasonable vertexes and vertex indexes can be conveniently determined subsequently, the finally generated small map model is more similar to the virtual track in the racing car game scene, a player can conveniently judge the direction to be driven of the racing car, and the experience of the racing game is improved.
The above is an example where the representation of the route is a center line, and as another example of the representation of the route, the route may also be located at the edge of a road on either side of the track, for example, the route is an edge line along a road on either side of the track.
Based on this, the step S420 may include the following steps:
step x, selecting a plurality of third target points on the edge line at equal intervals based on the preset intervals;
step y, taking the plurality of third target points as vertical feet respectively, determining a plurality of fourth target points with equal vertical distances on one side of the edge line, wherein the vertical distances are determined according to the preset track width aiming at the small map;
and step z, taking the plurality of second target points as the vertexes of the triangular surface of the small map model, and determining a vertex index.
For the step y, it should be noted that each third target point corresponds to one fourth target point, and all the fourth target points are located on one side of the track opposite to the edge line. Because the width of the virtual track is not always consistent, but the preset track width for the minimap is consistent, some fourth target points may be located on the virtual track, some fourth target points may be located on the edge line on the other side of the virtual track, and other fourth target points may be located outside the virtual track.
For the above step x, the coordinates of each third target point, which corresponds to the first target point in the above step d and step e, and the edge line which corresponds to the center line in the above step d and step e, may be determined by a process similar to the above step d and step e. For example, the step x may specifically include the following steps:
for each third target point: determining a second distance from the third target point to the starting point of the edge line based on the preset distance; and determining a second line segment where the third target point is located in the plurality of continuous line segments according to the second distance, and taking the coordinates of the second line segment corresponding to the position of the third target point as the coordinates of the third target point.
In some embodiments, a minimap model may be rendered based on the location of the target virtual object in the race game, enabling the player to view the more exact location of the virtual object that he or she manipulates. As an example, the step S430 may include the following steps:
f, determining the current second position of the target virtual object in the scene in the racing game;
and g, rendering the part of the small map model corresponding to the second position of the small map model in the small map display area.
For step f above, the target virtual object may be a virtual vehicle, a virtual bicycle, a virtual human, a virtual skateboard, or the like. For example, the target virtual object is a virtual vehicle in a racing game scene, and the target virtual object is a virtual human in a racing game scene. The embodiments of the present application take a target virtual object as an example of a virtual vehicle.
For the above step g, in practical applications, the minimap model may be a fixed model generated through the above steps S410 to S430, and the rendered image displayed in the minimap display area is dynamic because the position of the virtual vehicle in the virtual scene displayed in the image changes under the control of the player.
In this step, the displayed image is determined based on the current position of the virtual vehicle. For example, as shown in fig. 8, a local minimap model within a certain range around a virtual vehicle 801 controlled by a player may be displayed in the minimap display area, and the local minimap model displayed in the minimap display area is updated according to changes caused by movement of the virtual vehicle.
Of course, the track that can be displayed in the small map display area may also be determined to be unchanged, for example, when the virtual track is short enough to display the complete small map model in the small map display area, the track displayed in the small map display area may be unchanged, and only the position of the virtual vehicle is updated in a changing manner.
Therefore, based on the minimap model generated and determined, the current position and the surrounding environment of the virtual vehicle can be displayed dynamically in real time when the virtual vehicle moves, the virtual vehicle operated by the player can be always kept in the minimap model, and the player can conveniently view the specific detailed position of the virtual vehicle.
As shown in fig. 6, 9 and 10, in the user graphic interface, in addition to the minimap model in the minimap display area 601, at least one of the following can be displayed: various player operation controls such as the virtual racing car 602, the direction operation control 603, the drift control 901, the brake control 1001 and the like are used for facilitating the player to control the virtual vehicle such as the virtual racing car and the like in various aspects such as accurate speed, direction and the like.
In some embodiments, the scene represented by the small map model may be a two-dimensional (2D) scene, or may be a 3D scene. The following description will take a scene of a small map as a 3D scene as an example.
Based on steps f and g above, the model vertices can be transformed to a 2D screen using the alignment point coordinates of the camera and the coordinate offset of the camera from the car. As an example, the step g may include the steps of:
h, determining the coordinate of the alignment point of the camera according to the second position;
step i, determining a projection matrix of the camera according to the coordinate of the alignment point and the coordinate offset of the camera and the target virtual object;
step j, mapping the small map model into a two-dimensional road plane according to the projection matrix;
and k, rendering the part of the two-dimensional road plane corresponding to the second position in the small map display area.
Wherein the alignment point coordinates of the camera refer to the coordinates of the point LookAt at which the camera is aligned. The coordinate Offset refers to the camera Offset from the coordinate Offset of the virtual vehicle.
The matrix is a 4 × 4 matrix. The matrix multiplied by the world coordinates (x, y, z) may represent a transformation of the coordinates, the effect of which may include rotation, translation, scaling, etc. Multiplying all vertices in the minimap model by the matrix represents a 3D transformation of the minimap model as a whole.
For the projection matrix of the camera, it may be the projection matrix MP calculated from this world coordinate (x, y, z). For example, each vertex in the minimap model is multiplied by the transformation matrix to perform 3D transformation on the vertex of the minimap model, so that a 3D scene effect of the minimap model is displayed in a 2D screen, and the game experience of a player is improved.
Based on the steps h, i, j and k, the two-dimensional road plane corresponding to the small map model can be obtained by mapping the vertex coordinates of the triangular surface in the small map model into two-dimensional positioning coordinates. As an example, the step j may include the steps of:
step m, mapping the vertex coordinates of the triangular surface of the small map model into two-dimensional display coordinates according to the projection matrix;
and n, offsetting the two-dimensional display coordinate according to the preset display position of the small map display area to obtain a two-dimensional positioning coordinate for the small map display area.
In practical application, the coordinates of the 3D minimap model displayed on the 2D graphical user interface can be obtained by using all the vertex coordinates in the minimap model, so that the 2D image displayed on the 2D graphical user interface shows virtual objects in the 3D scene more accurately and truly.
Based on the above steps m and n, the vertices of the minimap model beyond the display area of the minimap can be discarded. As an example, the step k may include the steps of:
step o, discarding the two-dimensional positioning coordinates exceeding the small map display area according to the two-dimensional positioning coordinates and the preset display size of the small map display area;
and step p, rendering the display effect corresponding to the residual two-dimensional positioning coordinates in the small map display area.
Since the screen on which the graphic user interface is presented is a 2D image, only the 2D coordinates of (x, y) are set as the ScreenPosition. The coordinates may be in the upper left corner of the screen (or other location in the screen) as the origin. The preset size of the small map model displayed on the screen can be set to Width and Height, and the preset Position can be set to Mini map Position. The Mini map Position is also the 2D coordinate of (x, y). For each vertex of the minimap model to be converted to the Screen Position of the Screen coordinates, the Mini map Position is subtracted therefrom, and the vertex of the minimap model on the Screen can be converted to the offset Relative Position with respect to the starting point of the minimap. Namely:
Relative Position=Screen Position–Mini map Position。
with Relative Position, vertices in the minimap model that exceed the display area can be discarded, for example, vertices that satisfy the following condition are discarded:
Relative Position.x<0;
Relative Position.x>Width;
Relative Position.y<0;
Relative Position.y>Height。
by the method, the vertexes exceeding the small map display area in the small map model can be discarded more accurately, so that the boundary display of the small map display area is more accurate.
Based on the step o and the step p, the transparency of the vertex in the small map model can be calculated according to the distance between the vertex and the current world coordinate of the virtual vehicle, so that the displayed small map model is more vivid and does not appear hard. As one example, the display effect includes a blur effect; the step p may include the steps of:
and q, determining a third distance between the two-dimensional positioning coordinate and the center of the small map display area for each residual two-dimensional positioning coordinate, and rendering a fuzzy effect corresponding to the third distance in the small map display area.
Illustratively, the transparency of the vertex in the small map model can be calculated according to the distance from the Relative Position to the center of the small map display area, so that the effect of blurring the edge of the small map display area is achieved, the displayed small map model is more vivid and not hard, and the game experience of a user is improved.
Based on the step q, the blurring effect corresponding to the third distance may include various implementations.
As one example, the blurring effect of different degrees of transparency may be achieved by calculating the degree of transparency of a vertex in the minimap model from its distance percentage from the virtual vehicle coordinates. For example, a third threshold and a fourth threshold are preconfigured, and the third threshold is greater than the fourth threshold; the step q may include the steps of:
for each two-dimensional positioning coordinate, determining the percentage of the distance from the center according to the third distance, wherein the larger the third distance is, the smaller the percentage of the distance from the center is;
for the two-dimensional positioning coordinate with the distance center percentage between the third threshold value and the fourth threshold value, the fuzzy effect corresponding to the third distance is that the smaller the distance center percentage is, the lower the transparency is;
for the two-dimensional positioning coordinates with the distance center percentage smaller than the fourth threshold, the fuzzy effect corresponding to the third distance is opaque;
for two-dimensional positioning coordinates having a percentage of distance from the center greater than a third threshold, the blurring effect corresponding to the third distance is completely transparent.
The specific calculation method of the distance may be: first, the Center coordinate of the display area is calculated, namely, Center is (Width/2, Height/2), and then the distance between the Relative Position and the Center on the X axis and the Y axis is calculated:
Percent X=(Relative Position.X–Center.X)/Center.X;
Percent Y=(Relative Position.Y–Center.Y)/Center.Y。
next, the absolute value of the larger of the absolute values of Percent X and Percent Y is taken as the distance from the center: percent Max (abs (Percent x), abs (Percent y)); where Max indicates the larger of the two, and Abs indicates the absolute value.
To facilitate the adjustment of the blurring effect, two variables Dim Start and Dim End are introduced that can be configured. The value is [0,1], Dim Start indicates how much percentage from the center starts to blur, Dim End indicates how much percentage from the center is completely transparent, i.e. Alpha is 0. For example, Dim Start is 0.6 and Dim End is 0.9. The transparency of the vertex starts to be decreased when Percent is 0.6 and is completely decreased to 0 when Percent is 0.9. The calculation formula of the transparency can be obtained according to the above rules as follows:
when Percent < Dim Start is satisfied, Alpha is 1.0;
when Percent > Dim End is satisfied, Alpha is 0.0;
when Dim Start < Percent < Dim End, Alpha is 1- (Percent-Dim Start)/(Dim End-Dim Start).
The transparency of the vertex is calculated according to the distance percentage of the vertex in the small map model to the virtual vehicle coordinate, so that the fuzzy effect of different transparencies is realized, and the game experience of the player is improved.
As another example, the blurring effect of different transparencies may be achieved by calculating the transparency of a vertex in the minimap model according to the distance of the vertex from the current world coordinates of the virtual vehicle. For example, a first threshold value and a second threshold value are configured in advance, and the first threshold value is smaller than the second threshold value; for the two-dimensional positioning coordinate with the third distance between the first threshold value and the second threshold value, the fuzzy effect corresponding to the third distance is that the closer the distance to the center of the small map display area is, the lower the transparency is; for the two-dimensional positioning coordinate with the third distance smaller than the first threshold value, the fuzzy effect corresponding to the third distance is opaque; for two-dimensional positioning coordinates where the third distance is greater than the second threshold, the blurring effect corresponding to the third distance is completely transparent.
The specific calculation method of the distance may be: first, the Center coordinate of the display area is calculated, namely, Center is (Width/2, Height/2), and then the distance between the Relative Position and the Center on the X axis and the Y axis is calculated:
Percent X=(Relative Position.X–Center.X)/Center.X;
Percent Y=(Relative Position.Y–Center.Y)/Center.Y。
next, the absolute value of the larger of the absolute values of Percent X and Percent Y is taken as the distance from the center: percent Max (abs (Percent x), abs (Percent y)); where Max indicates the larger of the two, and Abs indicates the absolute value. The transparency of each vertex in the minimap model may then be determined by comparison to a preset range of distance length values.
The transparency of the vertex is calculated through the distance length value between the vertex in the small map model and the virtual vehicle coordinate, so that the fuzzy effect of different transparencies is realized, and the game experience of a player is improved.
Based on the steps h, i, j and k, the small map model can achieve the effect of game scene rotation in the small map display area. As an example, the step i may include the steps of:
determining the current direction right above the camera;
and determining a projection matrix of the camera according to the coordinates of the alignment points, the coordinate offset and the direction right above.
In practical application, the projection matrix MP of the camera can enable the small map model to follow the virtual vehicle, the area around the virtual vehicle in the small map model is displayed by taking the virtual vehicle as the center, and meanwhile, the small map model is rotated, so that the small map model achieves the effect of rotating the 3D game scene in the small map display area.
When the minimap model is rendered in the minimap display area, the minimap model can have 3D effects of rotation, perspective, blurring and the like through 3D conversion, and game experience of a player is improved.
Fig. 11 provides a schematic structural diagram of a minimap rendering device in a racing game. The apparatus is applied to a game terminal having a graphic user interface, the graphic user interface is configured with a small map display area in advance, as shown in fig. 11, the rendering apparatus 1100 of the small map in the racing game includes:
a determining module 1101, configured to determine a route of a virtual track in a racing game scene;
a generating module 1102, configured to generate a vertex and a vertex index of the minimap model based on the route and a preset track width for the minimap;
and a rendering module 1103, configured to render the minimap model in the minimap display area.
In some embodiments, the route is a centerline of the virtual racetrack.
In some embodiments, the generation module 1102 comprises:
the selecting submodule is used for selecting a plurality of first target points at equal intervals on the center line based on a preset interval;
the first determining submodule is used for determining a plurality of second target points with equal vertical distances by taking the plurality of first target points as vertical feet respectively, and the vertical distances are determined according to the preset track width aiming at the small map;
and the second determining submodule is used for taking the plurality of second target points as the vertexes of the triangular surface of the small map model and determining a vertex index.
In some embodiments, the centerline is comprised of a plurality of continuous line segments; selecting a submodule to be specifically used for:
for each first target point:
determining a first distance from the first target point to the starting point of the central line based on the preset distance;
and determining a first line segment where the first target point is located in the plurality of continuous line segments according to the first distance, and taking the coordinate of the first position of the first line segment corresponding to the first target point as the coordinate of the first target point.
In some embodiments, the rendering module 1103 includes:
the third determining submodule is used for determining the current second position of the target virtual object in the scene in the racing game;
and the rendering sub-module is used for rendering the part of the small map model corresponding to the second position in the small map display area.
In some embodiments, the rendering submodule is specifically configured to:
determining the coordinates of the alignment point of the camera according to the second position;
determining a projection matrix of the camera according to the coordinate of the alignment point and the coordinate offset of the camera and the target virtual object;
mapping the small map model into a two-dimensional road plane according to the projection matrix;
and rendering the two-dimensional road plane corresponding to the part of the two-dimensional road plane at the second position in the small map display area.
In some embodiments, the rendering sub-module is further specifically configured to:
mapping the vertex coordinates of the triangular surface of the small map model into two-dimensional display coordinates according to the projection matrix;
and offsetting the two-dimensional display coordinate according to the preset display position of the small map display area to obtain a two-dimensional positioning coordinate for the small map display area.
In some embodiments, the rendering sub-module is further specifically configured to:
discarding the two-dimensional positioning coordinates exceeding the small map display area according to the two-dimensional positioning coordinates and the preset display size of the small map display area;
and rendering the display effect corresponding to the residual two-dimensional positioning coordinates in the small map display area.
In some embodiments, the display effect comprises a blur effect; the rendering submodule is further specifically configured to:
and for each remaining two-dimensional positioning coordinate, determining a third distance between the two-dimensional positioning coordinate and the center of the small map display area, and rendering a fuzzy effect corresponding to the third distance in the small map display area.
In some embodiments, a first threshold and a second threshold are preconfigured, the first threshold being less than the second threshold;
for the two-dimensional positioning coordinate with the third distance between the first threshold value and the second threshold value, the fuzzy effect corresponding to the third distance is that the closer the distance to the center of the small map display area is, the lower the transparency is;
for the two-dimensional positioning coordinate with the third distance smaller than the first threshold value, the fuzzy effect corresponding to the third distance is opaque;
for two-dimensional positioning coordinates where the third distance is greater than the second threshold, the blurring effect corresponding to the third distance is completely transparent.
In some embodiments, a third threshold and a fourth threshold are preconfigured, the third threshold being greater than the fourth threshold; the rendering submodule is further specifically configured to:
for each two-dimensional positioning coordinate, determining the percentage of the distance from the center according to the third distance, wherein the larger the third distance is, the smaller the percentage of the distance from the center is;
for the two-dimensional positioning coordinate with the distance center percentage between the third threshold value and the fourth threshold value, the fuzzy effect corresponding to the third distance is that the smaller the distance center percentage is, the lower the transparency is;
for the two-dimensional positioning coordinates with the distance center percentage smaller than the fourth threshold, the fuzzy effect corresponding to the third distance is opaque;
for two-dimensional positioning coordinates having a percentage of distance from the center greater than a third threshold, the blurring effect corresponding to the third distance is completely transparent.
In some embodiments, the rendering sub-module is further specifically configured to:
determining the current direction right above the camera;
and determining a projection matrix of the camera according to the coordinates of the alignment points, the coordinate offset and the direction right above.
The rendering device of the small-sized map in the racing game provided by the embodiment of the application has the same technical characteristics as the rendering method of the small-sized map in the racing game provided by the embodiment, so that the same technical problems can be solved, and the same technical effect can be achieved.
Corresponding to the rendering method of the mini map in the racing game, the embodiment of the application also provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program is executed by a processor to perform the step of the rendering method of the mini map in the racing game in the game.
The rendering device of the small map in the racing game provided by the embodiment of the application can be specific hardware on equipment or software or firmware installed on the equipment and the like. The device provided by the embodiment of the present application has the same implementation principle and technical effect as the foregoing method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the foregoing method embodiments where no part of the device embodiments is mentioned. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the foregoing systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the mobile control method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the scope of the embodiments of the present application. Are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (15)

1. A rendering method of a minimap in a racing game is characterized by being applied to a game terminal with a graphical user interface, wherein the graphical user interface is pre-configured with a minimap display area, and the method comprises the following steps:
determining a route of a virtual track in a racing game scene;
generating a vertex and a vertex index of the small map model based on the route and a preset track width aiming at the small map;
rendering the minimap model in the minimap display area.
2. The rendering method of claim 1, wherein the route is a centerline of the virtual racetrack.
3. The rendering method according to claim 2, wherein the step of generating vertices and vertex indices of the minimap model based on the route and a preset course width for the minimap comprises:
selecting a plurality of first target points at equal intervals on the central line based on a preset interval;
respectively taking the first target points as vertical feet, and determining a plurality of second target points with equal vertical distances, wherein the vertical distances are determined according to the preset track width aiming at the small map;
and taking a plurality of second target points as vertexes of a triangular surface of the small map model, and determining a vertex index.
4. The rendering method according to claim 3, wherein the center line is composed of a plurality of continuous line segments; based on the preset distance, the step of selecting a plurality of first target points at equal intervals on the central line comprises the following steps:
for each of the first target points:
determining a first distance from the first target point to the starting point of the central line based on a preset distance;
and determining a first line segment where the first target point is located in a plurality of continuous line segments according to the first distance, and taking the coordinate of the first position of the first line segment corresponding to the first target point as the coordinate of the first target point.
5. The rendering method according to claim 1, wherein the step of rendering the minimap model in the minimap display area includes:
determining a current second position of a target virtual object in the racing game in the scene;
rendering a portion of the minimap model corresponding to the second location in the minimap display area.
6. The rendering method according to claim 5, wherein the step of rendering the part of the minimap model corresponding to the minimap model at the second position in the minimap display area includes:
determining the coordinates of an alignment point of the camera according to the second position;
determining a projection matrix of the camera according to the alignment point coordinates and the coordinate offset of the camera and the target virtual object;
mapping the small map model into a two-dimensional road plane according to the projection matrix;
rendering a portion of the two-dimensional road plane corresponding to the second location in the small map display area.
7. The rendering method according to claim 6, wherein the step of mapping the minimap model to a two-dimensional road plane according to the projection matrix comprises:
mapping the vertex coordinates of the triangular surface of the small map model into two-dimensional display coordinates according to the projection matrix;
and offsetting the two-dimensional display coordinate according to the preset display position of the small map display area to obtain a two-dimensional positioning coordinate for the small map display area.
8. The rendering method according to claim 7, wherein the step of rendering the part of the two-dimensional road plane corresponding to the second position in the small map display area includes:
discarding the two-dimensional positioning coordinates exceeding the small map display area according to the two-dimensional positioning coordinates and the preset display size of the small map display area;
and rendering the display effect corresponding to the residual two-dimensional positioning coordinates in the small map display area.
9. The rendering method according to claim 8, wherein the display effect includes a blur effect; rendering the display effect corresponding to the remaining two-dimensional positioning coordinates in the small map display area, wherein the rendering step comprises the following steps:
for each remaining two-dimensional positioning coordinate, determining a third distance between the two-dimensional positioning coordinate and the center of the small map display area, and rendering a fuzzy effect corresponding to the third distance in the small map display area.
10. The rendering method according to claim 9, wherein a first threshold value and a second threshold value are preconfigured, the first threshold value being smaller than the second threshold value;
for the two-dimensional positioning coordinate with the third distance between the first threshold and the second threshold, the fuzzy effect corresponding to the third distance is that the closer the distance to the center of the small map display area is, the lower the transparency is;
for the two-dimensional positioning coordinates for which the third distance is less than the first threshold, the blurring effect corresponding to the third distance is opaque;
for the two-dimensional positioning coordinates where the third distance is greater than the second threshold, the blurring effect corresponding to the third distance is completely transparent.
11. The rendering method according to claim 9, wherein a third threshold value and a fourth threshold value are preconfigured, the third threshold value being greater than the fourth threshold value; rendering a blur effect corresponding to the third distance in the small map display area, including:
for each of the two-dimensional positioning coordinates, determining a center-of-distance percentage from the third distance, wherein the larger the third distance, the smaller the center-of-distance percentage;
wherein, for the two-dimensional positioning coordinate with the distance center percentage between the third threshold and the fourth threshold, the blurring effect corresponding to the third distance is that the smaller the distance center percentage is, the lower the transparency is;
for the two-dimensional positioning coordinates for which the distance center percentage is less than the fourth threshold, the blur effect corresponding to the third distance is opaque;
for the two-dimensional positioning coordinates for which the center percentage of distance is greater than the third threshold, the blurring effect corresponding to the third distance is completely transparent.
12. The rendering method of claim 6, wherein determining the projection matrix of the camera from the alignment point coordinates and the coordinate offset of the camera from the target virtual object comprises:
determining a current directly-above direction of the camera;
and determining a projection matrix of the camera according to the alignment point coordinate, the coordinate offset and the right-above direction.
13. A minimap rendering device in a racing game, which is applied to a game terminal having a graphical user interface, the graphical user interface being pre-configured with a minimap display area, the device comprising:
the determining module is used for determining a route of a virtual track in a racing game scene;
the generating module is used for generating a vertex and a vertex index of the small map model based on the route and the preset track width aiming at the small map;
and the rendering module is used for rendering the small map model in the small map display area.
14. A game terminal comprising a memory, a processor, said memory having stored thereon a computer program operable on said processor, wherein said processor, when executing said computer program, performs the steps of the method of any of claims 1 to 12.
15. A computer readable storage medium having stored thereon machine executable instructions which, when invoked and executed by a processor, cause the processor to execute the method of any of claims 1 to 12.
CN201911116200.2A 2019-11-14 2019-11-14 Rendering method and device of small map in racing game and game terminal Active CN110860088B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911116200.2A CN110860088B (en) 2019-11-14 2019-11-14 Rendering method and device of small map in racing game and game terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911116200.2A CN110860088B (en) 2019-11-14 2019-11-14 Rendering method and device of small map in racing game and game terminal

Publications (2)

Publication Number Publication Date
CN110860088A true CN110860088A (en) 2020-03-06
CN110860088B CN110860088B (en) 2023-04-07

Family

ID=69653940

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911116200.2A Active CN110860088B (en) 2019-11-14 2019-11-14 Rendering method and device of small map in racing game and game terminal

Country Status (1)

Country Link
CN (1) CN110860088B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112884883A (en) * 2021-01-25 2021-06-01 深圳市其乐游戏科技有限公司 Automatic generation method of game track, terminal and storage medium
CN113289337A (en) * 2021-05-13 2021-08-24 中国人民解放军军事科学院战争研究院 UE-based dynamic generation method for simulated global minimap

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105759954A (en) * 2015-01-05 2016-07-13 索尼公司 Information processing device, information processing method and program
US20170116771A1 (en) * 2014-06-10 2017-04-27 Tencent Technology (Shenzhen) Company Limited 3d model rendering method and apparatus and terminal device
CN109865286A (en) * 2019-02-20 2019-06-11 网易(杭州)网络有限公司 Information processing method, device and storage medium in game
CN109876442A (en) * 2019-04-15 2019-06-14 网易(杭州)网络有限公司 Route indicating means, equipment and storage medium in game based on map

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170116771A1 (en) * 2014-06-10 2017-04-27 Tencent Technology (Shenzhen) Company Limited 3d model rendering method and apparatus and terminal device
CN105759954A (en) * 2015-01-05 2016-07-13 索尼公司 Information processing device, information processing method and program
CN109865286A (en) * 2019-02-20 2019-06-11 网易(杭州)网络有限公司 Information processing method, device and storage medium in game
CN109876442A (en) * 2019-04-15 2019-06-14 网易(杭州)网络有限公司 Route indicating means, equipment and storage medium in game based on map

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112884883A (en) * 2021-01-25 2021-06-01 深圳市其乐游戏科技有限公司 Automatic generation method of game track, terminal and storage medium
CN112884883B (en) * 2021-01-25 2024-05-10 深圳市其乐游戏科技有限公司 Automatic generation method, terminal and storage medium of game track
CN113289337A (en) * 2021-05-13 2021-08-24 中国人民解放军军事科学院战争研究院 UE-based dynamic generation method for simulated global minimap
CN113289337B (en) * 2021-05-13 2022-07-05 中国人民解放军军事科学院战争研究院 UE-based dynamic generation method for simulated global minimap

Also Published As

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

Similar Documents

Publication Publication Date Title
JP4896761B2 (en) 3D map display system, 3D map display method, and program thereof
KR101640904B1 (en) Computer-based methods, machine-readable non-transitory medium and server system to provide online gaming experience
US10460510B2 (en) Methods and systems for viewing a three-dimensional (3D) virtual object
US20150279083A1 (en) Real-time three-dimensional reconstruction of a scene from a single camera
KR100657943B1 (en) Real time 3 dimensional transformation method for 2 dimensional building data and apparatus therefor, and real time 3 dimensional visualization method for 2 dimensional linear building data and apparatus using the same
CN110860088B (en) Rendering method and device of small map in racing game and game terminal
CN109448137A (en) Exchange method, interactive device, electronic equipment and storage medium
CN107808388B (en) Image processing method and device containing moving object and electronic equipment
US20170213394A1 (en) Environmentally mapped virtualization mechanism
CN113487717B (en) Picture processing method and device, computer readable storage medium and electronic equipment
CN105894551A (en) Image drawing method and device
CN114529647A (en) Object rendering method, device and apparatus, electronic device and storage medium
EP2581823B1 (en) Method and system for applying three-dimensional (3d) switch panels in instant messaging tool
US10891780B2 (en) Methods and systems for viewing a three-dimensional (3D) virtual object
CN112948605B (en) Point cloud data labeling method, device, equipment and readable storage medium
JP7375149B2 (en) Positioning method, positioning device, visual map generation method and device
Yao et al. Development overview of augmented reality navigation
CN104732570A (en) Image generation method and device
CN115035231A (en) Shadow baking method, shadow baking device, electronic apparatus, and storage medium
CN113819913A (en) Path planning method and device, computer equipment and storage medium
CN112348965A (en) Imaging method, imaging device, electronic equipment and readable storage medium
CN106600698B (en) A kind of fast drawing method of threedimensional model
CN111949816A (en) Positioning processing method and device, electronic equipment and storage medium
JP2009251887A (en) Image generation system, program, and information storage medium
CN117032617B (en) Multi-screen-based grid pickup method, device, equipment and medium

Legal Events

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