Make the method and apparatus of three-dimensional plot image source by changing the viewpoint angle
Technical field
The present invention relates to a kind of method for making and device of three-dimensional plot image source, particularly a kind of by changing the method and apparatus that the making of viewpoint angle is used for the three-dimensional plot image source of 3 D stereo demonstration.
Background technology
The world that most people are seen all is three-dimensional, and the nearly all medium that is touched, no matter be printing, photo or image, all be two-dimentional.Nowadays, along with people's strong day by day to 3-dimensional image interest, up-to-date stereo display technique can satisfy the demand that people deeply observe image and complex data.The things that the progress of science and technology just progressively makes image that we watch on display and us directly see with eyes is consistent, and this is owing to there being a variety of reasons to impel people interested in the 3-D display.Many professional application need have relief vision, also have some occasions to adopt 3-D view accurately to extract information fast and more from the virtual data of complexity, and have the advantage of improving interactive efficiency and reducing signal noise ratio (snr) of image.
In computing machine, show the 3d figure, in two dimensional surface, show three-dimensional picture in other words.Unlike real three dimensions in the real world, real metric space is arranged.Just look the same in computing machine real world, therefore the 3d figure that shows at computing machine allows human eye take a fancy to just as genuine exactly.It is exactly near big and far smaller that human eye has a characteristic, will form stereoscopic sensation.Computer screen is a planar, why we can enjoy just like the 3-D view as the material object, be because the difference of color gray scale and make human eye produce visual illusion when being presented on the computer screen, and the computer screen of two dimension is perceived as 3-D view.Based on the relevant knowledge of color science, the projection at three-dimensional body edge generally shows high luminance color, and sunk part is owing to being subjected to blocking of light to show dark-coloured.This understanding be widely used in webpage or other use in to the drafting of button, 3d lines.
The eighties in 20th century, adopted the right and left eyes image as the continuous technique for displaying of independent frame based on the three-dimensional display of CRT (Cathode Ray Tube, cathode-ray tube (CRT)).When watching, image carries out one of in two ways synchronously, and a kind of method is to wear to adopt the glasses that switch the LCD shutter fast, comes to block continuously left eye and eye image in good time.Another kind method is to adopt CRT generation circular polarization image in the opposite direction, and this image is to produce by very fast liquid crystal board of a response time that is placed on the display front, and watches by low weight circular polarization glasses.In these two kinds of methods, for fear of flicker, the refreshing frequency of CRT is the twice of normal frame speed, approximately is 100Hz.But this stereo display needs a large amount of films that pass through complicated 3-D technology shooting, and when not having these special shooting film sources, the user can't enjoy three-dimensional stereo effect on stereoscopic display device.
Some people thinks, perfectly dimension display technologies does not need that the beholder is before eyes to wear any stereos copic viewing instrument, and the stereo display product that a lot of companies have developed does not need glasses is arranged, or is called auto-stereoscopic display device.Generally by sending the odd field image to eyes, the mode that sends the even field image to the another eyes resolves into two parts with display resolution to these products, but this also requires the beholder to make their head remain on the position of optimal viewing point.In addition, the method for realization three-dimensional stereoscopic visual also comprises by two head mounted displays isolates the image of each eye, and needs the user that head is kept a kind of method that can isolate the binocular images posture.A kind of theater formula stereo-picture generation technique for mass viewer audiences is also arranged in addition, and it can throw ring curtain image to real three dimensions by the front and back projection system, and left and right sides image is distinguished by frame sequence or frame polarization polarity.
In any case but at first, the stereo display scheme must have good image source, because people have been accustomed to watching qualitative picture on the tabletop display of routine, expects that also stereo-picture has same image quality.In addition, the right and left eyes image must separate under the prerequisite of not sacrificing image quality as much as possible.Secondly, display system also must be made us watching comfortable.When people watched stereoscopic three-dimensional image, hope can not change their the common custom of watching, and for example, does not wish to wear heavy glasses etc.The 3rd, outstanding stereoscopic display device must be to install easily and use, and simple with the interface of computing machine, image card and software etc.Use dimension display technologies to watch the user of complex data and image, their notice should be concentrated on content of being watched rather than the means of watching.But there is not relevant technology open at present.
Summary of the invention
The technical problem to be solved in the present invention, be to provide a kind of method for making and device of three-dimensional plot image source, it is to come the anthropomorphic dummy to observe to see angle to draw two picture makings respectively and be used for the three-dimensional plot image source that 3 D stereo shows by changing the viewpoint angle, be shown as three-dimensional stereo effect for stereoscopic display device, make the user enjoy the stereo display effect when using user interface or when carrying out 3d gaming under the condition of special glasses not needing to wear, significantly improve user experience.
The present invention is achieved in that
Provide a kind of and make the method for three-dimensional plot image source, comprise the steps: by changing the viewpoint angle
Step 10, is at first drawn good three-dimensional interface figure earlier in X, Y, Z three-dimensional drawing space, and the position of a perspective eye is set;
Step 20,30 and 40 the viewpoint of left-eye view and the viewpoint of right-eye view are set set by step then, and obtain the corresponding view image;
The position of the viewpoint of step 30, left-eye view is from perspective eye, central point with described three-dimensional interface figure is the center of circle, is radius with perspective eye to the distance of the central point of three-dimensional interface figure, overlooks on the XZ plane, dextrorotation gyration a, resultant left eye viewpoint position; Afterwards, three-dimensional interface figure is projected on the pairing screen of left eye viewpoint position, obtain the left-eye view image, then the left-eye view image is write in the storer;
The position of the viewpoint of step 40, right-eye view is from perspective eye, central point with described three-dimensional interface figure is the center of circle, is radius with perspective eye to the distance of the central point of three-dimensional interface figure, overlooks on the XZ plane, be rotated counterclockwise angle a, resultant right eye viewpoint position; Afterwards, three-dimensional interface figure is projected on the pairing screen of right eye viewpoint position, obtain the right-eye view image, then the right-eye view image is write in the storer;
Step 50, finished the required right and left eyes view image of a frame stereo display, repeating step 20~40 until finishing the required right and left eyes view image of each required frame stereo display, uses for the 3 D stereo display device at this point;
Wherein, step 30 and 40 order are not limit successively; The position that sight line converged when described perspective eye was the picture skeleton view; The computing formula of described anglec of rotation a is:
Tan (a)=(D_eye/2)/(L_panel+L_graphic), in the formula:
D_eye represents the interpupillary distance of normal person's eyes;
L_panel represents the distance of people's face to screen;
L_graphic represents the distance of the central point of three-dimensional interface figure to screen.
The present invention also provides a kind of 3-D view implement device, comprising:
The basic setup unit is used for drawing good three-dimensional interface figure based on X, Y, the Z three-dimensional drawing space of XYZ coordinate system, and the position of a perspective eye is set;
Left-eye view visual point image generation unit, be used for position with the viewpoint of left-eye view from perspective eye, central point with described three-dimensional interface figure is the center of circle, is radius with perspective eye to the distance of the central point of three-dimensional interface figure, overlook on the XZ plane, dextrorotation gyration a, resultant left eye viewpoint position; Afterwards, three-dimensional interface figure is projected on the pairing screen of left eye viewpoint position, obtain the left-eye view image, then the left-eye view image is write in the storer;
Right-eye view visual point image generation unit, the position that is used for the viewpoint of right-eye view is from perspective eye, central point with described three-dimensional interface figure is the center of circle, is radius with perspective eye to the distance of the central point of three-dimensional interface figure, overlook on the XZ plane, be rotated counterclockwise angle a, resultant right eye viewpoint position; Afterwards, three-dimensional interface figure is projected on the pairing screen of right eye viewpoint position, obtain the right-eye view image, then the right-eye view image is write in the storer;
Repeat drawing unit, be used to collect the image that described left-eye view visual point image generation unit and right-eye view visual point image generation unit obtain respectively, finish the required right and left eyes view image of a frame stereo display, and continue to collect, until finishing the required right and left eyes view image of each required frame stereo display, use for the 3 D stereo display device;
The position that sight line converged when wherein, described perspective eye was the picture skeleton view; The computing formula of described anglec of rotation a is:
Tan (a)=(D_eye/2)/(L_panel+L_graphic), in the formula:
D_eye represents the interpupillary distance of normal person's eyes;
L_panel represents the distance of people's face to screen;
L_graphic represents the distance of the central point of three-dimensional interface figure to screen.
The present invention has following advantage: on the basis of three-dimensional interface figure, obtain the needed three-dimensional plot image source of stereoscopic display device by drawing the right and left eyes view image respectively, for follow-up stereo display provides the basis, the shock that allows the user obtain stereo display and 3 D graphical interface is simultaneously enjoyed; Can be widely used in fields such as the user interface of various 3d gaming pictures, handheld device and three-dimensional film.
Description of drawings
The present invention is further illustrated in conjunction with the embodiments with reference to the accompanying drawings.
Fig. 1 is conventional 3-D view perspective principle schematic.
Fig. 2 is the XZ face perspective view of Fig. 1.
Fig. 3 is the effect synoptic diagram that the anthropomorphic dummy of Fig. 1 arrives soon.
Fig. 4 is the principle schematic of left-eye view image in the inventive method.
Fig. 5 is the principle schematic of right-eye view image in the inventive method.
Fig. 6 is the inventive method schematic flow sheet.
Fig. 7 is the calculating derivation graph of the viewpoint anglec of rotation a of right and left eyes view in the inventive method.
Fig. 8 is the structured flowchart of a 3 d display device of demonstration the inventive method gained image source.
Embodiment
As depicted in figs. 1 and 2, with normal three-dimensional picture screen projection principle is example, at first be in the drawing space, to draw good three-dimensional interface figure 100, and viewpoint position is set, and then from viewpoint position, three-dimensional interface figure 100 is projected on the screen 200, thereby the image that obtains needing to show is an interface figure 300; This projective techniques is conventional 3-D view foreshortened figure, and viewpoint herein is described perspective eye.
Again as shown in Figure 3, if stereo display, the effect that then needs the anthropomorphic dummy to arrive soon, four folded in twos scopes of dotted line are the effect that images of left and right eyes is watched this interface figure 300 among the figure.Therefore to produce the required right and left eyes image of stereo display, can make the three-dimensional interface figure 100 of drafting motionless, in the angle of surface level (being the XY face) rotation viewpoint, (parallax is exactly to observe the direction differences that same target was produced from two points that certain distance is arranged with the parallax effect that realizes right and left eyes; See two angles between the point from target, be called the parallax of these two points).
Based on above-mentioned principle, the while, to Fig. 7, method of making the three-dimensional plot image source by change viewpoint angle of the present invention comprised the steps: with reference to figure 4
Step 10, is at first drawn good three-dimensional interface figure 100 earlier in X, Y, Z three-dimensional drawing space, and the position of a perspective eye is set;
Step 20,30 and 40 the viewpoint of left-eye view and the viewpoint of right-eye view are set set by step then, and obtain the corresponding view image;
The position of the viewpoint of step 30, left-eye view is from perspective eye, central point with described three-dimensional interface figure 100 is the center of circle, is radius with perspective eye to the distance of the central point of three-dimensional interface figure 100, overlook on the XZ plane, dextrorotation gyration a, resultant left eye viewpoint position; Afterwards, three-dimensional interface figure 100 is projected on the pairing screen of left eye viewpoint position, obtain the left-eye view image, then the left-eye view image is write in the storer;
The position of the viewpoint of step 40, right-eye view is from perspective eye, central point with described three-dimensional interface figure 100 is the center of circle, is radius with perspective eye to the distance of the central point of three-dimensional interface figure 100, overlook on the XZ plane, be rotated counterclockwise angle a, resultant right eye viewpoint position; Afterwards, three-dimensional interface figure 100 is projected on the pairing screen of right eye viewpoint position, obtain the right-eye view image, then the right-eye view image is write in the storer;
Step 50, finished the required right and left eyes view image of a frame stereo display, repeating step 20~40 until finishing the required right and left eyes view image of each required frame stereo display, uses for the 3 D stereo display device at this point;
Wherein, step 30 and 40 order are not limit successively; The position that sight line converged when described perspective eye was the picture skeleton view; Emphasis is with reference to shown in Figure 7, and the triangle tan of described anglec of rotation a is:
Tan (a)=(D_eye/2)/(L_panel+L_graphic), in the formula:
D_eye represents the interpupillary distance of normal person's eyes;
L_panel represents the distance of people's face to screen;
L_graphic represents the distance of the central point of three-dimensional interface figure to screen;
Can obtain the value of anglec of rotation a after the value by formula calculating tan (a) by lookup table mode.
At last as shown in Figure 8, for showing by the inventive method gained image source, can be provided with as next 3 d display device, this 3 d display device comprises a CPU, an external memory storage, a stereo display control module and a GPU who all is connected in bus, and comprises that one is connected in the stereoscopic display device of described stereo display control module.Wherein,
Described CPU: be responsible for touch screen controller and indicative control unit and GPU being controlled by bus;
Described GPU: be responsible for control, obtain required texture map picture from external memory storage, store external memory storage into after drawing out view data to be shown then by bus according to CPU;
Described external memory storage: be responsible for required whole materials of storage user interface and view data and handle back view data to be shown through GPU;
Described bus: be an interconnected unit, carry each unit on bus is linked together that the unit on any bus can be by bus access to carry other unit in bus;
Described stereo display control module: be responsible for reading right and left eyes image to be displayed data respectively from external memory storage, and the right and left eyes view data is flowed to the stereoscopic display device demonstration according to the needed form of stereoscopic device by bus;
Described stereoscopic display device: be responsible for the right and left eyes view data is shown, for the user provides the stereo display effect.
The operating process of the overall hardware of described 3 d display device:
1. after hardware began to work on power, CPU made each unit begin operate as normal each unit initialization;
2. after software systems started, CPU began to control GPU and draws the 3 D graphical interface that stereo display is used;
3. after GPU obtains the order of CPU, begin to read the required texture map picture of drafting from external memory storage, and then drawing three-dimensional interface figure;
4. after having drawn three-dimensional interface figure, when three-dimensional interface figure was projected two-dimensional screen, anthropomorphic dummy's right and left eyes used different angles to project the user interface that supplies left eye and right eye to watch, i.e. images of left and right eyes view image respectively;
5. store right and left eyes view image to be shown into external memory storage;
6.CPU begin to dispose the stereo display control module, order stereo display control module shows the image that GPU draws;
7. after the stereo display control module obtains cpu command, read right and left eyes view image to be shown from external memory storage, be treated to the required data layout of stereoscopic display device after, be sent to stereoscopic display device and show;
8. after the right and left eyes image rendering at a framed user interface finished, CPU can continue the required right and left eyes user interface image of GP configuring U drafting next frame user interface according to user's control or system's needs.
The present invention also provides a kind of 3-D view implement device, comprising:
The basic setup unit is used for drawing good three-dimensional interface figure based on X, Y, the Z three-dimensional drawing space of XYZ coordinate system, and the position of a perspective eye is set;
Left-eye view visual point image generation unit, be used for position with the viewpoint of left-eye view from perspective eye, central point with described three-dimensional interface figure is the center of circle, is radius with perspective eye to the distance of the central point of three-dimensional interface figure, overlook on the XZ plane, dextrorotation gyration a, resultant left eye viewpoint position; Afterwards, three-dimensional interface figure is projected on the pairing screen of left eye viewpoint position, obtain the left-eye view image, then the left-eye view image is write in the storer;
Right-eye view visual point image generation unit, the position that is used for the viewpoint of right-eye view is from perspective eye, central point with described three-dimensional interface figure is the center of circle, is radius with perspective eye to the distance of the central point of three-dimensional interface figure, overlook on the XZ plane, be rotated counterclockwise angle a, resultant right eye viewpoint position; Afterwards, three-dimensional interface figure is projected on the pairing screen of right eye viewpoint position, obtain the right-eye view image, then the right-eye view image is write in the storer;
Repeat drawing unit, be used to collect the image that described left-eye view visual point image generation unit and right-eye view visual point image generation unit obtain respectively, finish the required right and left eyes view image of a frame stereo display, and continue to collect, until finishing the required right and left eyes view image of each required frame stereo display, use for the 3 D stereo display device;
The position that sight line converged when wherein, described perspective eye was the picture skeleton view; The computing formula of described anglec of rotation a is:
Tan (a)=(D_eye/2)/(L_panel+L_graphic), in the formula:
D_eye represents the interpupillary distance of normal person's eyes;
L_panel represents the distance of people's face to screen;
L_graphic represents the distance of the central point of three-dimensional interface figure to screen.
In sum, the present invention is on the basis of three-dimensional interface figure, obtain the needed three-dimensional plot image source of stereoscopic display device by drawing the right and left eyes view image respectively, for follow-up stereo display provides the basis, the shock that allows the user obtain stereo display and 3 D graphical interface is simultaneously enjoyed; Can be widely used in fields such as the user interface of various 3d gaming pictures, handheld device and three-dimensional film.