A first-person indoor tour method based on mapbox and related equipment
By initializing the camera, setting the viewpoint and coordinates, and controlling the camera's rotation and movement in the Mapbox map engine, the problem of poor indoor tour guide effects in existing technologies is solved, achieving a more comprehensive display of geographic information and a smooth first-person perspective tour.
Patent Information
- Application Number
- CN202311020670.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-14
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-08-14
AI Technical Summary
When using the Three.js 3D engine or panoramic images to display indoor scenes in existing technologies, the indoor navigation effect is poor and cannot take into account comprehensive geographic information data.
Based on the Mapbox map engine, the system initializes the camera to enter a first-person perspective, obtains and sets latitude and longitude coordinate arrays, calculates azimuth and distance, controls camera rotation and movement, and iterates the coordinate array to achieve indoor navigation.
It improves the simulation of indoor tour scenes and the comprehensiveness of geographical information, enhances the display effect, and achieves smooth tour guidance from a first-person perspective.
Smart Images

Figure CN117268388B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of map data processing technology, and in particular to a first-person indoor navigation method, system, terminal, and computer-readable storage medium based on Mapbox. Background Technology
[0002] In traditional GIS visualization systems, map engines typically display large-scale geographic information such as streets and buildings. However, the ability to display relatively small indoor scenes within streets and buildings on maps is gradually becoming an essential requirement for enhancing market competitiveness.
[0003] In existing technologies, 3D engines such as Three.js, which are relatively good at displaying details, are generally used, or panoramic images are used directly to display indoor scenes. Although the above methods can display indoor scenes, the display effect is not good, and they cannot take into account comprehensive geographic information data, so they cannot achieve a better indoor tour guide effect. Summary of the Invention
[0004] In view of this, this application provides a first-person indoor navigation method, system, terminal, and computer-readable storage medium based on Mapbox to solve the problems of poor indoor navigation effect and inability to take into account comprehensive geographic information data when using the Three.js 3D engine or panoramic map to display indoor scenes in the prior art.
[0005] This application proposes a first-person indoor navigation method based on Mapbox, including:
[0006] Initialize the camera and control it to enter a first-person perspective.
[0007] Obtain the first and second latitude and longitude coordinate arrays from the indoor navigation route in the Mapbox map engine, and set the first and second latitude and longitude coordinate arrays as the first starting point and the first ending point, respectively.
[0008] Calculate the azimuth angle between the first starting point and the first ending point, and control the camera to rotate according to the azimuth angle;
[0009] Calculate the distance between the first starting point and the first ending point, and move the camera to the first ending point step by step according to the distance at a first preset step frequency;
[0010] When the first endpoint is different from the endpoint of the indoor guided tour route, a third latitude and longitude coordinate array is obtained, the second latitude and longitude coordinate array is iterated to the first starting point, and the third latitude and longitude coordinate array is iterated to the first endpoint, until the first endpoint is the same as the endpoint of the indoor guided tour route.
[0011] Optionally, the initialization of the camera and control of the camera to enter a first-person perspective include the following steps:
[0012] Based on the indoor guided movement route in the Mapbox map engine, determine the corresponding arrays of latitude and longitude coordinates.
[0013] Optionally, determining the corresponding multiple latitude and longitude coordinate arrays based on the indoor guided movement route in the Mapbox map engine specifically includes:
[0014] Create an initial indoor scene model and import the initial indoor scene model into the Mapbox map engine to generate the first Mapbox map engine;
[0015] Create a latitude and longitude coordinate system and import the latitude and longitude coordinate system into the first Mapbox map engine to generate a second Mapbox map engine;
[0016] Based on the second Mapbox map engine, the indoor guided tour route is preset, and multiple corresponding latitude and longitude coordinate arrays are determined.
[0017] Optionally, initializing the camera and controlling it to enter a first-person perspective specifically includes:
[0018] Set the initial azimuth angle, pitch angle, and gaze point of the camera, and control the camera to enter a first-person perspective.
[0019] Optionally, calculating the azimuth angle between the first starting point and the first ending point, and controlling the camera to rotate based on the azimuth angle, specifically includes:
[0020] The first starting point is set as the center of rotation of the camera. The azimuth angle between the first starting point and the first ending point is calculated. The camera and the gaze point are controlled to rotate according to the center and the azimuth angle.
[0021] Optionally, calculating the distance between the first starting point and the first ending point, and moving the camera step by step to the first ending point according to the distance at a first preset pace, specifically includes:
[0022] Calculate the distance between the first starting point and the first ending point, divide the distance into multiple points with equal spacing, set the spacing as the first preset step frequency, and move the camera to the first ending point step by step according to the first preset step frequency, and move the gaze point step by step according to the first preset step frequency.
[0023] Optionally, the method further includes:
[0024] Set a lift step value, and lift the camera and the gaze point according to the lift step value.
[0025] Furthermore, to achieve the above objectives, this application also proposes a first-person indoor navigation system based on Mapbox, wherein the first-person indoor navigation system based on Mapbox includes:
[0026] The first-person perspective initialization module is used to initialize the camera and control the camera to enter the first-person perspective.
[0027] The indoor guided tour route setting module is used to obtain the first latitude and longitude coordinate array and the second latitude and longitude coordinate array in the indoor guided tour route in the Mapbox map engine, and set the first latitude and longitude coordinate array and the second latitude and longitude coordinate array as the first starting point and the first ending point, respectively.
[0028] A rotating view module is used to calculate the azimuth angle between the first starting point and the first ending point, and control the camera to rotate according to the azimuth angle.
[0029] A parallel movement module is used to calculate the distance between the first starting point and the first ending point, and to move the camera to the first ending point step by step according to the distance at a first preset step frequency;
[0030] The data iteration and endpoint determination module is used to obtain a third latitude and longitude coordinate array when the first endpoint is different from the endpoint of the indoor guided tour route, iterate the second latitude and longitude coordinate array to the first starting point, and iterate the third latitude and longitude coordinate array to the first endpoint, until the first endpoint is the same as the endpoint of the indoor guided tour route.
[0031] In addition, to achieve the above objectives, this application also proposes a terminal, the terminal comprising: a memory, a processor, and a Mapbox-based first-person indoor tour guide program stored in the memory and executable on the processor, wherein the Mapbox-based first-person indoor tour guide program, when executed by the processor, implements the steps of the Mapbox-based first-person indoor tour guide method as described above.
[0032] In addition, to achieve the above objectives, this application also proposes a computer-readable storage medium storing a Mapbox-based first-person indoor tour guide program, which, when executed by a processor, implements the steps of the Mapbox-based first-person indoor tour guide method as described above.
[0033] The beneficial effects of this application are as follows: Firstly, unlike existing technologies, this application initializes the camera and controls it to enter a first-person perspective, enabling indoor navigation in the Mapbox map engine from a first-person viewpoint, thus increasing the simulation of the indoor navigation scene. Secondly, this application obtains the first and second latitude / longitude coordinate arrays from the indoor navigation movement route in the Mapbox map engine, sets them as the first starting point and the first ending point respectively, calculates the azimuth angle between the first starting point and the first ending point, and controls the camera to rotate according to the azimuth angle, so that the camera rotates to the direction of the indoor navigation movement route, improving the indoor navigation effect. Furthermore, this application… By calculating the distance between the first starting point and the first ending point, the camera is gradually moved to the first ending point at a first preset step frequency based on the distance. This allows the indoor scene in the Mapbox map engine to be gradually displayed as the camera moves, increasing the comprehensiveness of the indoor geographical information displayed. In addition, this application obtains a third latitude and longitude coordinate array when the first ending point is different from the ending point of the indoor guided tour route. The second latitude and longitude coordinate array is iterated to the first starting point, and the third latitude and longitude coordinate array is iterated to the first ending point, until the first ending point is the same as the ending point of the indoor guided tour route. This ensures that the scene of the entire indoor guided tour route can be gradually displayed from a first-person perspective as the camera moves.
[0034] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 This is a flowchart of a preferred embodiment of the first-person indoor navigation method based on Mapbox in this application;
[0037] Figure 2 This is a flowchart of the manual indoor tour mode in a preferred embodiment of the first-person indoor tour method based on Mapbox in this application;
[0038] Figure 3 This is a flowchart of the automatic indoor navigation mode in a preferred embodiment of the first-person indoor navigation method based on Mapbox in this application;
[0039] Figure 4 This is a schematic diagram of a preferred embodiment of the first-person indoor navigation system based on Mapbox in this application;
[0040] Figure 5 This is a schematic diagram of the operating environment of a preferred embodiment of the terminal of this application. Detailed Implementation
[0041] To enable those skilled in the art to better understand the technical solutions of this application, the first-person indoor navigation method, system, terminal, and computer-readable storage medium based on Mapbox provided in this application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It is understood that the described embodiments are merely some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0042] The terms "first," "second," etc., used in this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0043] In the background technology, since Three.js and panoramic images are not good at displaying both geographical information and indoor scenes, this application is based on an existing web-based map engine library to implement first-person perspective movement. This application chooses the relatively small Mapbox GL JS map rendering engine to implement the first-person perspective movement scheme. Since Mapbox GL JS abstracts the camera API, this application controls and modifies the position of the camera and the gaze point to realize first-person perspective operations such as parallel movement, left and right rotation and jumping.
[0044] This application provides a first-person indoor navigation method, system, terminal, and computer-readable storage medium based on Mapbox, to solve the problems of poor indoor navigation effect and inability to take into account comprehensive geographic information data when using the Three.js 3D engine or panoramic images to display indoor scenes in the prior art.
[0045] Please see Figures 1 to 3 , Figure 1 This is a flowchart of a preferred embodiment of the first-person indoor navigation method based on Mapbox in this application; Figure 2 This is a flowchart of the manual indoor tour mode in a preferred embodiment of the first-person indoor tour method based on Mapbox in this application; Figure 3This is a flowchart of the automatic indoor navigation mode in a preferred embodiment of the first-person indoor navigation method based on Mapbox in this application.
[0046] This application also proposes a first-person indoor navigation method based on mapboxes, such as... Figure 1 As shown, the first-person indoor navigation method based on Mapbox includes the following steps:
[0047] Step S100: Initialize the camera and control the camera to enter a first-person perspective.
[0048] Specifically, the Mapbox map engine provides a FreeCameraOptions module, which allows access to the physical properties of the base camera entity, such as the camera's latitude and longitude, camera height, and the latitude and longitude of the viewpoint. Using these properties to initialize the camera and control it to enter a first-person perspective makes camera control more flexible and precise.
[0049] Step S100, which initializes the camera and controls it to enter a first-person perspective, includes determining multiple arrays of latitude and longitude coordinates based on the indoor navigation route in the Mapbox map engine.
[0050] Specifically, multiple arrays of latitude and longitude coordinates can be determined based on the indoor navigation route in the Mapbox map engine to facilitate the management of objects on the map and achieve a better indoor scene display effect.
[0051] Specifically, the step of determining multiple latitude and longitude coordinate arrays based on the indoor guided movement route in the Mapbox map engine includes:
[0052] Create an initial indoor scene model and import the initial indoor scene model into the Mapbox map engine to generate the first Mapbox map engine;
[0053] Create a latitude and longitude coordinate system and import the latitude and longitude coordinate system into the first Mapbox map engine to generate a second Mapbox map engine;
[0054] Based on the second Mapbox map engine, the indoor guided tour route is preset, and multiple corresponding latitude and longitude coordinate arrays are determined.
[0055] Specifically, the initial indoor scene model is created using the Threebox plugin, namely Three.js. Three.js can use pre-defined components such as geometry, materials, and lighting to present a visually appealing indoor tour scene. The initial indoor scene model is then imported into the Mapbox map engine to generate the first Mapbox map engine. A latitude and longitude coordinate system is created, and the latitude and longitude coordinate system is imported into the first Mapbox map engine to generate the second Mapbox map engine. This second Mapbox map engine is used to manage objects in the map and synchronize them to the map and scene camera. Based on the second Mapbox map engine, the indoor tour route is preset, and multiple corresponding latitude and longitude coordinate arrays are determined to achieve a first-person perspective indoor tour based on the Mapbox GL JS map engine.
[0056] In some embodiments, step S100: initializing the camera and controlling the camera to enter a first-person perspective specifically includes: setting the initial azimuth angle, pitch angle and gaze point of the camera, and controlling the camera to enter a first-person perspective.
[0057] Specifically, when switching to a first-person perspective, you can set the camera's initial azimuth, pitch, and gaze point as needed. In the Mapbox GL JS map engine, at 0° the line of sight is perpendicular to the ground, and at 90° the line of sight is parallel to the ground. You can bring the viewpoint close to the ground and set the pitch angle to 85° (or other angles as needed). Set the camera's initial azimuth as needed, and fix the gaze point radius as needed to determine the gaze point position. After setting, call the map.setFreeCameraOptions() method to control the camera to enter the first-person perspective with the set initial azimuth, pitch, and gaze point parameters.
[0058] Step S200: Obtain the first latitude and longitude coordinate array and the second latitude and longitude coordinate array in the indoor navigation movement route in the Mapbox map engine, and set the first latitude and longitude coordinate array and the second latitude and longitude coordinate array as the first starting point and the first ending point, respectively.
[0059] Specifically, the first two latitude and longitude coordinate arrays in the indoor tour route from the Mapbox map engine can be obtained and used as the first latitude and longitude coordinate array and the second latitude and longitude coordinate array, respectively. The first latitude and longitude coordinate array and the second latitude and longitude coordinate array are set as the first starting point and the first ending point, respectively. The camera moves gradually within the first starting point and the first ending point, and switches gradually between each frame to make the indoor tour video smoother.
[0060] Step S300: Calculate the azimuth angle between the first starting point and the first ending point, and control the camera to rotate according to the azimuth angle.
[0061] Specifically, the azimuth angle between the first starting point and the first ending point is calculated using the circle method of Turf.js, and the camera is rotated according to the azimuth angle.
[0062] In some embodiments, step S300, which calculates the azimuth angle between the first starting point and the first ending point and controls the camera to rotate according to the azimuth angle, specifically includes: setting the first starting point as the center of rotation of the camera, calculating the azimuth angle between the first starting point and the first ending point, and controlling the camera and the gaze point to rotate according to the center and the azimuth angle.
[0063] Specifically, when the camera rotates its viewpoint, the first starting point can be set as the center of the camera rotation circle. The azimuth angle between the first starting point and the first ending point can be calculated. Based on the center position, azimuth angle, and initial azimuth angle, the camera and the gaze point can be rotated so that the camera and the gaze point are facing the first ending point, which facilitates forward movement from a first-person perspective.
[0064] One approach is to use the circle method of Turf.js to calculate a circle with the camera's location as the center and the radius being the distance from the camera to the gaze point. This circle is then divided into 360 points, which are the mapping points for a 360° circle. The gaze point is then set as a point on the circle according to the rotation direction (counterclockwise for left turn, clockwise for right turn), thus achieving rotation of the first-person perspective.
[0065] Step S400: Calculate the distance between the first starting point and the first ending point, and move the camera to the first ending point step by step according to the distance at a first preset step frequency.
[0066] Specifically, Turf.js is an open-source JavaScript library for spatial analysis. It includes functions such as calculating the positional information between two points, creating different types of geometry, projection transformation and calculation of different coordinate systems. Therefore, Turf.js can be used to calculate the distance between the first starting point and the first ending point. Based on the calculated distance between the first starting point and the first ending point, the camera can be moved step by step to the first ending point at a first preset step frequency.
[0067] Specifically, step S400, which involves calculating the distance between the first starting point and the first ending point and moving the camera to the first ending point gradually according to the distance at a first preset step frequency, includes: calculating the distance between the first starting point and the first ending point, dividing the distance into multiple points with equal spacing, setting the spacing as the first preset step frequency, moving the camera to the first ending point gradually according to the first preset step frequency, and moving the gaze point gradually according to the first preset step frequency.
[0068] Specifically, when the camera moves in parallel, the distance between the first starting point and the first ending point is calculated, the distance is divided into multiple points with equal spacing, the spacing is set as the first preset step frequency, and the camera is moved step by step at the first preset step frequency until the first ending point. The gaze point is also moved step by step at the first preset step frequency to present an indoor scene from a first-person perspective.
[0069] The destination method of Turf.js can be used to calculate the camera position and gaze point position of the next frame. Based on the first starting point, the position of the next target point is calculated according to the given angle and the first preset step frequency. After calculating and setting the new latitude and longitude coordinates of the camera and the gaze point, the camera configuration is updated after movement, so as to achieve the display effect of the first-person perspective moving parallel in a specific direction.
[0070] Step S500: When the first endpoint is different from the endpoint of the indoor guided tour route, obtain the third latitude and longitude coordinate array, iterate the second latitude and longitude coordinate array to the first starting point, and iterate the third latitude and longitude coordinate array to the first endpoint, until the first endpoint is the same as the endpoint of the indoor guided tour route.
[0071] Specifically, when the first endpoint is different from the endpoint of the indoor guided tour route, the third latitude and longitude coordinate array is obtained. The second latitude and longitude coordinate array is iterated to the first starting point, and the third latitude and longitude coordinate array is iterated to the first endpoint. This process is repeated until the first endpoint is the same as the endpoint of the indoor guided tour route, so that the scene of the entire indoor guided tour route can be gradually displayed with the camera in a first-person perspective.
[0072] Among them, such as Figure 3 As shown, the specific process of the first-person indoor navigation method based on mapbox is as follows:
[0073] The user inputs a cruise route, and the system exports multiple corresponding latitude and longitude arrays based on the input route as the movement route for indoor navigation. After setting, the system automatically initializes the first-person perspective. After initialization, the system enters automatic cruise mode, using the first and second points of the indoor navigation movement route as the start and end points, respectively, and enters the standard automatic cruise process. First, the azimuth angles between the start and end points are calculated, and the viewpoint is adjusted to the direction of the end point. Second, the distance between the start and end points is calculated, and this distance is divided into multiple points at given intervals. The camera and gaze point positions are then set to these points in sequence, allowing the viewpoint to move parallel to the end point. When the route reaches the end point, it is determined whether the end point is the end point of the indoor navigation movement route. If the end point has been reached, the automatic cruise ends; otherwise, the above process is repeated.
[0074] Furthermore, the method also includes: setting a lifting step value, and lifting the camera and the gaze point according to the lifting step value.
[0075] Specifically, when the camera adjusts its viewing angle, a step value can be set. The camera and the gaze point are adjusted according to the step value, so that the camera and the gaze point increase or decrease in height according to the set step value, and the camera configuration is updated to show an ideal first-person perspective.
[0076] The first-person indoor navigation method based on Mapbox in this application can also switch to manual indoor navigation mode in any of the above steps, and implement manual indoor navigation mode. When the response time of manual indoor navigation mode is greater than the first preset time, the step of switching to manual mode is restored, and the preset indoor navigation movement route is returned.
[0077] The first preset time can be set to 5 seconds, 6 seconds, or any other suitable time as needed.
[0078] The manual indoor tour guide mode specifically includes:
[0079] Step S700: Determine the input content for manual control, and control the camera and gaze point movement according to the input content.
[0080] Specifically, in each step after the viewpoint initialization is completed, the system can execute the corresponding manual indoor tour operation at any time according to the user's input command, judge the input content of manual control, and control the movement of the camera and gaze point according to the input content, so that the camera and gaze point can achieve manual control of indoor tour.
[0081] Step S700: Determine the input content for manual control, and control the movement of the camera and gaze point based on the input content, specifically including:
[0082] Step S710: If the input is the first identifier, calculate the position of the camera and the gaze point in the next frame using the distance function based on the azimuth angle of the camera and the azimuth angle corresponding to the first identifier, and set the calculated data as the new position of the camera and the gaze point.
[0083] Step S720: If the input is the second identifier, use the circle drawing function to obtain the center of the camera circle, and rotate the camera and the gaze point according to the center of the circle, the radius of the gaze point, and the azimuth angle;
[0084] Step S730: If the input content is a third identifier, raise or lower the camera by stepping the preset fixed value.
[0085] Specifically, keyboard keys can be used as manual input to map different actions. If the input is "W, S, A, D", the distance function is used to calculate the position of the camera and the gaze point in the next frame based on the camera's azimuth and the azimuth corresponding to the first identifier. The calculated data is then set as the new position of the camera and the gaze point to achieve parallel movement in the first-person perspective (front, back, left, and right). If the input is "Q, E", the circle function is used to obtain the center of the camera. Based on the center, the gaze point radius, and the azimuth, the camera and the gaze point are rotated to achieve left and right rotation in the first-person perspective. If the input is "R, F", the camera is raised and lowered with a preset fixed value as a step value to achieve rising and falling in the first-person perspective. This allows control of the camera's latitude and longitude, camera height, and gaze point latitude and longitude in the free camera configuration module. The latest position attributes are calculated and set to the camera in each frame of map rendering, forming a smooth first-person perspective movement animation.
[0086] Among them, such as Figure 2 As shown, the specific process of manual navigation based on the first-person indoor navigation method using Mapbox is as follows:
[0087] Manually click to enter the first-person view and complete the initialization. After the view is initialized, the system waits for user input. The system uses keyboard keys to map different actions. The system will execute the corresponding operation according to the user's input command. For example, use the keys "W, S, A, D" to move the view horizontally forward, backward, left, and right; the keys "Q, E" to rotate the view left and right; and the keys "R, F" to raise and lower the view.
[0088] When moving in parallel, the Turf.destination() method is used to calculate the position of the camera and the gaze point in the next frame based on the camera azimuth angle and the target direction angle. Turf.destination() is to use a point as a reference, calculate the position of a target point (in degrees, radians, miles or kilometers) according to a given angle and distance, and set the calculated data as the new position of the camera and the gaze point.
[0089] When rotating the viewpoint, the circle method of Turf.js is used to obtain a circle with the camera as the center and the radius being the distance from the camera to the gaze point. This circle is then divided into 360 points, which are the mapping points of a 360° circle. Turf.circle() obtains a fixed center point, i.e. the location of the camera, calculates a circle polygon with a given radius (distance from the camera to the gaze point), sets the step size for precision, and sets the camera gaze point position sequentially according to the rotation direction.
[0090] When raising or lowering the viewing angle, the camera height is raised or lowered in steps according to a fixed value based on user input, and the camera height is increased or decreased according to the given minimum rise / fall interval.
[0091] After each of the above steps is completed, the camera configuration can be updated, and then the next action can be performed in a loop to achieve a manual indoor tour effect where the first-person perspective moves parallel in a specific direction.
[0092] Please see Figures 4 to 5 , Figure 4 This is a schematic diagram of a preferred embodiment of the first-person indoor navigation system based on Mapbox in this application; Figure 5 This is a schematic diagram of the operating environment of a preferred embodiment of the terminal of this application.
[0093] In some embodiments, such as Figure 4 As shown, based on the above-mentioned first-person indoor navigation method based on Mapbox, this application also proposes a first-person indoor navigation system based on Mapbox, the first-person indoor navigation system based on Mapbox comprising:
[0094] First-person perspective initialization module 51 is used to initialize the camera and control the camera to enter the first-person perspective.
[0095] The indoor tour guide movement route setting module 52 is used to obtain the first latitude and longitude coordinate array and the second latitude and longitude coordinate array in the indoor tour guide movement route in the Mapbox map engine, and set the first latitude and longitude coordinate array and the second latitude and longitude coordinate array as the first starting point and the first ending point, respectively.
[0096] The rotating view module 53 is used to calculate the azimuth angle between the first starting point and the first ending point, and control the camera to rotate according to the azimuth angle.
[0097] The parallel movement module 54 is used to calculate the distance between the first starting point and the first ending point, and move the camera to the first ending point step by step according to the distance at a first preset step frequency.
[0098] The data iteration and endpoint determination module 55 is used to obtain a third latitude and longitude coordinate array when the first endpoint is different from the endpoint of the indoor guided tour route, iterate the second latitude and longitude coordinate array to the first starting point, iterate the third latitude and longitude coordinate array to the first endpoint, until the first endpoint is the same as the endpoint of the indoor guided tour route.
[0099] In some embodiments, such as Figure 5As shown, based on the above-described first-person indoor navigation method and system based on Mapbox, this application also proposes a terminal, which includes: a memory 10, a processor 20, and a display 30. Figure 5 Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0100] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard drive or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 20 may include both internal and external storage units. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code installed on the terminal. The memory 20 can also be used to temporarily store data that has been output or will be output.
[0101] In one embodiment, the memory 20 stores a Mapbox-based first-person indoor tour guide program 40, which can be executed by the processor 10 to implement the Mapbox-based first-person indoor tour guide method of this application.
[0102] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, such as executing the first-person indoor navigation method based on Mapbox.
[0103] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
[0104] This application also proposes a computer-readable storage medium storing a Mapbox-based first-person indoor tour guide program, which, when executed by a processor, implements the steps of the Mapbox-based first-person indoor tour guide method as described above.
[0105] In summary, this application initializes the camera and controls it to enter a first-person perspective. It obtains the first and second latitude / longitude coordinate arrays from the Mapbox map engine's indoor navigation route, sets these arrays as the first starting point and the first ending point, calculates the azimuth angle between them, controls the camera's rotation based on the azimuth angle, calculates the distance between them, and moves the camera step-by-step to the first ending point according to the distance. When the first ending point differs from the endpoint of the indoor navigation route, a third latitude / longitude coordinate array is obtained. The second latitude / longitude coordinate array is iterated to the first starting point, and the third latitude / longitude coordinate array is iterated to the first ending point, until the first ending point matches the endpoint of the indoor navigation route. This application uses a first-person perspective and gradually rotates and moves the camera point-by-point within the Mapbox map engine, improving the indoor navigation effect and increasing the comprehensiveness of the displayed indoor geographical information. Secondly, this application sets a step value for camera elevation when raising and lowering the viewing angle. The camera and gaze point are raised and lowered according to this step value, allowing the camera and gaze point to adjust their height according to the set step value and updating the camera configuration to display an ideal first-person perspective, thus increasing the diversity of the camera's first-person viewpoint. Furthermore, this application increases the ease of operation of the first-person indoor tour method by allowing switching to manual indoor tour mode at any step. If the response time of the manual indoor tour mode exceeds a first preset time, the step from which manual mode was entered is restored, and the preset indoor tour route is returned.
[0106] It should be noted that the various optional implementation methods described in the embodiments of this application can be combined with each other or implemented individually, and the embodiments of this application do not limit this.
[0107] In the description of this application, it should be understood that the terms "upper," "lower," "left," and "right," etc., indicating orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or a specific orientational structure and operation. Therefore, they should not be construed as limitations on this application. Furthermore, "first" and "second" are only for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "multiple" means two or more.
[0108] In the description of this application, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0109] The above embodiments are described with reference to the accompanying drawings. Other different forms and embodiments are also feasible without departing from the principles of this application, and therefore this application should not be construed as limiting the embodiments set forth herein. Rather, these embodiments are provided to make this application complete and perfect, and to convey the scope of this application to those skilled in the art. In the drawings, component dimensions and relative dimensions may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting. The terms “comprising” and / or “including”, when used in this specification, indicate the presence of said features, integers, elements, and / or components, but do not exclude the presence or addition of one or more other features, integers, elements, components, and / or groups thereof. Unless otherwise shown, numerical ranges, when stated, include the upper and lower limits of the range and any subranges therebetween.
[0110] The above description is only a part of the embodiments of this application and does not limit the scope of protection of this application. Any equivalent device or equivalent process transformation made based on the content of this application specification and drawings, or direct or indirect application in other related technical fields, are similarly included in the patent protection scope of this application.
Claims
1. A first-person indoor navigation method based on mapboxes, characterized in that, include: Initialize the camera and control it to enter a first-person perspective. Obtain the first and second latitude and longitude coordinate arrays from the indoor navigation route in the Mapbox map engine, and set the first and second latitude and longitude coordinate arrays as the first starting point and the first ending point, respectively. Calculate the azimuth angle between the first starting point and the first ending point, and control the camera to rotate according to the azimuth angle; Calculate the distance between the first starting point and the first ending point, and move the camera to the first ending point step by step according to the distance at a first preset step frequency; When the first endpoint is different from the endpoint of the indoor guided tour route, a third latitude and longitude coordinate array is obtained, the second latitude and longitude coordinate array is iterated to the first starting point, and the third latitude and longitude coordinate array is iterated to the first endpoint, until the first endpoint is the same as the endpoint of the indoor guided tour route. The initialization of the camera, and the control of the camera to enter a first-person perspective, includes the following prior steps: Based on the indoor guided movement route in the Mapbox map engine, determine the corresponding multiple latitude and longitude coordinate arrays; The step of determining multiple latitude and longitude coordinate arrays based on the indoor guided movement route in the Mapbox map engine specifically includes: Create an initial indoor scene model and import the initial indoor scene model into the Mapbox map engine to generate the first Mapbox map engine; Create a latitude and longitude coordinate system and import the latitude and longitude coordinate system into the first Mapbox map engine to generate a second Mapbox map engine; Based on the second Mapbox map engine, the indoor guided tour route is preset, and multiple corresponding latitude and longitude coordinate arrays are determined.
2. The first-person indoor navigation method based on mapbox according to claim 1, characterized in that, The initialization of the camera, and the control of the camera to enter a first-person perspective, specifically includes: Set the initial azimuth angle, pitch angle, and gaze point of the camera, and control the camera to enter the first-person perspective.
3. The first-person indoor navigation method based on mapbox according to claim 2, characterized in that, The calculation of the azimuth angle between the first starting point and the first ending point, and the control of the camera to rotate based on the azimuth angle, specifically includes: The first starting point is set as the center of rotation of the camera. The azimuth angle between the first starting point and the first ending point is calculated. The camera and the gaze point are controlled to rotate according to the center and the azimuth angle.
4. The first-person indoor navigation method based on mapbox according to claim 3, characterized in that, The step of calculating the distance between the first starting point and the first ending point, and moving the camera step by step to the first ending point according to the distance at a first preset pace, specifically includes: Calculate the distance between the first starting point and the first ending point, divide the distance into multiple points with equal spacing, set the spacing as the first preset step frequency, and move the camera to the first ending point step by step according to the first preset step frequency, and move the gaze point step by step according to the first preset step frequency.
5. The first-person indoor navigation method based on mapbox according to claim 2, characterized in that, The method further includes: Set a lift step value, and lift the camera and the gaze point according to the lift step value.
6. A first-person indoor navigation system based on mapbox, wherein the first-person indoor navigation system based on mapbox is used to implement the first-person indoor navigation method based on mapbox as described in any one of claims 1-5, characterized in that, The Mapbox-based first-person indoor navigation system includes: The first-person perspective initialization module is used to initialize the camera and control the camera to enter the first-person perspective. The indoor guided tour route setting module is used to obtain the first latitude and longitude coordinate array and the second latitude and longitude coordinate array in the indoor guided tour route in the Mapbox map engine, and set the first latitude and longitude coordinate array and the second latitude and longitude coordinate array as the first starting point and the first ending point, respectively. A rotating view module is used to calculate the azimuth angle between the first starting point and the first ending point, and control the camera to rotate according to the azimuth angle. A parallel movement module is used to calculate the distance between the first starting point and the first ending point, and to move the camera to the first ending point step by step according to the distance at a first preset step frequency; The data iteration and endpoint determination module is used to obtain a third latitude and longitude coordinate array when the first endpoint is different from the endpoint of the indoor guided tour route, iterate the second latitude and longitude coordinate array to the first starting point, and iterate the third latitude and longitude coordinate array to the first endpoint, until the first endpoint is the same as the endpoint of the indoor guided tour route.
7. A terminal, characterized in that, The terminal includes: a memory, a processor, and a Mapbox-based first-person indoor tour guide program stored in the memory and executable on the processor. When the Mapbox-based first-person indoor tour guide program is executed by the processor, it implements the steps of the Mapbox-based first-person indoor tour guide method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a Mapbox-based first-person indoor tour guide program, which, when executed by a processor, implements the steps of the Mapbox-based first-person indoor tour guide method as described in any one of claims 1-5.
Citation Information
Patent Citations
Intelligent touring guide and visiting guide system and method based on map scaling ratio classification displaying
CN106803402A
Map display method based on osm data and high-precision data of mapbox engine
CN114413926A
