Summary of the invention
The object of the present invention is to provide a kind of three-dimensional interface display apparatus, method and terminal, adopt the terminal of said three-dimensional interface display apparatus and method, when not having 3-D graphic hardware, can obtain real three-dimensional interface.
In order to reach the object of the invention, the present invention adopts following technical scheme:
A kind of three-dimensional interface display apparatus comprises three-dimensional interface view module, three D controllers, and 3 d rendering engine, wherein,
Three-dimensional interface view module is used to detect the user to the operation of 3-D graphic and send it to three D controllers;
Three D controllers are used for sending three-dimensional interface according to user's operation to the three-dimensional process engine and play up instruction;
3 d rendering engine is used for playing up instruction according to said three-dimensional interface processing is played up in operated 3-D graphic execution.
Preferably, said three-dimensional interface view module comprises that graphical user interface window data module, user import detection module, and the screen interactive module, wherein,
The graphical user interface window data module is used for the window information of encapsulation image user interface GUI;
The user imports detection module, is used to detect the user to the operation of 3-D graphic and send it to three D controllers;
The screen interactive module is used to show three-dimensional interface.
Preferably; Said 3 d rendering engine comprises that at least model coordinate transformation module, world coordinate transformation module, object reject module, insert and play up a kind of in list block, back side cancellation module, camera coordinates conversion module, optical staining module, three-dimensional body space cutting module, texture module, perspective transform module, image space cutting module and the rasterizer module; Wherein
The model coordinate transformation module is used for the model coordinate of 3-D graphic is carried out conversion;
The world coordinate transformation module, the position that is used for according to 3-D graphic is a world coordinates with the model coordinate transform;
Object rejecting module was used for before the execution world coordinates arrives the camera coordinates conversion, selected also to reject the relative sightless part of camera viewpoint in the 3-D graphic;
List block is played up in insertion, is used for each polygon facet with the visible part of 3-D graphic and is inserted into and plays up tabulation;
Back side cancellation module is used for eliminating the polygon facet of the 3-D graphic that is blocked;
The camera coordinates conversion module is used for according to the camera viewpoint 3-D graphic being carried out conversion;
Cutting module in three-dimensional body space is used for according to the three-dimensional vision body the visible part of 3-D graphic being carried out cutting;
The optical staining module is used for 3-D graphic played up by wire frame and is entity, to strengthen the three dimension realistic of 3-D graphic;
The texture module is used for a width of cloth two dimensional image is attached to as texture a polygon facet of 3-D graphic;
The perspective transform module is used for camera coordinates is transformed to perspective grid, so that 3-D graphic is transformed to two-dimension picture;
Image space cutting module is used for perspective grid is transformed to screen coordinate; The part that is further used for having crossed the 3-D graphic of screen border is carried out cutting;
Rasterizer module is used for rendering three-dimensional graphics to the display buffer.
Preferably, said 3 d rendering engine is played up instruction according to three-dimensional interface and operated 3-D graphic is carried out is played up processed steps and comprise:
According to the operation of user, the model coordinate figure of 3-D graphic is transformed to the world coordinates value to 3-D graphic;
Each polygon facet of 3-D graphic is inserted into plays up in the tabulation;
Create the camera transformation matrix;
Elimination is in the polygon at the back side;
Is the camera coordinates value according to the camera viewpoint with the world coordinates value transform of 3-D graphic;
According to the three-dimensional vision body 3-D graphic that can only see a part is carried out cutting;
Carry out depth ordering to playing up tabulation;
With the camera coordinates value transform of 3-D graphic is the screen coordinate value, 3-D graphic is played up by wire frame be entity;
Scene is played up in drafting, and the 3-D graphic after will playing up is saved in the video memory.
A kind of terminal, it comprises aforesaid three-dimensional interface display apparatus, said device comprises three-dimensional interface view module, three D controllers, and 3 d rendering engine, wherein,
Three-dimensional interface view module is used to detect the user to the operation of 3-D graphic and send it to three D controllers;
Three D controllers are used for sending three-dimensional interface according to user's operation to the three-dimensional process engine and play up instruction;
3 d rendering engine is used for playing up instruction according to said three-dimensional interface processing is played up in operated 3-D graphic execution.
A kind of three-dimensional interface display method, its three-dimensional interface display apparatus comprises three-dimensional interface view module, three D controllers, and 3 d rendering engine, said method comprises:
Three-dimensional interface view module detects the user to the operation of 3-D graphic and send it to three D controllers;
Three D controllers send three-dimensional interface according to user's operation to the three-dimensional process engine and play up instruction.
Preferably, said three-dimensional interface view module comprises that graphical user interface window data module, user import detection module, and the screen interactive module, wherein,
The graphical user interface window data module is used for the window information of encapsulation image user interface GUI;
The user imports detection module, is used to detect the user to the operation of 3-D graphic and send it to three D controllers;
The screen interactive module is used to show three-dimensional interface.
Preferably; Said 3 d rendering engine comprises that at least model coordinate transformation module, world coordinate transformation module, object reject module, insert and play up a kind of in list block, back side cancellation module, camera coordinates conversion module, optical staining module, three-dimensional body space cutting module, texture module, perspective transform module, image space cutting module and the rasterizer module; Wherein
The model coordinate transformation module is used for the model coordinate of 3-D graphic is carried out conversion;
The world coordinate transformation module, the position that is used for according to 3-D graphic is a world coordinates with the model coordinate transform;
Object rejecting module was used for before the execution world coordinates arrives the camera coordinates conversion, selected also to reject the relative sightless part of camera viewpoint in the 3-D graphic;
List block is played up in insertion, is used for each polygon facet with the visible part of 3-D graphic and is inserted into and plays up tabulation;
Back side cancellation module is used for eliminating the polygon facet of the 3-D graphic that is blocked;
The camera coordinates conversion module is used for according to the camera viewpoint 3-D graphic being carried out conversion;
Cutting module in three-dimensional body space is used for according to the three-dimensional vision body the visible part of 3-D graphic being carried out cutting;
The optical staining module is used for 3-D graphic played up by wire frame and is entity, to strengthen the three dimension realistic of 3-D graphic;
The texture module is used for a width of cloth two dimensional image is attached to as texture a polygon facet of 3-D graphic;
The perspective transform module is used for camera coordinates is transformed to perspective grid, so that 3-D graphic is transformed to two-dimension picture;
Image space cutting module is used for perspective grid is transformed to screen coordinate; The part that is further used for having crossed the 3-D graphic of screen border is carried out cutting;
Rasterizer module is used for rendering three-dimensional graphics to the display buffer.
Preferably, said 3 d rendering engine is played up instruction according to three-dimensional interface and operated 3-D graphic is carried out is played up processed steps and comprise:
According to the operation of user, the model coordinate figure of 3-D graphic is transformed to the world coordinates value to 3-D graphic;
Each polygon facet of 3-D graphic is inserted into plays up in the tabulation;
Create the camera transformation matrix;
Elimination is in the polygon at the back side;
Is the camera coordinates value according to the camera viewpoint with the world coordinates value transform of 3-D graphic;
According to the three-dimensional vision body 3-D graphic that can only see a part is carried out cutting;
Carry out depth ordering to playing up tabulation;
With the camera coordinates value transform of 3-D graphic is the screen coordinate value, 3-D graphic is played up by wire frame be entity;
Scene is played up in drafting, and the 3-D graphic after will playing up is saved in the video memory.
Technical scheme through the invention described above can be found out; The invention has the beneficial effects as follows; For there not being the hardware-accelerated terminal of 3-D graphic (for example mobile phone); Also can use this three-dimensional interface display apparatus provided by the invention, method to go to obtain the stronger three-dimensional interface of the sense of reality, thereby better interactive experience is provided for the user.
Embodiment
In order to make technical problem to be solved by this invention, technical scheme and beneficial effect clearer, clear,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
As shown in Figure 1, the embodiment of the invention provides a kind of three-dimensional interface display apparatus, comprises three-dimensional interface view module 10, three D controllers 20, and 3 d rendering engine 30, wherein,
Three-dimensional interface view module 10 is used to detect the user to the operation of 3-D graphic and send it to three D controllers 20;
Three D controllers 20 are used for sending three-dimensional interface according to user's operation to the three-dimensional process engine and play up instruction;
3 d rendering engine 30 is used for playing up instruction according to said three-dimensional interface processing is played up in operated 3-D graphic execution.
During practical implementation; The three-dimensional interface display apparatus that the embodiment of the invention provides adopts the MVC pattern to design; 3 d rendering engine 30, three-dimensional interface view module 10, three D controllers 20 are separated and decoupling zero, make three-dimensional Interface Design and exploitation that very big flexibility arranged.
Wherein, Said three-dimensional interface view module 10 is used to solve portability problem; Because the three-dimensional interface display apparatus that the embodiment of the invention provides need be independent of mobile phone graphic user interface GUI; Can reduce different terminals (mobile phone for example, the embodiment of the invention will be that example describes with the mobile phone mainly) like this and go up the development cost at three-dimensional interface.So; Provide three-dimensional interface view module 10 that mobile phone graphic user interface GUI is encapsulated; So that when three-dimensional interface display apparatus was transplanted to new mobile phone, what need do only was on new mobile phone, three-dimensional interface view module 10 to be made amendment, and other part is constant.For example, on different mobile, the three-dimensional interface of demonstration is identical, and different is only to revise its three-dimensional interface view module 10.
Three-dimensional interface view module 10 also is used for and user interactions.Specifically, it has encapsulated the window of mobile phone graphic user interface GUI, and possesses the user and import one-level screen output function, inputs to three D controllers 20 in order to transmit the user.
Particularly, continue with reference to Fig. 1, said three-dimensional interface view module 10 comprises that graphical user interface window data module 101, user import detection module 102, and screen interactive module 103, wherein,
Graphical user interface window data module 101 is used for the window information of encapsulation image user interface GUI;
The user imports detection module 102, is used to detect the user to the operation of 3-D graphic and send it to three D controllers 20;
Screen interactive module 103 is used to show three-dimensional interface.
Said three D controllers 20 are used to solve scalability problem, and this is because for various three-dimensional interfaces, and their user experience is different, but 3-D graphic to play up be consistent, the user interactions mode also is consistent.So; In the implementation process of reality; Various three-dimensional interface can have three D controllers 20 separately, then unifies by the three-dimensional process processing engines for the processing of playing up of 3-D graphic, is handled by three-dimensional interface view module 10 for man-machine interaction is then unified.
In practical application, allow three-dimensional interface to change three D controllers 20, and can dynamically open or close corresponding three D controllers 20, even can carry out the replacement of three D controllers 20 at run duration according to user's needs.For example, mobile phone when operation, can so that three-dimensional interface between various styles, switch.
The function of three D controllers 20 is to be used for obtaining user's input and deciphering, for example understands the operation of user to 3-D graphic, to obtain the operation purpose of user to three-dimensional interface.Specifically, it changes the visual effect at three-dimensional interface according to the operation of user for 3-D graphic.
In addition, 3 d rendering engine 30 is used to solve high-performance question, because the processing speed performance of three-dimensional interface display apparatus must be very fast, could not have under the hardware-accelerated situation, carries out three-dimensional glibly interface display.So 3 d rendering engines 30 performance consumption is maximum and that size of code is maximum are independent, are specifically designed to high performance three-dimensional and play up.And, when optimizing 3 d rendering engine 30 performances, need not revise the three-dimensional interface on the various mobile phones.
The function of 3 d rendering engine 30 is used for rendering three-dimensional graphics, and it holds data, state and the programmed logic of all 3-D graphic.Specifically, it is responsible for handling the data structure (comprising all light sources, motion and conventional state information) of 3-D graphic and from the viewpoint rendering three-dimensional graphics at user or camera place.
Continuation is with reference to Fig. 1; Said 3 d rendering engine 30 comprises that at least model coordinate transformation module 301, world coordinate transformation module 302, object reject module 303, insert and play up a kind of in list block 304, back side cancellation module 305, camera coordinates conversion module 306, optical staining module 307, three-dimensional body space cutting module 308, texture module 309, perspective transform module 310, image space cutting module 311 and the rasterizer module 312; Wherein
Model coordinate transformation module 301 is used for the model coordinate of 3-D graphic is carried out conversion.Model coordinate to 3-D graphic carries out conversion.For example carry out rotation, convergent-divergent or other vertex operations, promptly revise the model coordinate in the original place.
World coordinate transformation module 302, the position that is used for according to 3-D graphic is a world coordinates with the model coordinate transform;
Object rejecting module 303 was used for before the execution world coordinates arrives the camera coordinates conversion, selected also to reject the relative sightless part of camera viewpoint in the 3-D graphic.Before the execution world coordinates arrives the camera coordinates conversion, need to judge that the relative camera viewpoint of which 3-D graphic be visible, in order to avoid play up them by error.
List block 304 is played up in insertion, is used for each polygon facet with the visible part of 3-D graphic and is inserted into and plays up tabulation.Playing up tabulation is an array of pointers, wherein self-contained, as can to play up polygon facet of each pointed.It is thus clear that each polygon facet of 3-D graphic all can be inserted into and play up in the tabulation.
Back side cancellation module 305 is used for eliminating the polygon facet of the 3-D graphic that is blocked;
Camera coordinates conversion module 306 is used for according to the camera viewpoint 3-D graphic being carried out conversion;
Three-dimensional body space cutting module 308 is used for according to the three-dimensional vision body the visible part of 3-D graphic being carried out cutting;
Optical staining module 307 is used for 3-D graphic played up by wire frame and is entity, to strengthen the three dimension realistic of 3-D graphic;
Texture module 309 is used for a width of cloth two dimensional image is attached to as texture a polygon facet of 3-D graphic;
Perspective transform module 310 is used for camera coordinates is transformed to perspective grid, so that 3-D graphic is transformed to two-dimension picture;
Image space cutting module 311 is used for perspective grid is transformed to screen coordinate; The part that is further used for having crossed the 3-D graphic of screen border is carried out cutting;
Rasterizer module 312 is used for rendering three-dimensional graphics to the display buffer.
Wherein, said 3 d rendering engine 30 is played up instruction according to three-dimensional interface and operated 3-D graphic is carried out is played up processed steps and comprise:
(1), the model coordinate figure of 3-D graphic is transformed to the world coordinates value according to the operation of user to 3-D graphic;
(2) each polygon facet of 3-D graphic is inserted into plays up in the tabulation;
(3) create the camera transformation matrix;
(4) eliminate the polygon that is in the back side;
(5) be the camera coordinates value according to the camera viewpoint with the world coordinates value transform of 3-D graphic;
(6) according to the three-dimensional vision body 3-D graphic that can only see a part is carried out cutting;
(7) carry out depth ordering to playing up tabulation;
(8) the camera coordinates value transform with 3-D graphic is the screen coordinate value, 3-D graphic is played up by wire frame be entity;
(9) scene is played up in drafting, and the 3-D graphic after will playing up is saved in the video memory.
More particularly, please refer to Fig. 5, the flow chart at the drawing three-dimensional interface that it provides for the embodiment of the invention, said drafting flow process comprises the steps:
Step S401, transformation model coordinate.Three-dimensional cube is carried out upset, convergent-divergent or other vertex operations, revised the model coordinate figure of three-dimensional cube.Position according to 3-D graphic is a world coordinates with the model coordinate transform.
Step S402, object is inserted into plays up in the tabulation.In order to draw quickly, the polygon in each object is extracted, be kept at uniformly and play up in the tabulation.Playing up tabulation is an array of pointers, and wherein self-contained, as can to play up polygon facet of each pointed is played up in the tabulation it is thus clear that each polygon facet of 3-D graphic all can be inserted into.
Step S403, establishment camera transformation matrix.Be used for the matrix operation of following step.
Step S404, elimination are in the polygon at the back side.Carry out world coordinates and arrive before the camera coordinates conversion, need to judge that which 3-D graphic be visible as far as camera, in order to avoid play up them by error.The back side that human eye can't see need not be drawn, and through using the camera transformation matrix, eliminates and plays up the polygon that is in the back side in the tabulation.
Step S405, conversion world coordinates are to camera coordinates.According to camera position and visual angle possible visible 3-D graphic is carried out conversion.
Step S406, polygon is carried out 3-D clipping.According to the three-dimensional vision body 3-D graphic that can only see a part is carried out cutting.
Step S407, carry out depth ordering to playing up tabulation.Be used for quickening to play up the polygonal drafting of tabulation.
Step S408, conversion camera coordinates are to screen coordinate.3-D graphic played up by wire frame be entity, strengthen the three dimension realistic of 3-D graphic.Use a width of cloth two dimensional image to be attached on the polygon facet of 3-D graphic as texture.Camera coordinates is transformed to perspective grid, and 3-D graphic is transformed to two dimensional image.Perspective grid is transformed to screen coordinate, and some polygon image possibly crossed screen border, need be to its cutting.
Scene is played up in step S409, drafting.The final image of rendering three-dimensional graphics is in the video memory of mobile phone screen.For example; Three-dimensional cube is to draw with opaque mode, and the three-dimensional cube mirror image is to draw with translucent mode, and said three-dimensional cube mirror image has been simulated the inverted image of said three-dimensional cube; Its reverses direction is opposite just as the reverses direction of inverted image and three-dimensional cube.
The drafting of step S410, completion three-dimensional cube.
Correspondingly, the embodiment of the invention also provides a kind of terminal, and it comprises aforesaid three-dimensional interface display apparatus, continues with reference to Fig. 1, and said device comprises three-dimensional interface view module 10, three D controllers 20, and 3 d rendering engine 30, wherein,
Three-dimensional interface view module 10 is used to detect the user to the operation of 3-D graphic and send it to three D controllers 20;
Three D controllers 20 are used for sending three-dimensional interface according to user's operation to the three-dimensional process engine and play up instruction;
3 d rendering engine 30 is used for playing up instruction according to said three-dimensional interface processing is played up in operated 3-D graphic execution.
The terminal that the embodiment of the invention provides because it comprises three-dimensional interface display apparatus as indicated above, and because preceding text have carried out detailed description to this three-dimensional interface display apparatus, will no longer repeat to give unnecessary details to it here.
As shown in Figure 2, the embodiment of the invention also provides a kind of three-dimensional interface display method, and its three-dimensional interface display apparatus comprises three-dimensional interface view module 10, three D controllers 20, and 3 d rendering engine 30, and said method comprises:
S101, three-dimensional interface view module 10 detects users to the operation of 3-D graphic and send it to three D controllers 20;
S102, three D controllers 20 send three-dimensional interface according to user's operation to the three-dimensional process engine and play up instruction;
S103,3 d rendering engine 30 are played up instruction according to said three-dimensional interface processing are played up in operated 3-D graphic execution.
Specify for said three-dimensional interface display apparatus, please refer to mentioned above, no longer repeat specification here.
As shown in Figure 3, it is the schematic flow sheet of embodiment of the invention making three-dimensional cube, and said flow process comprises:
Step S201, drawing area is set.Confirm the position of three-dimensional cube in mobile phone screen, the part that three-dimensional cube is positioned within the drawing area can be drawn out, and the part that is positioned at outside the drawing area can be cropped, and can not be drawn.
Step S202, the effective coverage is set.For touch-screen mobile phone, when user's touch location was positioned within the effective coverage, three-dimensional cube just can be made cross reaction.For example, when user's finger moved in the effective coverage, three-dimensional cubic was known from experience to the upset of finger moving direction, and when user's finger moved outside the effective coverage, three-dimensional cube can not overturn.
Step S203, newly-built frame buffer zone.The three-dimensional interface engine of the present invention is used double buffering mechanism, and in mobile phone screen, what lined by line scan out is three-dimensional interface complete in the frame buffer zone, rather than the process at drawing three-dimensional interface.
Step S204, judgement are last faces.Six planes of circular treatment three-dimensional cube.
The plane of step S205, newly-built three-dimensional cube.Make each plane of three-dimensional cube, concrete steps see below about the description of Fig. 4.
Step S206, newly-built drawing area background.This image is as the background of three-dimensional cube.
Step S207, newly-built camera.Simulated people's eyes, in three dimensions, the people observes three-dimensional body through eyes, looks greatly from own near object, and looks little from own object far away, and this can produce real spatial impression.
Step S208, newly-built depth buffer.In three dimensions, can block from own object far away from own near object, depth buffer has been preserved the far and near position of object.Two-dimensional space uses X, two reference axis of Y, and three dimensions uses X, Y, three reference axis of Z, and the value in the depth buffer has been represented the value on the Z reference axis.
Step S209, the newly-built scene of playing up.Context when this is the drawing three-dimensional object is played up scene and is comprised the concrete data of playing up tabulation, depth buffer, screen video memory, transparency, and its decision three-dimensional body is drawn out in which way.
Step S210, newly-built translucent table.Translucent three-dimensional cube mirror image 102 is inverted images of three-dimensional cube 101, will use this translucent table when drawing mirror image.
The making of step S211, completion three-dimensional cube.
As shown in Figure 4, the schematic flow sheet on each plane of making three-dimensional cube that it provides for the embodiment of the invention.It describes the concrete realization content of above-mentioned steps S205 in detail, and implementation step is following:
Step S301, three-dimensional cubic dignity is set indicates.Three-dimensional cube has six faces, is positioned at front and back up and down, and its numerical value has nothing in common with each other, and gives this face which kind of numerical value through indicating decision.
Step S302, newly-built vertex list.The position on each summit of three-dimensional cubic dignity has been preserved in this tabulation, use be the model coordinate, all polygons are made up of the summit.
Step S303, new texture list of coordinates.This tabulation has been preserved and will be attached on this face, and the coordinate position of texture is sampled to image through these coordinate positions, has constituted the pixel data of texture then.
Step S304, newly-built vertex texture mapping table.The summit has been set up in this tabulation and texture coordinate concerns one to one, has determined which concrete pixel data in the texture is used on this summit.
Step S305, the tabulation of newly-built polygon.Polygon data has been preserved in this tabulation, and the polygon here all is a triangle, and using leg-of-mutton benefit is that leg-of-mutton each summit all is a coplane, and triangular structure is simple, is easy to the 3-D graphic algorithm and draws fast.Triangle is the element figure that the 3-D graphic rendering pipeline is drawn, and all three-dimensional bodies are made up of triangle.
Step S306, object space is set.Confirm the position of three-dimensional body in three dimensions, i.e. its position in world coordinate system.
Step S307, the object coordinates axle is set.For accurate upset, three-dimensional body be useful on record towards the model reference axis, use world coordinates.During like this along three reference axis upsets of X, Y, Z, just can know three-dimensional body towards.
Step S308, make object size coupling drawing area.Three-dimensional cubic is known from experience the size of coupling drawing area automatically, and it can intactly be drawn itself.
Step S309, new texture.Each three-dimensional cubic dignity all can be filled out an image, uses texture that image zoom is sampled, and has mated the size of three-dimensional cubic dignity.
Step S310, the value of all tabulations is set.Vertex list, texture coordinate tabulation, polygon tabulation can be filled out accurate values, and these numerical value use in drawing flow process.
The making of step S311, completion three-dimensional cubic dignity.
In embodiments of the present invention, said 3 d rendering engine 30 is played up instruction according to three-dimensional interface and operated 3-D graphic is carried out is played up processed steps and comprise:
(1), the model coordinate figure of 3-D graphic is transformed to the world coordinates value according to the operation of user to 3-D graphic;
(2) each polygon facet of 3-D graphic is inserted into plays up in the tabulation;
(3) create the camera transformation matrix;
(4) eliminate the polygon that is in the back side;
(5) be the camera coordinates value according to the camera viewpoint with the world coordinates value transform of 3-D graphic;
(6) according to the three-dimensional vision body 3-D graphic that can only see a part is carried out cutting;
(7) carry out depth ordering to playing up tabulation;
(8) the camera coordinates value transform with 3-D graphic is the screen coordinate value, 3-D graphic is played up by wire frame be entity;
(9) scene is played up in drafting, and the 3-D graphic after will playing up is saved in the video memory.
More particularly, please refer to Fig. 5, the flow chart at the drawing three-dimensional interface that it provides for the embodiment of the invention, said drafting flow process comprises the steps:
Step S401, transformation model coordinate.Three-dimensional cube is carried out upset, convergent-divergent or other vertex operations, revised the model coordinate figure of three-dimensional cube.Position according to 3-D graphic is a world coordinates with the model coordinate transform.
Step S402, object is inserted into plays up in the tabulation.In order to draw quickly, the polygon in each object is extracted, be kept at uniformly and play up in the tabulation.Playing up tabulation is an array of pointers, and wherein self-contained, as can to play up polygon facet of each pointed is played up in the tabulation it is thus clear that each polygon facet of 3-D graphic all can be inserted into.
Step S403, establishment camera transformation matrix.Be used for the matrix operation of following step.
Step S404, elimination are in the polygon at the back side.Carry out world coordinates and arrive before the camera coordinates conversion, need to judge that which 3-D graphic be visible as far as camera, in order to avoid play up them by error.The back side that human eye can't see need not be drawn, and through using the camera transformation matrix, eliminates and plays up the polygon that is in the back side in the tabulation.
Step S405, conversion world coordinates are to camera coordinates.According to camera position and visual angle possible visible 3-D graphic is carried out conversion.
Step S406, polygon is carried out 3-D clipping.According to the three-dimensional vision body 3-D graphic that can only see a part is carried out cutting.
Step S407, carry out depth ordering to playing up tabulation.Be used for quickening to play up the polygonal drafting of tabulation.
Step S408, conversion camera coordinates are to screen coordinate.3-D graphic played up by wire frame be entity, strengthen the three dimension realistic of 3-D graphic.Use a width of cloth two dimensional image to be attached on the polygon facet of 3-D graphic as texture.Camera coordinates is transformed to perspective grid, and 3-D graphic is transformed to two dimensional image.Perspective grid is transformed to screen coordinate, and some polygon image possibly crossed screen border, need be to its cutting.
Scene is played up in step S409, drafting.The final image of rendering three-dimensional graphics is in the video memory of mobile phone screen.For example; Three-dimensional cube is to draw with opaque mode, and the three-dimensional cube mirror image is to draw with translucent mode, and said three-dimensional cube mirror image has been simulated the inverted image of said three-dimensional cube; Its reverses direction is opposite just as the reverses direction of inverted image and three-dimensional cube.
The drafting of step S410, completion three-dimensional cube.
Above-mentioned explanation illustrates and has described a preferred embodiment of the present invention; But as previously mentioned; Be to be understood that the present invention is not limited to the form that this paper discloses, should do not regard eliminating as, and can be used for various other combinations, modification and environment other embodiment; And can in invention contemplated scope described herein, change through the technology or the knowledge of above-mentioned instruction or association area.And change that those skilled in the art carried out and variation do not break away from the spirit and scope of the present invention, then all should be in the protection range of accompanying claims of the present invention.