Background technology
Online game is to be support with Internet, can play for the digitizing that many people participate in simultaneously.Along with popularizing of global network technology, online game has obtained fast development, becomes the main path of many people's recreation and amusements.Online game has mainly been experienced in the evolution of its form of expression by traditional 2D online game transition of the 3D online game of main flow up till now.
Initial online game all presents on network with written form, is similar to Internet chat.The player instructs by input characters and plays, and as the University of Essex in Britain in 1978, Roy Trubshaw write in the world with DEC-10 that first item can be used for the online game " MUD1 " that the multi-user participates in simultaneously.This is many people world of a pure words, has 20 interconnective rooms and 10 instructions, can carry out man-machine interaction by database after user's login, or by chat system and other player exchanges.The online game of this class character type requires the player that certain computer programming knowledge is arranged, therefore having relatively high expectations to the player.To earlier 1990s, Microsoft company releases its Windows Windows and has replaced dos operating system.Be subjected to the influence of computer graphical form technology, online game has also become graphic interface from uninteresting literal interface.These images are that the form with one one frame is pre-existing in, and graphic element finally all can call in recreation with the contact method of complexity and realize abundant content in the gaming world.Compare with the online game of initial written form, begin to have had the notion of scene of game based on the online game of graphical interfaces, but be difficult to bring the sense of reality and feeling of immersion to the player by the scene of game that the 2D graph image makes up.
Along with fast development of information technology, the computer display card performance was significantly promoting in recent years, and the 3D graph technology begins to be applied to online game.3D graphic package interface such as OpenGL (Open Graphic Library) or Direct3D etc. are adopted in the 3D online game usually, in computing machine the geometric object in its scene, light source, viewpoint, inlet, animation are described the constructing virtual environment.And in the 3D network game platform, add the practical situation that physical engine comes object of which movement in the simulating reality world.The gravity that is subjected to during as the whereabouts of the friction on the flowing of the collision between object, water, when the personage walks and ground and object etc.Therefore, the 3D online game scene in the simulating reality world to a great extent.Compare with the 2D online game, the most outstanding characteristics of 3D online game are that constructed scene of game has very strong feeling of immersion and physics interactivity, and three-dimensional scene of game environment can make the user that the operability of recreation is strengthened greatly, also can make the player experience the scene of game with feeling of immersion in game process.In order to make 3D online game product more competitive, many businessmans all are devoted to the high emulation of pursuit game scene, and at the fine degree of scene drawing, aspect seeking breakthroughs such as texture special efficacy.Therefore, the degree true to nature of scene of game becomes one of present 3D online game competition focal point.
But, utilize the 3D scene of game that 3D graphic package interface draws on computers and the real scene of real world that very big difference is still arranged.If the player can by in the process of 3D network game platform recreation as the real scene of placing oneself in the midst of real world in recreation, the player then can experience a kind of in virtual game environment and interaction real world so, and this virtual and real organic combination more can be strengthened the interactive and sense of reality of 3D online game.And the 3D network game platform that possesses above-mentioned characteristic does not at present appear in the newspapers.
Summary of the invention
In existing 3D network game platform is played, can't experience the scene at its place such as the weak points such as truly feels of real world at the above-mentioned player who exists in the prior art, the object of the present invention is to provide a kind of 3D panorama outdoor scene network game platform construction method that can experience as the real world real scene.
For solving the problems of the technologies described above, the technical solution used in the present invention is:
3D panorama outdoor scene network game platform construction method of the present invention will be applied to the 3D network game field based on the scene drawing technology of panorama real scene image and make up, and may further comprise the steps:
Make up 3D panorama outdoor scene network game platform basic system architecture;
Gather and make up the needed data of 3D panorama outdoor scene network game platform;
Utilize the gaming platform basic system architecture of above-mentioned foundation and the data that collect, show outer curtain by creating panorama real scale game scene, create virtual ground and set the roaming mode of user in 3D recreation foreground 3D panorama real scale game scene is made up, and position and the geography information of user in the 3D scene of game is synchronous, obtain the scene of game environment of 3D panorama outdoor scene network game platform;
In above-mentioned scene of game environment, add the 3D stage property entity of scene of game, obtain 3D panorama outdoor scene network game platform.
Described 3D panorama outdoor scene network game platform basic system architecture is:
Connected and composed by network by the server and client side, wherein server is made up of Data Management Unit, data-carrier store, subscriber information management unit, 3D actual resource administrative unit, physical engine and collision detection unit; Network is made of the network data transmission agreement; Client is made up of graph rendering unit, 3D recreation foreground and geographical information platform.
Described collection makes up the needed data of 3D panorama outdoor scene network game platform and may further comprise the steps:
1) utilize the data acquisition platform collection to make up the needed raw data of 3D panorama outdoor scene network game platform, the panorama real scene image data and the pairing geographic information data of this frame of one frame are stored respectively in the data acquisition storer according to continuous mode, and dumped in the data in server storer;
2) the deposit path of each frame image data that will store at the data-carrier store geographic information data opening relationships table corresponding with this frame is stored in relation table in the data in server administrative unit.
Described establishment panorama real scale game scene shows that outer curtain is:
Adopt 3D graphic package interface to create the three-dimensional environment of Virtual Space, and in the Virtual Space, draw curtain outside the scene demonstration;
The panorama real scene image data that collect are sent to the 3D recreation foreground of active client from the data in server storer;
Texture mapping method in the employing 3D graphic package interface obtains panorama real scene image data texture curtain outside scene shows the panorama outdoor scene and shows outer act.
Described establishment virtual ground method is:
Setting up one in the Virtual Space at curtain place outside the scene that has built shows can not meet as virtual ground;
Determine the position of above-mentioned virtual ground in the Virtual Space, consistent to guarantee the image that outside scene shows, shows on the curtain with the perspective relation of Virtual Space.
Describedly be synchronously with the position and the geography information of user in the 3D scene of game:
The panorama outdoor scene is shown the pairing geographic information data of outer curtain current frame image data, and this user geographic position of living in other user's geography information in specified scope give the environmental map of preprepared real scene by the routine interface real-time Transmission between 3D recreation foreground and the geographical information platform, demarcate on the environmental map and upgrade this user's roaming current location and near the current location of other users' roamings.
The described 3D stage property entity that adds scene of game in the scene of game environment may further comprise the steps:
In the 3D of server actual resource administrative unit, in advance 3D stage property attributes of entities information is stored;
The model file of the 3D stage property entity that utilizes the 3D modeling tool to set up is stored in the 3D actual resource administrative unit, obtain the position that comprises the Points And lines of 3D solid model in the space of 3D entity and the raw data of surperficial pinup picture;
The raw data of utilizing 3D graphic package interface and obtaining is drafting 3 D stage property entity in 3D panorama outdoor scene network game field, realizes that the user can carry out interactive game with virtual 3D stage property entity and other user subjects under the scene of game of real world.
The present invention has following beneficial effect and advantage:
1. the scene of game of using in the constructed 3D panorama outdoor scene network game platform of the inventive method is made of the real scene of real world fully, therefore the player can be by recreation in experiencing as the real scene of placing oneself in the midst of real world in the process of 3D network game platform recreation, experience a kind of and interaction real world, this virtual and real combination has strengthened the recreational of 3D online game.
2. the present invention will combine with the two-dimensional map (geographical information platform) of real world based on the three-dimensional scenic space of panorama real scene image and make up the 3D network game platform with real world scene and geography information jointly, when the user is played in the Virtual Space that with the real world scene is background, can also understand the geographic position in the own present located real world, further strengthened 3D panorama outdoor scene network game platform to the player bring recreational.
3. the present invention is mapped to the outer curtain of scene demonstration with the panorama real scene image and creates the scene of game with real world view, this method provides a new technology path for the structure of network game platform, and user interface of the present invention is succinctly friendly, and easy operating contains much information.
Embodiment
The present invention will be applied to the 3D online game based on the scene drawing technology of panorama real scene image, construct one the player is experienced in the network virtual game environment as the 3D panorama outdoor scene network game platform of playing in the real scene of real world.
3D panorama outdoor scene network game platform construction method of the present invention may further comprise the steps:
1. make up 3D panorama outdoor scene network game platform basic system architecture
As shown in Figure 1, the system architecture of 3D panorama outdoor scene network game platform is connected and composed by Internet by the server and client side, and wherein server is made up of Data Management Unit 101, data-carrier store 102, subscriber information management unit 103,3D actual resource administrative unit 104, physical engine and collision detection unit 105; Network 106 is made of network data transmission agreement (network data transmission agreements such as FTP or HTTP); Client is made up of graph rendering unit 107,3D recreation foreground 108 and geographical information platform 109.
Each Elementary Function is as follows in the 3D panorama outdoor scene network game platform:
Data Management Unit 101 can adopt databases such as SQL Server, Oracle or Sybase to prepare in advance to be used on the URL of panorama real scene image data in server that the draw scene of game geographic information data corresponding with these frame panorama real scene image data (when referring to gather the panorama real scene image in the real world of video camera place actual geographic position) storage together, the geographic position of reality in the real world of video camera place when geographic information data refers to gather the panorama real scene image.When the URL of client by network needed next frame panorama real scene image data when the server requests user roams in the 3D panorama outdoor scene online game environment geographic information data corresponding with it, Data Management Unit 101 will find the corresponding panorama real scene image data and the geographic information data of this frame panorama real scene image Data URL correspondence at data-carrier store 102 by the URL of these frame panorama real scene image data, and pass client back by network.
Data-carrier store 102 is that the disk space that reserves in server is used to store the panorama real scene image data that preprepared user makes up scene of game, adopts jpeg format that panorama real scene image data are preserved in the present embodiment.
Each client user's current information is collected in subscriber information management unit 103 by network, comprise information such as roaming state that geographic position, the user of user in current 3D scene of game is current and IP address, and will pass to this user with other user profile in the specified scope of active user geographic position by network.
3D actual resource administrative unit 104 is used for storing data such as geographic position in 3D entity (as 3D solid model of scene of game stage property etc.) the place scene environment and 3D entity information.
Physical engine and collision detection unit 105 are used for following the tracks of the position at each 3D entity of 3D scene of game, when the 3D entity bump or situations such as direction and velocity variations under, the position of physical engine and 105 pairs of 3D entities of collision detection unit is upgraded, and dynamic informations such as the position that it is new, speed send to client, play up in the 3D of client recreation foreground.
Network 106 is used for the information interaction between server and the client, adopts network data transmission agreements such as FTP, HTTP and RTSP to communicate usually.
Graph rendering unit 107 is the 3D entities that will get access in the 3D actual resource administrative unit 104 from server, the 3D people entities after upgrading by subscriber information management unit 103 and the scene stage property 3D entity by physical engine and collision detection unit 105 updated space postpones etc., utilizes 3D render engines such as OpenGL, Direct3D to carry out color applying drawing.
3D recreation foreground 108 is the display platforms in the 3D online game space that combines with the 3D entity of panorama real scene image.By write network data transmission agreement such as FTP or HTTP etc. in 3D recreation foreground 108, client can be utilized procotol, sends request of data by network to server.
Geographical information platform 109 embeds client with the electronic chart form.Electronic chart can obtain the geographic information data of user's current location by geographical information platform 109 and the data-interface function of 3D recreation foreground 108 in program.
Present embodiment adopts based on the single document program of the MFC client as 3D panorama outdoor scene network game platform, makes up in client and shows 3D recreation foreground 108 and geographical information platform 109.
2. gather and make up the needed data of 3D panorama outdoor scene network game platform
As shown in Figure 2, utilize the data acquisition platform collection to set up the needed raw data of 3D panorama outdoor scene network game platform.Data acquisition platform is made up of data acquisition control program 201, geographical information collection equipment 202, panoramic picture collecting device 203 and data acquisition storer 204.Panoramic picture collecting device 202 (as panoramic camera) is responsible for gathering panorama real scene image data; 202 pairs of geographic information datas of geographical information collection equipment are gathered, present embodiment indoor situation adopt odometer on the mobile robot and gyroscope record panorama real scene image collection point the position, adopt gps system in outdoor situations; 201 pairs of geographical information collection equipment 202 of data acquisition control program are controlled (present embodiment adopts uniformly-spaced panorama real scene image data sampling), trigger by 202 pairs of panoramic picture collecting devices 203 of geographical information collection equipment, the panorama real scene image data of equally spaced managing the position are gathered, and the panorama real scene image data and the pairing geographic information data of this frame of every frame are stored in data acquisition storer 204 respectively according to continuous mode.Each frame panorama real scene image data is preserved separately, and such as saving as jpeg format or BMP form etc., present embodiment selects for use jpeg image format to store; The panorama real scene image data conversion storage that to store in data acquisition storer 204 is in data in server storer 102 at last; (Uniform Resource Locator, URL) corresponding geographic information data opening relationships table with this frame is stored in relation table in the data in server administrative unit 101 in the URL(uniform resource locator) of data in server storer 102 with every two field picture.So, the URL of every frame panorama real scene image is corresponding one by one with this frame panorama real scene image data geographic information data in Data Management Unit 101, and the URL by every frame panorama real scene image can obtain these frame panorama real scene image data and its pairing geographic information data.
3. show outer curtain by creating panorama real scale game scene, create virtual ground and set the roaming mode of user in 3D recreation foreground 3D panorama real scale game scene is made up, and position and the geography information of user in the 3D scene of game is synchronous
(1) in the 3D of client recreation foreground 108, creates curtain outside the demonstration of spherical panorama outdoor scene
Create the three-dimensional environment of Virtual Space based on the graph rendering unit, and in the Virtual Space, draw curtain outside the scene demonstration (curtain adopts curtain outside the spherical scene demonstration outside the scene demonstration of present embodiment); The panorama real scene image data that collect are sent to the 3D recreation foreground 108 of active client from data in server storer 102.Adopt the texture mapping method in the 3D graphic package interface that panorama real scene image data texture is shown outer curtain to spherical scene, can get the spherical panorama outdoor scene and show outer curtain;
(2) create virtual ground and set the roaming mode of user on virtual ground
Outside showing, the spherical panorama outdoor scene that has built sets up virtual ground in the Virtual Space at curtain place:
Virtual ground is one can not meet, carrying user's 3D people entities, the 3D stage property entity of scene of game etc. in the constructed game environment of whole 3D panorama outdoor scene network game platform.Corresponding in order to guarantee with the position of image scene on outside the spherical panorama outdoor scene shows act from user's viewpoint observation 3D entity, need regulate the position of virtual ground in 3d space, it is consistent to make the spherical panorama outdoor scene show that outer curtain is gone up the play perspective relation of the 3d space in the foreground 108 of the image that shows and 3D.This perspective relation is observed viewpoint height, virtual ground position and spherical panorama outdoor scene by the user and is shown that outer curtain epigraph perspective relation determines jointly.Present embodiment is drawn two parallel lines on virtual ground, corresponding with two shown on image parallel lines.By regulating the height of user's viewpoint and virtual ground, when two parallel lines coincide on two parallel lines on the virtual ground and the image, show that then the perspective relation demarcation finishes, thereby determined the position of virtual ground and the position of user's viewpoint.
Set the roaming mode of user on virtual ground:
At first to demarcate distance on the virtual ground and the distance relation in the real world.In 3d space to from user's viewpoint to virtual ground the distance and the panoramic camera primary optical axis measure to the ground actual range.The ratio of these two distances promptly can be used as the conversion scale of Virtual Space distance to the actual range of real world.So, each position on the virtual ground all corresponding the geography information of a reality on the environmental map in the real world.
The roaming mode of user in the constructed game environment of 3D panorama outdoor scene network game platform be as shown in Figure 3:
(301) begin to carry out the user and roam program;
(302) roaming range of 3D people entities in virtual ground position, present frame scene of game place to the user limits in initialization procedure; The present invention does not have special provision to the shape of roaming range, can be the zone of shapes such as circle or rectangle; Present embodiment adopts border circular areas, user 3D people entities present frame random zone radius by spherical scene outside the radius decision of curtain, present embodiment selects the spherical panorama outdoor scene to show about 1/2 of outer curtain radius, and this zone can be adjusted parameter by specific requirement;
(303) the 3D people entities of handling the user is roamed (concrete method of operating belongs to prior art, embodies) in program on the residing virtual ground of present frame;
(304) when the user handles the 3D people entities away from initial position, calculate the current location of 3D people entities and initial position in 3d space distance and with respect to the video camera rotation angle of initial position; Distance in this Virtual Space is changed according to demarcating the good Virtual Space and the transformational relation of real world distance, obtained 3D people entities current location and the actual range of its initial position in real world;
(305) user judges whether to jump to 3D people entities position; If not redirect then goes to step (304), otherwise subsequent steps (306);
(306) the 3D people entities that will calculate gained sends back server in the actual geographic position of position correspondence on virtual ground, in Data Management Unit 101, search URL with the most contiguous panorama real scene image data in this geographic position, in data-carrier store 102, panorama real scene image data are extracted, transmitted go back to the 3D recreation foreground 108 in the client in the lump; On active user's 3D people entities position, draw curtain outside the spherical scene, and carry out texture mapping thereon, on geographical information platform 109, upgrade the current geographic position of user simultaneously;
(307) judge whether to quit a program, as withdraw from, end user roaming program (308) on virtual ground then, otherwise return step (304).
Position and the geography information of user in the 3D scene of game is synchronous:
When the user roamed in the constructed environment of 3D panorama outdoor scene network game platform, along with the change of scene of game, its geographic position also should change thereupon.The spherical panorama outdoor scene is shown the pairing geographic information data of outer curtain current frame image data, and this user geographic position of living in other user's geography information in specified scope (being that the spherical panorama outdoor scene shows that the radius length of outer curtain in the Virtual Space is converted into the actual distance of real world) are the environmental map that routine interface real-time Transmission between the electronic chart is given the preprepared real scene by 3D recreation foreground 108 and geographical information platform 109, demarcate and upgrade on the environmental map current location that this user roams and near the current location roamed of other users.
4. in the scene environment of the 3D panorama outdoor scene network game platform that builds, add the 3D stage property entity of scene of game etc.
In the scene of 3D panorama outdoor scene network game platform, can exist some as 3D stage property entities such as virtual 3D buildings, 3D indication road sign and 3D blindage things.Scene outside these 3D stage property entities and spherical panorama outdoor scene show on the curtain is set each other off, and can enrich scene of game and strengthen the recreational of recreation.The concrete grammar that adds 3D stage property entity in the environment of 3D recreation foreground is as follows:
In the 3D of server actual resource administrative unit 104, in advance 3D stage property attributes of entities information is stored, as the geographic position of 3D stage property entity in scene, 3D stage property entity towards information such as angles.To utilize the 3D modeling tool (as 3D modeling softwares such as Maya or 3Dmax, present embodiment employing Maya) model file of the 3D stage property entity that foundation is good in 3D actual resource administrative unit 104, obtains the raw data of 3D entity with stored in file format such as .max .ma or .smd.These raw data comprise the position of the Points And lines of 3D solid model in the space, and surperficial pinup picture data; Utilize 3D graphic package interface drafting 3 D stage property entity in 3D panorama outdoor scene network game field at last, realize that the user can carry out interactive game with virtual 3D stage property entity and other user subjects under real scene of game.
Above embodiment is only for explanation the present invention; but not limitation of the present invention; relevant technologies field personnel are under the situation that does not break away from the spirit and scope of the present invention; can also make various conversion and distortion, so the technical scheme of all equivalent variations should belong to also within the category of claim protection of the present invention.