CN113763520A - Method and device for indicating three-dimensional model orientation - Google Patents

Method and device for indicating three-dimensional model orientation Download PDF

Info

Publication number
CN113763520A
CN113763520A CN202010485954.1A CN202010485954A CN113763520A CN 113763520 A CN113763520 A CN 113763520A CN 202010485954 A CN202010485954 A CN 202010485954A CN 113763520 A CN113763520 A CN 113763520A
Authority
CN
China
Prior art keywords
coordinate system
target
dimensional model
coordinates
screen
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.)
Pending
Application number
CN202010485954.1A
Other languages
Chinese (zh)
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010485954.1A priority Critical patent/CN113763520A/en
Publication of CN113763520A publication Critical patent/CN113763520A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/06Topological mapping of higher dimensional structures onto lower dimensional surfaces
    • G06T3/067Reshaping or unfolding 3D tree structures onto 2D planes

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a method and a device for indicating the orientation of a three-dimensional model, and relates to the technical field of computers. One embodiment of the method comprises: judging whether the three-dimensional model is rendered in a screen or not; if not, converting the coordinates of the target position of the three-dimensional model under a world space coordinate system into the coordinates under a target coordinate system, so as to obtain the coordinates of the target position under the target coordinate system; calculating a rotation included angle according to the coordinates of the target position under the target coordinate system; and rotating an arrow indicator based on the rotation included angle to indicate the position of the three-dimensional model. The embodiment can solve the technical problem that the orientation of the model cannot be determined.

Description

Method and device for indicating three-dimensional model orientation
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for indicating the position of a three-dimensional model.
Background
With the development of technology, the virtual world is only perceived through a screen, and the requirements of users are no longer met, so that application scenarios of Augmented Reality (AR)/Virtual Reality (VR) are more and more extensive.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
in an AR/VR scene, if the three-dimensional model is not rendered within the screen, the user cannot determine the orientation of the model, resulting in a degraded user experience.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for indicating a three-dimensional model orientation, so as to solve the technical problem that the model orientation cannot be determined.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of indicating an orientation of a three-dimensional model, including:
judging whether the three-dimensional model is rendered in a screen or not; if not, converting the coordinates of the target position of the three-dimensional model under a world space coordinate system into the coordinates under a target coordinate system, so as to obtain the coordinates of the target position under the target coordinate system;
calculating a rotation included angle according to the coordinates of the target position under the target coordinate system;
and rotating an arrow indicator based on the rotation included angle to indicate the position of the three-dimensional model.
Optionally, converting coordinates of the target position of the three-dimensional model in a world space coordinate system into coordinates in a target coordinate system, so as to obtain coordinates of the target position in the target coordinate system, including:
converting the coordinates of the target position of the three-dimensional model under a world space coordinate system into a screen coordinate system;
and converting the coordinates of the target position under the screen coordinate system into the coordinates of the target position under the target coordinate system, thereby obtaining the coordinates of the target position under the target coordinate system.
Optionally, the screen coordinate system is a two-dimensional space coordinate system with the upper left corner of the screen as an origin, the horizontal right direction of the screen as the positive direction of the X axis, and the vertical downward direction of the screen as the positive direction of the Y axis;
the target coordinate system is a two-dimensional space coordinate system which takes the center of the screen as an original point, takes the horizontal right direction of the screen as the positive direction of a Y axis and takes the vertical downward direction of the screen as the positive direction of an X axis.
Optionally, the target position of the three-dimensional model comprises a center position of the three-dimensional model.
Optionally, converting the coordinates of the target position of the three-dimensional model in the world space coordinate system to be below the screen coordinate system includes:
converting the coordinates of the target position of the three-dimensional model under a model space coordinate system into a world space coordinate system;
converting the coordinates of the target position of the three-dimensional model under the world space coordinate system into an observation space coordinate system;
converting the coordinates of the target position of the three-dimensional model under the observation space coordinate system into a cutting space coordinate system;
and converting the coordinates of the target position of the three-dimensional model under the cutting space coordinate system into a screen coordinate system.
Optionally, calculating a rotation included angle according to the coordinates of the target position in the target coordinate system, including:
calculating a target vector taking an origin of the target coordinate system as a starting point and a coordinate of the target position in the target coordinate system as an end point;
and calculating an included angle between the unit vector of the target vector and the unit vector of the reference direction of the target coordinate system, thereby obtaining a rotation included angle.
Optionally, calculating an angle between a unit vector of the target vector and a unit vector of a reference direction of the target coordinate system includes:
calculating a product of a unit vector of the target vector and a unit vector of a reference direction of the target coordinate system;
and solving the product to obtain an inverse cosine or an inverse tangent to obtain an included angle between the target vector and the unit vector of the reference direction of the target coordinate system.
In addition, according to another aspect of the embodiments of the present invention, there is provided an apparatus for indicating a position of a three-dimensional model, including:
the conversion module is used for judging whether the three-dimensional model is rendered in the screen or not; if not, converting the target position of the three-dimensional model under a coordinate conversion target coordinate system of a world space coordinate system, thereby obtaining the coordinate of the target position under the target coordinate system;
the calculation module is used for calculating a rotation included angle according to the coordinate of the target position under the target coordinate system;
and the indicating module is used for rotating the arrow indicator based on the rotating included angle so as to indicate the position of the three-dimensional model.
Optionally, the conversion module is further configured to:
converting the coordinates of the target position of the three-dimensional model under a world space coordinate system into a screen coordinate system;
and converting the coordinates of the target position under the screen coordinate system into the coordinates of the target position under the target coordinate system, thereby obtaining the coordinates of the target position under the target coordinate system.
Optionally, the screen coordinate system is a two-dimensional space coordinate system with the upper left corner of the screen as an origin, the horizontal right direction of the screen as the positive direction of the X axis, and the vertical downward direction of the screen as the positive direction of the Y axis;
the target coordinate system is a two-dimensional space coordinate system which takes the center of the screen as an original point, takes the horizontal right direction of the screen as the positive direction of a Y axis and takes the vertical downward direction of the screen as the positive direction of an X axis.
Optionally, the target position of the three-dimensional model comprises a center position of the three-dimensional model.
Optionally, the conversion module is further configured to:
converting the coordinates of the target position of the three-dimensional model under a model space coordinate system into a world space coordinate system;
converting the coordinates of the target position of the three-dimensional model under the world space coordinate system into an observation space coordinate system;
converting the coordinates of the target position of the three-dimensional model under the observation space coordinate system into a cutting space coordinate system;
and converting the coordinates of the target position of the three-dimensional model under the cutting space coordinate system into a screen coordinate system.
Optionally, the computing module is further configured to:
calculating a target vector taking an origin of the target coordinate system as a starting point and a coordinate of the target position in the target coordinate system as an end point;
and calculating an included angle between the unit vector of the target vector and the unit vector of the reference direction of the target coordinate system, thereby obtaining a rotation included angle.
Optionally, the computing module is further configured to:
calculating a product of a unit vector of the target vector and a unit vector of a reference direction of the target coordinate system;
and solving the product to obtain an inverse cosine or an inverse tangent to obtain an included angle between the target vector and the unit vector of the reference direction of the target coordinate system.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any of the embodiments described above.
According to another aspect of the embodiments of the present invention, there is also provided a computer readable medium, on which a computer program is stored, which when executed by a processor implements the method of any of the above embodiments.
One embodiment of the above invention has the following advantages or benefits: because the technical means that if the three-dimensional model is not rendered in the screen, the coordinates of the target position of the three-dimensional model in the world space coordinate system are converted into the coordinates in the target coordinate system, the rotation included angle is calculated, and the arrow indicator is rotated is adopted, the technical problem that the direction of the model cannot be determined in the prior art is solved. The embodiment of the invention can indicate and track the position of the three-dimensional model in the world space on the two-dimensional screen in real time, and a user can know the position of the model even if the three-dimensional model is not rendered on the screen, thereby obviously improving the user experience. Therefore, the embodiment of the invention can indicate the position of the three-dimensional model in the screen in real time in an AR/VR scene.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of a method of indicating an orientation of a three-dimensional model according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a world space coordinate system according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a screen coordinate system according to an embodiment of the invention;
FIG. 4 is a flow diagram of a spatial transformation according to an embodiment of the invention;
FIG. 5 is a schematic diagram indicating the orientation of a three-dimensional model according to an embodiment of the invention;
FIG. 6 is a schematic view of a main flow of a method of indicating the orientation of a three-dimensional model according to one referential embodiment of the present invention;
FIG. 7 is a schematic diagram of the main blocks of an apparatus for indicating the orientation of a three-dimensional model according to an embodiment of the present invention;
FIG. 8 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 9 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a method of indicating an orientation of a three-dimensional model according to an embodiment of the present invention. As an embodiment of the present invention, as shown in fig. 1, the method for indicating the orientation of the three-dimensional model may include:
step 101, judging whether a three-dimensional model is rendered in a screen; if not, converting the coordinates of the target position of the three-dimensional model under a world space coordinate system into the coordinates under a target coordinate system, thereby obtaining the coordinates of the target position under the target coordinate system.
Firstly, judging whether the three-dimensional model is rendered in a screen, and if so, ending. If not, converting the coordinates of the target position of the three-dimensional model under a world space coordinate system into the coordinates under a target coordinate system, thereby obtaining the coordinates of the target position under the target coordinate system. To facilitate calculation of the orientation of the three-dimensional model, the target position of the three-dimensional model comprises a center position of the three-dimensional model.
In order to indicate the orientation of the three-dimensional model in the screen, it is therefore necessary to first convert the coordinates of the target position of the three-dimensional model in the world space coordinate system to the target coordinate system, so as to obtain the coordinates of the target position in the target coordinate system. As shown in fig. 2, the world space coordinate system is a three-dimensional space coordinate system in which the center of the screen is the origin, the horizontal right direction of the screen is the positive X-axis direction, the vertical upward direction of the screen is the positive Y-axis direction, and the horizontal inward direction (the direction toward the user) is the positive Z-axis direction. It should be noted that the target coordinate system is a two-dimensional spatial coordinate system, and a matching target coordinate system is usually constructed according to the actual conditions of subsequent exhibition and other functions, so that subsequent calculation and processing steps can be reduced.
Optionally, converting coordinates of the target position of the three-dimensional model in a world space coordinate system into coordinates in a target coordinate system, so as to obtain coordinates of the target position in the target coordinate system, including: converting the coordinates of the target position of the three-dimensional model under a world space coordinate system into a screen coordinate system; and converting the coordinates of the target position under the screen coordinate system into the coordinates of the target position under the target coordinate system, thereby obtaining the coordinates of the target position under the target coordinate system. In the embodiment of the present invention, firstly, the coordinates of the target position of the three-dimensional model in the world space coordinate system are converted into the screen coordinate system, as shown in fig. 3, the screen coordinate system is a two-dimensional space coordinate system with the upper left corner of the screen as the origin, the horizontal right direction of the screen as the positive direction of the X axis, and the vertical downward direction of the screen as the positive direction of the Y axis. And then converting the coordinates of the target position in the screen coordinate system into the coordinates of the target position in the target coordinate system, thereby obtaining the coordinates of the target position in the target coordinate system. Optionally, the target coordinate system is a two-dimensional space coordinate system with the screen center as an origin, the screen horizontal right direction as a positive Y-axis direction, and the screen vertical downward direction as a positive X-axis direction.
Taking the center position of the three-dimensional model as an example, in order to calculate the rotation angle in step 102, it is necessary to know the coordinate (x) of the center position M of the three-dimensional model in the three-dimensional world space coordinate systemmM, M) and then performing spatial transformation according to the three-dimensional coordinates of the model, thereby obtaining the coordinates B (x) of the center position M of the three-dimensional model in the screen coordinate systema,ya)。
Next, coordinates of the center position M of the three-dimensional model in the screen coordinate system are set:
B(xband b) converting the coordinate system to the target coordinate system. After the conversion, the coordinate A (x) of the central position M of the three-dimensional model in the target coordinate system is obtaineda,ya). Assuming that the width of the screen is w and the height is h, the coordinate O (x) of the center point of the target coordinate system in the screen coordinate systemo,yo) (w/2, h/2. The coordinate point B under the target coordinate system can be obtainedCoordinate point A (x)a,a)=(yb-yo,xb-xo)。
Optionally, as shown in fig. 4, converting coordinates of the target position of the three-dimensional model in a world space coordinate system to a screen coordinate system includes: converting the coordinates of the target position of the three-dimensional model under a model space coordinate system into a world space coordinate system; converting the coordinates of the target position of the three-dimensional model under the world space coordinate system into an observation space coordinate system; converting the coordinates of the target position of the three-dimensional model under the observation space coordinate system into a cutting space coordinate system; and converting the coordinates of the target position of the three-dimensional model under the cutting space coordinate system into a screen coordinate system. The spatial transformation is also commonly referred to as vertex transformation, which is basically supported by the 3D rendering engine. In general, the model-to-screen transformation is accomplished by first using the model-observation projection matrix to transform the vertex coordinates from model space to clipping space, and then performing normalization (homogeneous division) and screen mapping.
And 102, calculating a rotation included angle according to the coordinates of the target position in the target coordinate system.
And calculating a rotation angle relative to a reference direction according to the coordinates of the target position of the three-dimensional model calculated in the step 101 in the target coordinate system. Optionally, step 102 may comprise: calculating a target vector taking an origin of the target coordinate system as a starting point and a coordinate of the target position in the target coordinate system as an end point; and calculating an included angle between the unit vector of the target vector and the unit vector of the reference direction of the target coordinate system, thereby obtaining a rotation included angle. After the coordinates of the target position of the three-dimensional model under the target coordinate system are obtained, the target vector under the target coordinate system can be obtained, and then the included angle between the target vector and the reference direction is calculated, so that the rotation included angle can be calculated.
Optionally, calculating an angle between a unit vector of the target vector and a unit vector of a reference direction of the target coordinate system includes: calculating a product of a unit vector of the target vector and a unit vector of a reference direction of the target coordinate system; and solving the product to obtain an inverse cosine or an inverse tangent to obtain an included angle between the target vector and the unit vector of the reference direction of the target coordinate system.
Coordinate point A (x) of the central position M of the three-dimensional model in the target coordinate systema,a)=(yb-yo,xb-xo) For example, a target vector with the center point coordinate O as a starting point and the coordinate point a as an end point in the target coordinate system may be obtained
Figure BDA0002519236340000081
Then, a vector can be obtained
Figure BDA0002519236340000082
Unit vector of
Figure BDA0002519236340000083
The unit vector (where a is any non-zero vector) can be calculated with reference to the following formula:
Figure BDA0002519236340000084
assuming that the positive X-axis direction of the target coordinate system is taken as the reference direction, the unit vector of the direction is
Figure BDA0002519236340000085
For unit vector
Figure BDA0002519236340000086
And unit vector
Figure BDA0002519236340000087
Find the dot product to obtain
Figure BDA0002519236340000088
Then, the following formula is used to obtain
Figure BDA0002519236340000091
And
Figure BDA0002519236340000092
angle of the two vectors:
1) can solve the cosine of V, namely obtaining
Figure BDA0002519236340000093
And
Figure BDA0002519236340000094
the angle theta.
Figure BDA0002519236340000095
2) Can also be obtained by solving the inverse tangent of V
Figure BDA0002519236340000096
And
Figure BDA0002519236340000097
the angle theta.
Figure BDA0002519236340000098
And 103, rotating the arrow indicator based on the rotation included angle to indicate the position of the three-dimensional model.
As shown in fig. 5, the arrow indicator starts to rotate from the reference direction (horizontal to right direction), the rotation angle of the arrow indicator is the rotation included angle θ, and the rotated arrow indicator is used for indicating the orientation of the three-dimensional model.
Because the orientation of the three-dimensional model needs to be indicated in real time, the embodiment of the invention needs to process in each frame of screen refreshing of a mobile phone or other device with a screen.
It is noted that if the user drags the model on the screen so that the model gradually comes into the screen, the arrow indicator may disappear at this time.
According to the various embodiments described above, it can be seen that the technical means of the embodiment of the present invention, if the three-dimensional model is not rendered in the screen, converting the coordinates of the target position of the three-dimensional model in the world space coordinate system into the coordinates in the target coordinate system, and calculating the rotation angle, thereby rotating the arrow indicator, solves the technical problem in the prior art that the orientation of the model cannot be determined. The embodiment of the invention can indicate and track the position of the three-dimensional model in the world space on the two-dimensional screen in real time, and a user can know the position of the model even if the three-dimensional model is not rendered on the screen, thereby obviously improving the user experience. Therefore, the embodiment of the invention can indicate the position of the three-dimensional model in the screen in real time in an AR/VR scene.
Fig. 6 is a schematic diagram of a main flow of a method of indicating the orientation of a three-dimensional model according to one referential embodiment of the present invention. As still another embodiment of the present invention, as shown in fig. 6, the method of indicating the orientation of the three-dimensional model may include:
601, judging whether the three-dimensional model is rendered in a screen; if yes, go to step 602; if not, the process is ended.
Step 602, converting the coordinates of the central position of the three-dimensional model in a world space coordinate system into a screen coordinate system.
Firstly, judging whether the three-dimensional model is rendered in a screen, and if so, ending. If not, converting the coordinates of the central position of the three-dimensional model under a world space coordinate system into a screen coordinate system.
Step 603, converting the coordinates of the center position of the three-dimensional model in the screen coordinate system to a target coordinate system, thereby obtaining the coordinates of the center position in the target coordinate system.
In this embodiment, the screen coordinate system is a two-dimensional space coordinate system with the upper left corner of the screen as an origin, the horizontal right direction of the screen as the positive X-axis direction, and the vertical downward direction of the screen as the positive Y-axis direction; the target coordinate system is a two-dimensional space coordinate system which takes the center of the screen as an original point, takes the horizontal right direction of the screen as the positive direction of a Y axis and takes the vertical downward direction of the screen as the positive direction of an X axis.
Step 604, calculating a target vector with the origin of the target coordinate system as a starting point and the coordinates of the central position in the target coordinate system as an end point
Figure BDA0002519236340000101
Step 605, calculating the product of the unit vector of the target vector and the unit vector of the reference direction of the target coordinate system
Figure BDA0002519236340000102
Step 606, solving the product for an inverse cosine or an inverse tangent to obtain an included angle θ between the target vector and the unit vector of the reference direction of the target coordinate system, which is a rotation included angle.
Figure BDA0002519236340000103
Or
Figure BDA0002519236340000104
Step 607, rotating the arrow indicator based on the rotation angle to indicate the orientation of the three-dimensional model.
The arrow indicator starts to rotate from a reference direction (horizontal direction to the right), the rotation angle of the arrow indicator is the rotation included angle theta, and the rotated arrow indicator is used for indicating the orientation of the three-dimensional model.
In addition, in a reference embodiment of the present invention, the detailed implementation of the method for indicating the orientation of the three-dimensional model is described in detail in the above method for indicating the orientation of the three-dimensional model, and therefore, the repeated description is not repeated here.
FIG. 7 is a schematic diagram of the main modules of an apparatus for indicating the orientation of a three-dimensional model according to an embodiment of the present invention, as shown in FIG. 7, the apparatus 700 for indicating the orientation of a three-dimensional model includes a conversion module 701, a calculation module 702, and an indication module 703; the conversion module 701 is used for judging whether the three-dimensional model is rendered in a screen; if not, converting the target position of the three-dimensional model under a coordinate conversion target coordinate system of a world space coordinate system, thereby obtaining the coordinate of the target position under the target coordinate system; the calculation module 702 is configured to calculate a rotation included angle according to the coordinate of the target position in the target coordinate system; the indicating module 703 is configured to rotate an arrow indicator based on the rotation angle to indicate the orientation of the three-dimensional model.
Optionally, the conversion module 701 is further configured to:
converting the coordinates of the target position of the three-dimensional model under a world space coordinate system into a screen coordinate system;
and converting the coordinates of the target position under the screen coordinate system into the coordinates of the target position under the target coordinate system, thereby obtaining the coordinates of the target position under the target coordinate system.
Optionally, the screen coordinate system is a two-dimensional space coordinate system with the upper left corner of the screen as an origin, the horizontal right direction of the screen as the positive direction of the X axis, and the vertical downward direction of the screen as the positive direction of the Y axis;
the target coordinate system is a two-dimensional space coordinate system which takes the center of the screen as an original point, takes the horizontal right direction of the screen as the positive direction of a Y axis and takes the vertical downward direction of the screen as the positive direction of an X axis.
Optionally, the target position of the three-dimensional model comprises a center position of the three-dimensional model.
Optionally, the conversion module 701 is further configured to:
converting the coordinates of the target position of the three-dimensional model under a model space coordinate system into a world space coordinate system;
converting the coordinates of the target position of the three-dimensional model under the world space coordinate system into an observation space coordinate system;
converting the coordinates of the target position of the three-dimensional model under the observation space coordinate system into a cutting space coordinate system;
and converting the coordinates of the target position of the three-dimensional model under the cutting space coordinate system into a screen coordinate system.
Optionally, the calculating module 702 is further configured to:
calculating a target vector taking an origin of the target coordinate system as a starting point and a coordinate of the target position in the target coordinate system as an end point;
and calculating an included angle between the unit vector of the target vector and the unit vector of the reference direction of the target coordinate system, thereby obtaining a rotation included angle.
Optionally, the calculating module 702 is further configured to:
calculating a product of a unit vector of the target vector and a unit vector of a reference direction of the target coordinate system;
and solving the product to obtain an inverse cosine or an inverse tangent to obtain an included angle between the target vector and the unit vector of the reference direction of the target coordinate system.
According to the various embodiments described above, it can be seen that the technical means of the embodiment of the present invention, if the three-dimensional model is not rendered in the screen, converting the coordinates of the target position of the three-dimensional model in the world space coordinate system into the coordinates in the target coordinate system, and calculating the rotation angle, thereby rotating the arrow indicator, solves the technical problem in the prior art that the orientation of the model cannot be determined. The embodiment of the invention can indicate and track the position of the three-dimensional model in the world space on the two-dimensional screen in real time, and a user can know the position of the model even if the three-dimensional model is not rendered on the screen, thereby obviously improving the user experience. Therefore, the embodiment of the invention can indicate the position of the three-dimensional model in the screen in real time in an AR/VR scene.
It should be noted that, in the implementation of the apparatus for indicating the orientation of a three-dimensional model according to the present invention, the method for indicating the orientation of a three-dimensional model described above has been described in detail, and therefore, the repeated description is omitted here.
Fig. 8 illustrates an exemplary system architecture 800 of a method of indicating a three-dimensional model orientation or an apparatus for indicating a three-dimensional model orientation to which embodiments of the invention may be applied.
As shown in fig. 8, the system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. The network 804 serves to provide a medium for communication links between the terminal devices 801, 802, 803 and the server 805. Network 804 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 801, 802, 803 to interact with a server 805 over a network 804 to receive or send messages or the like. The terminal devices 801, 802, 803 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 801, 802, 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 805 may be a server that provides various services, such as a back-office management server (for example only) that supports shopping-like websites browsed by users using the terminal devices 801, 802, 803. The background management server may analyze and otherwise process the received data such as the item information query request, and feed back a processing result (for example, target push information, item information — just an example) to the terminal device.
It should be noted that the method for indicating the orientation of the three-dimensional model provided by the embodiment of the present invention is generally executed by the terminal devices 801, 802, 803, and accordingly, the apparatus for indicating the orientation of the three-dimensional model is disposed in the terminal devices 801, 802, 803.
It should be understood that the number of terminal devices, networks, and servers in fig. 8 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 9, shown is a block diagram of a computer system 900 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU)901 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM903, various programs and data necessary for the operation of the system 900 are also stored. The CPU 901, ROM 902, and RAM903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The above-described functions defined in the system of the present invention are executed when the computer program is executed by a Central Processing Unit (CPU) 901.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer programs according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a conversion module, a calculation module, and an indication module, where the names of the modules do not in some cases constitute a limitation on the modules themselves.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, implement the method of: judging whether the three-dimensional model is rendered in a screen or not; if not, converting the coordinates of the target position of the three-dimensional model under a world space coordinate system into the coordinates under a target coordinate system, so as to obtain the coordinates of the target position under the target coordinate system; calculating a rotation included angle according to the coordinates of the target position under the target coordinate system; and rotating an arrow indicator based on the rotation included angle to indicate the position of the three-dimensional model.
According to the technical scheme of the embodiment of the invention, the technical means that if the three-dimensional model is not rendered in the screen, the coordinates of the target position of the three-dimensional model in the world space coordinate system are converted into the coordinates in the target coordinate system, and the rotation included angle is calculated, so that the arrow indicator is rotated is adopted, and the technical problem that the direction of the model cannot be determined in the prior art is solved. The embodiment of the invention can indicate and track the position of the three-dimensional model in the world space on the two-dimensional screen in real time, and a user can know the position of the model even if the three-dimensional model is not rendered on the screen, thereby obviously improving the user experience. Therefore, the embodiment of the invention can indicate the position of the three-dimensional model in the screen in real time in an AR/VR scene.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of indicating the orientation of a three-dimensional model, comprising:
judging whether the three-dimensional model is rendered in a screen or not; if not, converting the coordinates of the target position of the three-dimensional model under a world space coordinate system into the coordinates under a target coordinate system, so as to obtain the coordinates of the target position under the target coordinate system;
calculating a rotation included angle according to the coordinates of the target position under the target coordinate system;
and rotating an arrow indicator based on the rotation included angle to indicate the position of the three-dimensional model.
2. The method of claim 1, wherein transforming coordinates of the target location of the three-dimensional model in a world space coordinate system to a target coordinate system to obtain coordinates of the target location in the target coordinate system comprises:
converting the coordinates of the target position of the three-dimensional model under a world space coordinate system into a screen coordinate system;
and converting the coordinates of the target position under the screen coordinate system into the coordinates of the target position under the target coordinate system, thereby obtaining the coordinates of the target position under the target coordinate system.
3. The method according to claim 2, wherein the screen coordinate system is a two-dimensional space coordinate system with the upper left corner of the screen as an origin, the horizontal right direction of the screen as a positive X-axis direction, and the vertical downward direction of the screen as a positive Y-axis direction;
the target coordinate system is a two-dimensional space coordinate system which takes the center of the screen as an original point, takes the horizontal right direction of the screen as the positive direction of a Y axis and takes the vertical downward direction of the screen as the positive direction of an X axis.
4. The method of claim 2, wherein the target location of the three-dimensional model comprises a center location of the three-dimensional model.
5. The method of claim 2, wherein transforming the coordinates of the target location of the three-dimensional model under a world space coordinate system to under a screen coordinate system comprises:
converting the coordinates of the target position of the three-dimensional model under a model space coordinate system into a world space coordinate system;
converting the coordinates of the target position of the three-dimensional model under the world space coordinate system into an observation space coordinate system;
converting the coordinates of the target position of the three-dimensional model under the observation space coordinate system into a cutting space coordinate system;
and converting the coordinates of the target position of the three-dimensional model under the cutting space coordinate system into a screen coordinate system.
6. The method of claim 1, wherein calculating the included rotation angle from the coordinates of the target position in the target coordinate system comprises:
calculating a target vector taking an origin of the target coordinate system as a starting point and a coordinate of the target position in the target coordinate system as an end point;
and calculating an included angle between the unit vector of the target vector and the unit vector of the reference direction of the target coordinate system, thereby obtaining a rotation included angle.
7. The method of claim 6, wherein calculating an angle between a unit vector of the target vector and a unit vector of a reference direction of the target coordinate system comprises:
calculating a product of a unit vector of the target vector and a unit vector of a reference direction of the target coordinate system;
and solving the product to obtain an inverse cosine or an inverse tangent to obtain an included angle between the target vector and the unit vector of the reference direction of the target coordinate system.
8. An apparatus for indicating the orientation of a three-dimensional model, comprising:
the conversion module is used for judging whether the three-dimensional model is rendered in the screen or not; if not, converting the target position of the three-dimensional model under a coordinate conversion target coordinate system of a world space coordinate system, thereby obtaining the coordinate of the target position under the target coordinate system;
the calculation module is used for calculating a rotation included angle according to the coordinate of the target position under the target coordinate system;
and the indicating module is used for rotating the arrow indicator based on the rotating included angle so as to indicate the position of the three-dimensional model.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
the one or more programs, when executed by the one or more processors, implement the method of any of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202010485954.1A 2020-06-01 2020-06-01 Method and device for indicating three-dimensional model orientation Pending CN113763520A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010485954.1A CN113763520A (en) 2020-06-01 2020-06-01 Method and device for indicating three-dimensional model orientation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010485954.1A CN113763520A (en) 2020-06-01 2020-06-01 Method and device for indicating three-dimensional model orientation

Publications (1)

Publication Number Publication Date
CN113763520A true CN113763520A (en) 2021-12-07

Family

ID=78782593

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010485954.1A Pending CN113763520A (en) 2020-06-01 2020-06-01 Method and device for indicating three-dimensional model orientation

Country Status (1)

Country Link
CN (1) CN113763520A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120017783A (en) * 2010-08-20 2012-02-29 한국과학기술원 Method and apparatus for presenting location information on augmented reality
WO2016157802A1 (en) * 2015-03-27 2016-10-06 日本電気株式会社 Information processing apparatus, information processing system, information processing method, and storage medium
CN107705361A (en) * 2017-09-27 2018-02-16 中国舰船研究设计中心 A kind of naval vessel three-dimensional situation figure methods of exhibiting based on data-driven
US20180276897A1 (en) * 2015-09-30 2018-09-27 Shenzhen Dlodlo Technologies Co., Ltd. Method and Device for Adjusting Virtual Reality Image
CN108830894A (en) * 2018-06-19 2018-11-16 亮风台(上海)信息科技有限公司 Remote guide method, apparatus, terminal and storage medium based on augmented reality

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120017783A (en) * 2010-08-20 2012-02-29 한국과학기술원 Method and apparatus for presenting location information on augmented reality
WO2016157802A1 (en) * 2015-03-27 2016-10-06 日本電気株式会社 Information processing apparatus, information processing system, information processing method, and storage medium
US20180276897A1 (en) * 2015-09-30 2018-09-27 Shenzhen Dlodlo Technologies Co., Ltd. Method and Device for Adjusting Virtual Reality Image
CN107705361A (en) * 2017-09-27 2018-02-16 中国舰船研究设计中心 A kind of naval vessel three-dimensional situation figure methods of exhibiting based on data-driven
CN108830894A (en) * 2018-06-19 2018-11-16 亮风台(上海)信息科技有限公司 Remote guide method, apparatus, terminal and storage medium based on augmented reality

Similar Documents

Publication Publication Date Title
CN106846497B (en) Method and device for presenting three-dimensional map applied to terminal
CN108629823B (en) Method and device for generating multi-view image
CN110517214B (en) Method and apparatus for generating image
US10614621B2 (en) Method and apparatus for presenting information
CN109920056B (en) Building rendering method, device, equipment and medium
CN115147265B (en) Avatar generation method, apparatus, electronic device, and storage medium
US20230206578A1 (en) Method for generating virtual character, electronic device and storage medium
CN110213614A (en) The method and apparatus of key frame are extracted from video file
CN114399588B (en) Three-dimensional lane line generation method and device, electronic device and computer readable medium
CN113077548A (en) Collision detection method, device, equipment and storage medium for object
CN111815738A (en) Map construction method and device
CN112258619A (en) Image processing method and device
CN115546331A (en) Data rendering method and device, electronic equipment and computer readable medium
CN114792355A (en) Virtual image generation method and device, electronic equipment and storage medium
CN115908679A (en) Texture mapping method, device, equipment and storage medium
CN110288523B (en) Image generation method and device
CN109493423B (en) Method and device for calculating midpoint positions of two points on surface of three-dimensional earth model
WO2023231926A1 (en) Image processing method and apparatus, device, and storage medium
CN113763520A (en) Method and device for indicating three-dimensional model orientation
CN115761086A (en) Asset model three-dimensional display method and device, storage medium and intelligent terminal
CN112348939A (en) Texture optimization method and device for three-dimensional reconstruction
CN113761090A (en) Positioning method and device based on point cloud map
CN114820908B (en) Virtual image generation method and device, electronic equipment and storage medium
CN112925593A (en) Method and device for scaling and rotating target layer
CN116363331B (en) Image generation method, device, equipment and storage medium

Legal Events

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