CN116069435A - Method, system and storage medium for dynamically loading picture resources in virtual scene - Google Patents

Method, system and storage medium for dynamically loading picture resources in virtual scene Download PDF

Info

Publication number
CN116069435A
CN116069435A CN202310241853.3A CN202310241853A CN116069435A CN 116069435 A CN116069435 A CN 116069435A CN 202310241853 A CN202310241853 A CN 202310241853A CN 116069435 A CN116069435 A CN 116069435A
Authority
CN
China
Prior art keywords
picture
carrier model
low
user camera
condition
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
CN202310241853.3A
Other languages
Chinese (zh)
Other versions
CN116069435B (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.)
Nanjing Weisaike Network Technology Co ltd
Original Assignee
Nanjing Weisaike Network Technology 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 Nanjing Weisaike Network Technology Co ltd filed Critical Nanjing Weisaike Network Technology Co ltd
Priority to CN202310241853.3A priority Critical patent/CN116069435B/en
Publication of CN116069435A publication Critical patent/CN116069435A/en
Application granted granted Critical
Publication of CN116069435B publication Critical patent/CN116069435B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/011Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/011Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
    • G06F3/013Eye tracking input arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/12Bounding box
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/21Collision detection, intersection
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Graphics (AREA)
  • Computer Hardware Design (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a method, a system and a storage medium for dynamically loading picture resources in a virtual scene, belonging to the technical field of virtual reality, wherein the method comprises the following steps: loading low-resolution pictures on a scene global carrier model as preview pictures, wherein each preview picture is correspondingly stored with a high-definition picture on a server; setting replacement conditions of the preview image and the high-definition image, wherein the replacement conditions comprise a low-to-high condition and a high-to-low condition; detecting whether the picture on the current carrier model meets the low-to-high condition in real time, and if so, requesting the server to download a high-definition picture for replacing the current preview picture; and detecting whether the picture on the current carrier model meets the high-to-low condition in real time, and unloading the current high-definition picture and reloading the preview picture if the picture meets the high-to-low condition. Through the low-to-high condition and the high-to-low condition, the low-to-high definition conversion can be performed on the pictures in the scene, so that the program cannot cause overlarge resource pressure due to the high-definition pictures, and the user's look and feel cannot be influenced due to the low-definition pictures.

Description

Method, system and storage medium for dynamically loading picture resources in virtual scene
Technical Field
The invention relates to the technical field of virtual reality, in particular to a method, a system and a storage medium for dynamically loading picture resources in a virtual scene.
Background
The Virtual Reality technology (VR) comprises a computer, electronic information and simulation technology, and the basic implementation mode is that the computer technology is used as the main mode, and the latest development achievements of various high technologies such as three-dimensional graphics technology, multimedia technology, simulation technology, display technology and servo technology are utilized and integrated, and a realistic Virtual world with various sensory experiences such as three-dimensional vision, touch sense and smell sense is generated by means of equipment such as the computer, so that a person in the Virtual world generates a feeling of being personally on the scene.
The virtual scene built by VR is widely applied, a great number of requirements for browsing and visiting in the virtual scene exist at present, a great number of exhibition pictures are required to be attached to the scene, in order to ensure that the exhibition pictures can be seen clearly by users, the definition of the pictures is required to be ensured, the resolution of the pictures is usually overlarge, the pictures cannot be directly loaded in projects, at present, most of traditional processing modes use dynamic loading technology, namely, a preview picture is firstly placed in the scene, and tourists load the scene and then download the pictures according to the requirements, and the pictures are completely downloaded and then replace default pictures, but the mode is easily influenced, for example, the network is poor or the downloading speed of the high-definition picture is too large, the experience of users is influenced, and loading too many high-definition pictures in the scene easily causes problems in program performance and even program breakdown.
Disclosure of Invention
The invention aims to provide a method, a system and a storage medium for dynamically loading picture resources in a virtual scene, which are used for solving the problems that the picture resource loading mode in the virtual scene is easy to influence user experience and the running of the scene is running due to the fact that pictures are too large.
In a first aspect, the present invention achieves the above object by the following technical solution, and a method for dynamically loading a picture resource in a virtual scene, including the following steps:
loading low-resolution pictures on a scene global carrier model as preview pictures, wherein each preview picture is correspondingly stored with a high-definition picture on a server;
setting replacement conditions of the preview image and the high-definition image, wherein the replacement conditions comprise a low-to-high condition and a high-to-low condition;
detecting whether the picture on the current carrier model meets the low-to-high condition in real time, and if so, requesting the server to download a high-definition picture for replacing the current preview picture; the detection method comprises the following steps:
a1, detecting the distance between a user camera and the carrier model, if the distance is smaller than the maximum visible distance, executing A2, otherwise ending the task;
a2, detecting whether a shielding object exists between the user camera and the carrier model, if the shielding object is not detected, executing the step A3, otherwise ending the task;
a3, detecting whether the picture on the carrier model is in the gazing range of the user camera, outputting to meet the condition of low-to-high conversion if the picture is detected to be in the gazing range of the user camera, and ending the task otherwise;
detecting whether the picture on the current carrier model meets the high-to-low condition in real time, and unloading the current high-definition picture and reloading the preview picture if the picture meets the high-to-low condition; the detection method comprises the following steps:
b1, detecting the distance between a user camera and the carrier model, starting a timer if the distance is larger than the maximum visible distance, outputting to meet the condition of high-low speed if the timing time meets the maximum set time, and executing B2 otherwise;
b2, detecting whether a shielding object exists between the user camera and the carrier model, if the shielding object is detected, starting a timer, if the timing time meets the maximum set time, outputting to meet the high-to-low condition, otherwise, executing the B3;
and B3, detecting whether the carrier model is in the visual field range of the user camera, if not, starting a timer, if the timing time meets the maximum set time, outputting to meet the high-low condition, and otherwise, ending the task.
Preferably, the memory size of the preview is within 20Kb, and the preview is stored in the storage space of the client.
Preferably, the method for detecting whether the occlusion object exists between the user camera and the carrier model in the step A2 and the step B2 includes:
taking a user camera as a starting point, and transmitting a detection ray in the direction of the camera, wherein the length of the detection ray is smaller than the maximum visible distance between the user camera and the carrier model;
judging whether the detected ray contacts with the collision body of the carrier model, if so, judging that the shielding object is not detected, otherwise, judging that the shielding object is detected.
Preferably, the method for detecting whether the picture on the carrier model is within the gaze range of the user camera in the step A3 includes:
acquiring a direction vector directPic of a picture facing on a carrier model;
acquiring a direction vector directCamera of a user camera;
calculating an included angle between directPic and directCamera, and if the angle meets the following conditions: and if the angle is more than or equal to 100 degrees and less than or equal to 180 degrees, judging that the camera is in the gazing range of the user camera, otherwise, judging that the camera is not in the gazing range of the user camera.
Preferably, the method for detecting whether the carrier model is in the field of view of the user camera in the step B3 includes:
generating a visual field bounding box of a user camera, wherein the visual field bounding box comprises a visual cone body formed by four surfaces, namely an upper surface, a lower surface, a left surface and a right surface, and a near cutting surface and a far cutting surface which are transversely arranged on the visual cone body;
acquiring a collision body of the carrier model;
and (3) detecting collision between the visual field bounding box of the user camera and the collision body, judging that the carrier model is in the visual field range of the user camera if collision is detected, otherwise, judging that the carrier model is not in the visual field range of the user camera.
Preferably, the maximum set time of the timer is 3-5s.
In a second aspect, the present invention achieves the above object by a technical solution, a system for dynamically loading picture resources in a virtual scene, including:
the picture loading unit is used for loading the low-resolution picture as a preview picture and downloading the high-definition picture from the server;
the detection unit is used for detecting whether the picture on the current carrier model meets the condition of low-to-high conversion in real time and detecting whether the picture on the current carrier model meets the condition of high-to-low conversion in real time;
the picture replacing unit is used for replacing the preview picture on the carrier model with a high-definition picture when the low-to-high condition is met; and the method is also used for replacing the high-definition image on the carrier model with the preview image when the high-to-low condition is met.
Preferably, the detection unit includes:
a maximum visual distance detection module for detecting whether a distance between a user camera and the carrier model exceeds a maximum visual distance;
the shielding object detection module is used for detecting whether shielding objects exist between the user camera and the carrier model;
the gazing range detection module is used for detecting whether the picture on the carrier model is in the gazing range of the user camera;
and the visual field range detection module is used for detecting whether the carrier model is in the visual field range of the user camera.
Preferably, the picture replacement unit includes:
the low-rotation high-replacement module is used for acquiring results output by the maximum visual distance detection module, the shielding object detection module and the gazing range detection module, and outputting results meeting the low-rotation high condition when the output results are that the distance between the user camera and the carrier model is not more than the maximum visual distance, no shielding object exists between the user camera and the carrier model and the picture on the carrier model is in the gazing range of the user camera in sequence;
the high-to-low replacing module is used for acquiring the results output by the maximum visual distance detecting module, the shelter detecting module and the visual field range detecting module, and outputting the result meeting the high-to-low condition when the output result is that the distance between the user camera and the carrier model exceeds the maximum visual distance, the shelter exists between the user camera and the carrier model is in any one of the visual field range of the user camera within the set maximum time.
In a third aspect, the present invention achieves the above object by a storage medium having stored thereon a computer program which, when executed by a processor, implements the method for dynamically loading picture resources in a virtual scene as described in the first aspect.
Compared with the prior art, the invention has the beneficial effects that: the low-to-high condition and the high-to-low condition are set, the pictures meeting the conditions in the scene can be replaced with each other in low definition, so that the program can not cause overlarge resource pressure due to the high-definition pictures, the user looking at the pictures can not be influenced due to the low-definition pictures, the high-definition pictures are preloaded by judging whether the user looks at the pictures, the user can load the high-definition pictures before looking at the pictures, the waiting time of the user can be reduced under the condition of poor network, the high-to-low condition is that the high-definition pictures are replaced with the original preview pictures by meeting any one condition that the distance between the user and the pictures is overlarge, the barrier exists in the middle of the picture and the picture is not in the visual field range, and the situation that the running stability of the program is influenced due to the overlarge high-definition pictures loaded in the scene can not be caused.
Drawings
FIG. 1 is a flow chart of a method for dynamically loading picture resources in a virtual scene according to the present invention.
FIG. 2 is a flow chart of a single detection method of whether the low-to-high condition is satisfied according to the present invention.
FIG. 3 is a flow chart of a single detection method of whether the high-to-low condition is satisfied.
Fig. 4 is a schematic diagram of a system for dynamically loading picture resources in a virtual scene according to the present invention.
Description of the embodiments
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
As shown in fig. 1, a method for dynamically loading picture resources in a virtual scene includes the following steps:
and loading a low-resolution picture on the scene global carrier model as a preview picture, wherein each preview picture is correspondingly stored with Gao Qingtu in a server, the preview picture is loaded when being bound in a scene along with the running scene of the client, the memory size of the preview picture is within 20Kb, and the size of the high-definition picture is between hundreds of k and tens of megabits, so that the memory occupation of the client cannot be increased when the high-definition picture is stored in the server. Setting replacement conditions of the preview image and the high-definition image, wherein the replacement conditions comprise a low-to-high condition and a high-to-low condition, the preview image and the high-definition image are mutually switched, when a user reaches the low-to-high condition, the client automatically replaces the preview image with the high-definition image, when the user reaches the high-to-low condition, the client automatically replaces the high-definition image with the preview image, the high-definition image corresponding to the preview image is downloaded by an access server in the low-to-high replacement process, the replaced preview image is temporarily stored in a memory of the client, in the high-to-low replacement process, the temporarily stored preview image is replaced in a reloading mode by unloading the high-definition image, so that the high-definition image cannot occupy the memory space of the client, and if the high-definition image needs to be replaced again, the high-definition image is downloaded again.
The method comprises the steps of pre-judging a user in advance, downloading a high-definition picture to replace a preview picture after a low-rotation high-definition condition is met, pre-downloading and replacing the high-definition picture by the pre-loading mode without clicking the high-definition picture by the user, so that the waiting time of the user is short, seamless transition between the preview picture and the high-definition picture can be achieved, whether the picture on a current carrier model meets the low-rotation high condition or not is detected in real time, if yes, the high-definition picture is requested to be downloaded to a server for replacing the current preview picture, when a virtual character walks in a scene, real-time detection is needed, the high-definition picture pre-loading can be guaranteed, in the single detection step flow is shown in fig. 2, the position of the user camera is the position of the virtual character in the scene, and the direction of the user camera is the direction seen by the user when the user controls the virtual character, and therefore, the picture on the current carrier model meets the low-rotation high condition or not.
Step A1, detecting the distance between a user camera and the carrier model, if the distance is smaller than the maximum visual distance, executing step A2, otherwise ending the task, wherein the step is used for judging whether the distance between the virtual character and the exhibited picture is in the maximum visual distance range, the distance between the virtual character and the exhibited picture can be calculated by utilizing the coordinates of the user camera and the coordinates of the carrier model, if the distance exceeds the maximum visual distance, the surface user cannot see the picture content, and if the distance exceeds the maximum visual distance, the single detection is ended, so that the step A2 can be executed only if the distance between the virtual character and the exhibited picture is smaller than the maximum visual distance;
step A2, detecting whether a shielding object exists between a user camera and the carrier model, if the shielding object is not detected, executing the step A3, otherwise ending the task, and if the shielding object exists between the virtual character and the picture, proving that the user cannot directly see the carrier model, and the vision of the user is shielded, so that the condition of low-to-high speed is not met, ending the single detection, and executing the step A3 only when the user can directly see the carrier model;
and A3, detecting whether the picture on the carrier model is in the gazing range of the user camera, outputting to meet the low-to-high condition if the picture is detected to be in the gazing range of the user camera, otherwise ending the task, wherein in the step A2, the user can directly see the carrier model, but cannot judge whether the picture on the carrier model can be seen by the user, and if the direction of the picture is excessively deviated from the view angle direction of the user, for example, the picture is opposite to the user and the user is opposite to the user, the user cannot completely see the picture, so that the user cannot judge whether the user wants to view the picture, and only if the picture is in the gazing range of the user camera, the user can show that the user has the intention of looking at the picture, and then judge that the low-to-high condition is met. The method for detecting whether the picture on the carrier model is in the gaze range of the user camera in the step A3 comprises the following steps:
acquiring a direction vector directPic of a picture facing on a carrier model;
acquiring a direction vector directCamera of a user camera;
calculating an included angle between directPic and directCamera, and if the angle meets the following conditions: and if the angle is more than or equal to 100 degrees and less than or equal to 180 degrees, judging that the camera is in the gazing range of the user camera, otherwise, judging that the camera is not in the gazing range of the user camera. The angle is within 0-90 degrees, the picture surface and the view field of the user are cheap and overlarge, for example, when the angle is within 0 degrees, the picture faces away from the virtual character, at the moment, the picture content cannot be seen, when the angle is within 90 degrees, the picture content is oriented perpendicular to the view angle of the virtual character, and cannot be seen, when the angle is within 90-100 degrees, the picture faces towards the view angle of the virtual character, the user can hardly see the whole picture completely although the picture can be seen, so that the range of 0-100 degrees does not belong to the gazing range, and the condition of gazing of the user is met only when the angle is within 100-180 degrees.
After the user looks up the high-definition image, in order to avoid that the high-definition image always occupies scene resources, the high-definition image is unloaded and replaced with the preview image again, so that the user operation is required to be prejudged, the prejudgment mode is to unload the current high-definition image and reload the preview image by detecting whether the image on the current carrier model meets the high-to-low condition or not, and if so, unloading the current high-definition image; similar to the detection of the low-to-high condition, the detection of the high-to-low condition also requires real-time detection, and the detection method in fig. 3 is a single detection step, which is specifically as follows:
step B1, detecting the distance between a user camera and the carrier model, if the distance is larger than the maximum visible distance, starting a timer, if the timing time meets the maximum setting time, outputting to meet the high-to-low condition, otherwise, executing step B2, wherein the distance calculation mode of the virtual character and the picture is the same as that of step A1 when the low-to-high condition is detected, when the distance is larger than the maximum visible distance, indicating that the user leaves the range of the carrier model, in order to ensure that the user does not leave temporarily, increasing the timer to count the duration exceeding the maximum visible distance, and after the time reaches the maximum setting time, judging that the user leaves thoroughly, so as to meet the high-to-low condition, if the distance between the virtual character and the displayed picture is smaller than the maximum visible distance or the calculated duration of the timer is smaller than the maximum setting time, indicating that whether the high-to-low condition is met cannot be judged singly according to the situation, and executing step B2 again;
step B2, detecting whether a shielding object exists between a user camera and the carrier model, if the shielding object is detected, starting a timer, if the timing time meets the maximum setting time, outputting to meet the high-to-low condition, otherwise, executing step B3, even if the distance between the virtual character and the picture of the exhibition is still within the maximum range, if the shielding object exists between the virtual character and the picture, the user cannot directly see the carrier model, indicating that the user possibly leaves the picture, starting timing of the duration, judging that the user does not look at the picture after the time reaches the maximum setting time, so as to meet the high-to-low condition, if no shielding object is left or the duration does not reach the maximum setting time, indicating that whether the high-to-low condition is met or not can not be judged singly according to the situation, and executing step B3;
step B3, detecting whether the carrier model is in the visual field of the user camera, if the carrier model is not in the visual field, starting a timer, outputting to meet the high-low condition if the timing time meets the maximum setting time, otherwise ending the task, when the carrier model exceeds the visual field of the user camera, indicating that the user cannot see the carrier model temporarily, starting timing of the duration time, judging that the user is not viewing the picture after the time reaches the maximum setting time, so that the high-low condition is met, and if the carrier model does not exceed the visual field of the user camera or the duration time does not reach the maximum setting time, indicating that all the conditions are not met, so that the high-low operation of the picture cannot be executed, wherein the step B2 is the same in that the step is also used for judging whether the user is viewing the picture, but is different from the step B2 in that the picture is blocked from the virtual character, but the visual field coverage picture is not influenced, so that the detection judgment of the step B2 is performed. The method for detecting whether the carrier model is in the visual field of the user camera in the step B3 comprises the following steps:
generating a visual field bounding box of a user camera, wherein the visual field bounding box comprises a view cone body formed by four surfaces, namely an upper surface, a lower surface, a left surface and a right surface, and a near clipping surface and a far clipping surface which are transversely arranged on the view cone body, the view cone body is equivalent to a visual field frame of human eyes and is used for defining the upper, lower, left and right visual field ranges of the user, the near clipping surface can limit pictures to be difficult to focus and cannot be seen clearly because of too close, and the far clipping surface can limit pictures to be blurred and cannot be seen clearly because of too far;
acquiring a collision body of the carrier model;
and (3) detecting collision between the visual field bounding box of the user camera and the collision body, judging that the carrier model is in the visual field range of the user camera if collision is detected, otherwise, judging that the carrier model is not in the visual field range of the user camera.
The maximum setting time of the timer in the steps B1, B2, and B3 is 3-5s, and is usually set to 3s, and the difference between the detection of the low-to-high condition and the detection of the high-to-low condition is that the step A3 needs to detect whether the picture on the carrier model is within the gaze range of the user camera, because the user only needs to check whether the carrier model is within the field of view of the user camera considering that the user wants to check the motion trend of the picture when looking at the picture, and the step B3 only needs to detect whether the carrier model is within the field of view of the user camera, because once the visual field of the virtual character is separated from the picture, it is indicated that the user is not looking at the picture at this time, and if the high-to-low condition is met by judging whether the user looks at the picture, erroneous judgment is easily caused.
The method for detecting whether the occlusion exists between the user camera and the carrier model in the step A2 and the step B2 comprises the following steps:
taking a user camera as a starting point, and transmitting a detection ray in the direction of the camera, wherein the length of the detection ray is smaller than the maximum visible distance between the user camera and the carrier model;
judging whether the detected ray contacts with the collision body of the carrier model, if so, judging that the shielding object is not detected, otherwise, judging that the shielding object is detected.
Example 2
As shown in fig. 4, a system for dynamically loading picture resources in a virtual scene includes:
the image loading unit is used for loading the low-resolution image as a preview image and downloading the high-definition image from the server, wherein the preview image is bound in the scene and can be loaded when the scene is operated along with the client.
The detection unit detects whether the picture on the current carrier model meets the low-to-high condition in real time and detects whether the picture on the current carrier model meets the condition in high-to-low condition in real time, the position of the user camera is the position of the virtual character in the scene, the orientation of the user camera is the direction seen by the visual angle when the user controls the virtual character, and the detection unit further comprises:
the maximum visual distance detection module is used for detecting whether the distance between the user camera and the carrier model exceeds the maximum visual distance, firstly calculating the distance between the virtual character and the picture, and then comparing the distance with the maximum visual distance to judge whether the distance exceeds the maximum visual distance;
the shielding object detection module is used for detecting whether a shielding object exists between the user camera and the carrier model, and the calculation method of the module is as follows: taking a user camera as a starting point, and transmitting a detection ray in the direction of the camera, wherein the length of the detection ray is smaller than the maximum visible distance between the user camera and the carrier model; judging whether the detected ray contacts with a collision body of the carrier model, if so, judging that the shielding object is not detected, otherwise, judging that the shielding object is detected;
the gaze range detection module is used for detecting whether the picture on the carrier model is in the gaze range of the user camera, and the calculation method of the module is as follows: acquiring a direction vector directPic of a picture facing on a carrier model; acquiring a direction vector directCamera of a user camera; calculating an included angle between directPic and directCamera, and if the angle meets the following conditions: and if the angle is more than or equal to 100 degrees and less than or equal to 180 degrees, judging that the camera is in the gazing range of the user camera, otherwise, judging that the camera is not in the gazing range of the user camera. The picture of angle is in the state of facing away from the virtual character within 0-90 degrees, the user cannot see the picture content, and the user can hardly see the whole picture completely although the picture of angle is within 90-100 degrees, so the range of 0-100 degrees does not belong to the gazing range, and the gazing condition of the user is met only if the angle is within 100-180 degrees;
the visual field range detection module is used for detecting whether the carrier model is in the visual field range of the user camera, and the calculation method of the module is as follows: generating a visual field bounding box of a user camera, wherein the visual field bounding box comprises a view cone body formed by four surfaces, namely an upper surface, a lower surface, a left surface and a right surface, and a near clipping surface and a far clipping surface which are transversely arranged on the view cone body, the view cone body is equivalent to a visual field frame of human eyes and is used for defining the upper, lower, left and right visual field ranges of the user, the near clipping surface can limit pictures to be difficult to focus and cannot be seen clearly because of too close, and the far clipping surface can limit pictures to be blurred and cannot be seen clearly because of too far; acquiring a collision body of the carrier model; and (3) detecting collision between the visual field bounding box of the user camera and the collision body, judging that the carrier model is in the visual field range of the user camera if collision is detected, otherwise, judging that the carrier model is not in the visual field range of the user camera.
The picture replacing unit is used for replacing the preview picture on the carrier model with a high-definition picture when the low-to-high condition is met; and the picture replacing unit is further used for replacing the high-definition picture on the carrier model with a preview picture when the high-to-low condition is met, and the picture replacing unit further comprises:
the low-rotation high-replacement module is used for acquiring results output by the maximum visual distance detection module, the shielding object detection module and the gazing range detection module, and outputting results meeting the low-rotation high condition when the output results are that the distance between the user camera and the carrier model is not more than the maximum visual distance, no shielding object exists between the user camera and the carrier model and the picture on the carrier model is in the gazing range of the user camera in sequence;
the high-to-low replacing module is used for acquiring the results output by the maximum visual distance detecting module, the shelter detecting module and the visual field range detecting module, and outputting the result meeting the high-to-low condition when the output result is that the distance between the user camera and the carrier model exceeds the maximum visual distance, the shelter exists between the user camera and the carrier model is in any one of the visual field range of the user camera within the set maximum time.
Example 3
The embodiment provides a storage medium, which comprises a storage program area and a storage data area, wherein the storage program area can store an operating system, a program required by running an instant messaging function and the like; the storage data area can store various instant messaging information, operation instruction sets and the like. A computer program is stored in the storage program area, which when executed by a processor implements the method of dynamically loading picture resources in a virtual scene as described in embodiment 1. The processor may include one or more Central Processing Units (CPUs) or a digital processing unit or the like.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.
Furthermore, it should be understood that although the present disclosure describes embodiments, not every embodiment is provided with a separate embodiment, and that this description is provided for clarity only, and that the disclosure is not limited to the embodiments described in detail below, and that the embodiments described in the examples may be combined as appropriate to form other embodiments that will be apparent to those skilled in the art.

Claims (10)

1. A method for dynamically loading picture resources in a virtual scene, comprising the steps of:
loading low-resolution pictures on a scene global carrier model as preview pictures, wherein each preview picture is correspondingly stored with a high-definition picture on a server;
setting replacement conditions of the preview image and the high-definition image, wherein the replacement conditions comprise a low-to-high condition and a high-to-low condition;
detecting whether the picture on the current carrier model meets the low-to-high condition in real time, and if so, requesting the server to download a high-definition picture for replacing the current preview picture; the detection method comprises the following steps:
a1, detecting the distance between a user camera and the carrier model, if the distance is smaller than the maximum visible distance, executing A2, otherwise ending the task;
a2, detecting whether a shielding object exists between the user camera and the carrier model, if the shielding object is not detected, executing the step A3, otherwise ending the task;
a3, detecting whether the picture on the carrier model is in the gazing range of the user camera, outputting to meet the condition of low-to-high conversion if the picture is detected to be in the gazing range of the user camera, and ending the task otherwise;
detecting whether the picture on the current carrier model meets the high-to-low condition in real time, and unloading the current high-definition picture and reloading the preview picture if the picture meets the high-to-low condition; the detection method comprises the following steps:
b1, detecting the distance between a user camera and the carrier model, starting a timer if the distance is larger than the maximum visible distance, outputting to meet the condition of high-low speed if the timing time meets the maximum set time, and executing B2 otherwise;
b2, detecting whether a shielding object exists between the user camera and the carrier model, if the shielding object is detected, starting a timer, if the timing time meets the maximum set time, outputting to meet the high-to-low condition, otherwise, executing the B3;
and B3, detecting whether the carrier model is in the visual field range of the user camera, if not, starting a timer, if the timing time meets the maximum set time, outputting to meet the high-low condition, and otherwise, ending the task.
2. The method for dynamically loading picture resources in a virtual scene according to claim 1, wherein the memory size of the preview is within 20Kb, and the preview is stored in a storage space of a client.
3. The method for dynamically loading picture resources in a virtual scene according to claim 1, wherein the method for detecting whether an occlusion exists between a user camera and the carrier model in step A2 and step B2 comprises:
taking a user camera as a starting point, and transmitting a detection ray in the direction of the camera, wherein the length of the detection ray is smaller than the maximum visible distance between the user camera and the carrier model;
judging whether the detected ray contacts with the collision body of the carrier model, if so, judging that the shielding object is not detected, otherwise, judging that the shielding object is detected.
4. The method for dynamically loading picture resources in a virtual scene according to claim 1, wherein the method for detecting whether the picture on the carrier model is within the gaze range of the user camera in step A3 comprises:
acquiring a direction vector directPic of a picture facing on a carrier model;
acquiring a direction vector directCamera of a user camera;
calculating an included angle between directPic and directCamera, and if the angle meets the following conditions: and if the angle is more than or equal to 100 degrees and less than or equal to 180 degrees, judging that the camera is in the gazing range of the user camera, otherwise, judging that the camera is not in the gazing range of the user camera.
5. The method for dynamically loading picture resources in a virtual scene as recited in claim 1, wherein the method for detecting whether the carrier model is in the field of view of the user camera in step B3 comprises:
generating a visual field bounding box of a user camera, wherein the visual field bounding box comprises a visual cone body formed by four surfaces, namely an upper surface, a lower surface, a left surface and a right surface, and a near cutting surface and a far cutting surface which are transversely arranged on the visual cone body;
acquiring a collision body of the carrier model;
and (3) detecting collision between the visual field bounding box of the user camera and the collision body, judging that the carrier model is in the visual field range of the user camera if collision is detected, otherwise, judging that the carrier model is not in the visual field range of the user camera.
6. The method for dynamically loading picture resources in a virtual scene as recited in claim 1, wherein the maximum set time of the timer is 3-5s.
7. A system for dynamically loading picture resources in a virtual scene, comprising:
the picture loading unit is used for loading the low-resolution picture as a preview picture and downloading the high-definition picture from the server;
the detection unit is used for detecting whether the picture on the current carrier model meets the condition of low-to-high conversion in real time and detecting whether the picture on the current carrier model meets the condition of high-to-low conversion in real time;
the picture replacing unit is used for replacing the preview picture on the carrier model with a high-definition picture when the low-to-high condition is met; and the method is also used for replacing the high-definition image on the carrier model with the preview image when the high-to-low condition is met.
8. The system for dynamically loading picture resources in a virtual scene as recited in claim 7, wherein the detecting unit comprises:
a maximum visual distance detection module for detecting whether a distance between a user camera and the carrier model exceeds a maximum visual distance;
the shielding object detection module is used for detecting whether shielding objects exist between the user camera and the carrier model;
the gazing range detection module is used for detecting whether the picture on the carrier model is in the gazing range of the user camera;
and the visual field range detection module is used for detecting whether the carrier model is in the visual field range of the user camera.
9. The system for dynamically loading picture resources in a virtual scene as recited in claim 8, wherein the picture replacement unit comprises:
the low-rotation high-replacement module is used for acquiring results output by the maximum visual distance detection module, the shielding object detection module and the gazing range detection module, and outputting results meeting the low-rotation high condition when the output results are that the distance between the user camera and the carrier model is not more than the maximum visual distance, no shielding object exists between the user camera and the carrier model and the picture on the carrier model is in the gazing range of the user camera in sequence;
the high-to-low replacing module is used for acquiring the results output by the maximum visual distance detecting module, the shelter detecting module and the visual field range detecting module, and outputting the result meeting the high-to-low condition when the output result is that the distance between the user camera and the carrier model exceeds the maximum visual distance, the shelter exists between the user camera and the carrier model is in any one of the visual field range of the user camera within the set maximum time.
10. A storage medium having stored thereon a computer program which, when executed by a processor, implements the method of dynamically loading picture resources in a virtual scene as claimed in any of claims 1-6.
CN202310241853.3A 2023-03-14 2023-03-14 Method, system and storage medium for dynamically loading picture resources in virtual scene Active CN116069435B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310241853.3A CN116069435B (en) 2023-03-14 2023-03-14 Method, system and storage medium for dynamically loading picture resources in virtual scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310241853.3A CN116069435B (en) 2023-03-14 2023-03-14 Method, system and storage medium for dynamically loading picture resources in virtual scene

Publications (2)

Publication Number Publication Date
CN116069435A true CN116069435A (en) 2023-05-05
CN116069435B CN116069435B (en) 2023-06-13

Family

ID=86180401

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310241853.3A Active CN116069435B (en) 2023-03-14 2023-03-14 Method, system and storage medium for dynamically loading picture resources in virtual scene

Country Status (1)

Country Link
CN (1) CN116069435B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116310152A (en) * 2023-05-24 2023-06-23 南京维赛客网络科技有限公司 Step-by-step virtual scene building and roaming method based on units platform and virtual scene

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662476A (en) * 2012-04-20 2012-09-12 天津大学 Gaze estimation method
CN106485776A (en) * 2016-11-23 2017-03-08 北京三体高创科技有限公司 A kind of method and system of 3D game real-time rendering large scale scene
CN106910236A (en) * 2017-01-22 2017-06-30 北京微视酷科技有限责任公司 Rendering indication method and device in a kind of three-dimensional virtual environment
CN108769739A (en) * 2018-06-27 2018-11-06 哈尔滨市舍科技有限公司 The method that picture and short-sighted frequency are obtained from panoramic video
CN112587921A (en) * 2020-12-16 2021-04-02 成都完美时空网络技术有限公司 Model processing method and device, electronic equipment and storage medium
CN113313140A (en) * 2021-04-14 2021-08-27 中国海洋大学 Three-dimensional model classification and retrieval method and device based on deep attention
CN113810755A (en) * 2021-09-15 2021-12-17 北京百度网讯科技有限公司 Panoramic video preview method and device, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662476A (en) * 2012-04-20 2012-09-12 天津大学 Gaze estimation method
CN106485776A (en) * 2016-11-23 2017-03-08 北京三体高创科技有限公司 A kind of method and system of 3D game real-time rendering large scale scene
CN106910236A (en) * 2017-01-22 2017-06-30 北京微视酷科技有限责任公司 Rendering indication method and device in a kind of three-dimensional virtual environment
CN108769739A (en) * 2018-06-27 2018-11-06 哈尔滨市舍科技有限公司 The method that picture and short-sighted frequency are obtained from panoramic video
CN112587921A (en) * 2020-12-16 2021-04-02 成都完美时空网络技术有限公司 Model processing method and device, electronic equipment and storage medium
CN113313140A (en) * 2021-04-14 2021-08-27 中国海洋大学 Three-dimensional model classification and retrieval method and device based on deep attention
CN113810755A (en) * 2021-09-15 2021-12-17 北京百度网讯科技有限公司 Panoramic video preview method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116310152A (en) * 2023-05-24 2023-06-23 南京维赛客网络科技有限公司 Step-by-step virtual scene building and roaming method based on units platform and virtual scene

Also Published As

Publication number Publication date
CN116069435B (en) 2023-06-13

Similar Documents

Publication Publication Date Title
US8803896B2 (en) Providing a coherent user interface across multiple output devices
US20170155885A1 (en) Methods for reduced-bandwidth wireless 3d video transmission
CN110377264B (en) Layer synthesis method, device, electronic equipment and storage medium
US11711563B2 (en) Methods and systems for graphics rendering assistance by a multi-access server
KR20210151114A (en) Hybrid rendering
CN116069435B (en) Method, system and storage medium for dynamically loading picture resources in virtual scene
CN110363831B (en) Layer composition method and device, electronic equipment and storage medium
CN110599396A (en) Information processing method and device
US20100302267A1 (en) Extended Rotation And Sharpening Of An Object Viewed From A Finite Number Of Angles
JP2004213641A (en) Image processor, image processing method, information processor, information processing system, semiconductor device and computer program
US20100156932A1 (en) Method for inserting moving picture into 3-dimension screen and record medium for the same
CN111589111B (en) Image processing method, device, equipment and storage medium
CN111640191B (en) VR (virtual reality) -based method for collecting and processing projection screen images
CN109391773B (en) Method and device for controlling movement of shooting point during switching of panoramic page
JP7361399B2 (en) Screen capture methods, devices and storage media
WO2022033162A1 (en) Model loading method and related apparatus
CN113810755B (en) Panoramic video preview method and device, electronic equipment and storage medium
EP1187071B1 (en) Computer graphics apparatus
US9129415B2 (en) Appearance of an object
CN109814703A (en) A kind of display methods, device, equipment and medium
US11632538B2 (en) Object display in virtual and augmented reality
CN115576634B (en) Information display method, device, equipment and storage medium
CN117333594A (en) Image processing method, device, equipment and medium
CN117319735A (en) Screen recording method and device, electronic equipment and storage medium
CN115564932A (en) Data processing method and data processing device

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