CN102629389A - 3D scene cutting method based on scanning ray - Google Patents

3D scene cutting method based on scanning ray Download PDF

Info

Publication number
CN102629389A
CN102629389A CN2012100444484A CN201210044448A CN102629389A CN 102629389 A CN102629389 A CN 102629389A CN 2012100444484 A CN2012100444484 A CN 2012100444484A CN 201210044448 A CN201210044448 A CN 201210044448A CN 102629389 A CN102629389 A CN 102629389A
Authority
CN
China
Prior art keywords
ray
detection body
ray detection
scene
place
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012100444484A
Other languages
Chinese (zh)
Other versions
CN102629389B (en
Inventor
罗丁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
FUJIAN TIANQU NETWORK TECHNOLOGY Co Ltd
Original Assignee
FUJIAN TIANQU NETWORK TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by FUJIAN TIANQU NETWORK TECHNOLOGY Co Ltd filed Critical FUJIAN TIANQU NETWORK TECHNOLOGY Co Ltd
Priority to CN201210044448.4A priority Critical patent/CN102629389B/en
Publication of CN102629389A publication Critical patent/CN102629389A/en
Application granted granted Critical
Publication of CN102629389B publication Critical patent/CN102629389B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Generation (AREA)

Abstract

The invention provides a 3D scene cutting method based on scanning a ray. The method is characterized by: aiming at a scene model in a 3D scene, establishing a ray detection body, wherein the ray detection body wraps the scene model as much as possible; establishing a mapping relation of each ray detection body and the corresponding scene model; according to a current coordinate and a current orientation of a scene camera, establishing a ray cluster uniformly distributed in a scene camera cone, wherein the length of the each ray in the ray cluster is not less than the length of a far cutting surface of the camera; in a current frame, traversing the each ray in the ray cluster according to a certain sequence, carrying out an intersection detection on the ray detection body, if one ray detection body is hit by the ray, storing the ray detection body in a container, traversing the each ray detection body in the container, finding the scene model corresponding to the ray detection body according to the mapping relation and rendering the scene model. According to the invention, during an operating period, the ray detection body substitutes a scene model so as to carry out rapid ray scanning. The method is suitable for various kinds of 3D scene management.

Description

3D scene method of cutting out based on flying spot
[technical field]
Method of cutting out when the present invention relates to a kind of 3D scene real-time rendering mainly detects through the model in the scene being carried out quick ray scanning, solves the observability decision problem of 3D model of place.
[background technology]
The 3D scene is that the model of place by some constitutes; How to express the complex scene that is comprising thousands of objects well; Therefore need scene management; To scene good hierarchical relationship is provided, so that screen (Culling) and hidden surface elimination (Hidden surface removal) better.Scene management relates to visual (Visibility processing) and the collision detection (Collision detection) handled, and system need judge which part of scene is within view volume.Mature technology scheme to the organization and administration of 3D scene mainly comprises BSP (Binary Space Partioning trees), Portal, quaternary tree, Octree etc. at present.These technical requirements are carried out space segmentation in the scene phase of making to scene, and process is complicated.Except that the Portal technology, other technologies can't be handled the space hiding relation effectively, but the Portal technology is also inapplicable in open outdoor 3D scene management field.
Large-scale 3D scene to complicacy is carried out real-time rendering, and requiring has a 3D scene cutting unit efficiently, and the purpose of reduction is to reduce the model of place quantity that need play up as far as possible, reduces graph rendering pressure, improves the operational efficiency of program.
[summary of the invention]
The technical matters that the present invention will solve; Be to provide a kind of 3D scene method of cutting out based on flying spot; Carry out quick ray scanning in the runtime through ray detection body alternative scenario model; Efficiently solve the observability decision problem of model of place, and do not receive the restriction of 3D scene layout type, be applicable to most indoor, outdoor 3D scene managements.
The present invention is achieved in that a kind of 3D scene method of cutting out based on flying spot, comprises the steps:
Step 10, set up original 3D scene, this 3D scene is made up of a plurality of models of place;
Step 20, set up a ray detection body to each model of place, this ray detection body is the solid that wraps model of place as far as possible;
Step 30, set up the mapping relations of each ray detection body and corresponding model of place;
Step 40, according to the current coordinate of scene video camera with towards, set up a ray bunch that is uniformly distributed in the scene video camera cone, every ray length is not less than the length of video camera cutting face far away in the ray bunch;
Step 50, at present frame; Travel through each the bar ray in the ray bunch in certain sequence, the ray detection bodies is intersected detection, if certain ray detection body is hit by ray; Then this ray detection body is deposited in the container; And to this ray detection body tag current time, this moment, current time was an initial value, was designated as t0; Stipulate that simultaneously this ray detection body does not initiatively remove from container in an activation cycle, be designated as T this activation cycle,, then upgrade the current time of t0 value for hitting for the last time if the detection bodies of being hit is present in the container already;
Each ray detection body in step 60, the traversal container if current time t<t0+T then finds the corresponding model of place of this ray detection body according to said mapping relations, is played up model of place; If current time t>=t0+T thinks that then this ray detection body activated life is overtime, this ray detection body is removed from container;
Step 70, at next frame, ray bunch is scanned to predetermined direction skew certain angle;
Step 80, repeating step 50 to 70, up to the ray of the rightmost side reach the cone right margin time finish.
Wherein, the complexity of said ray detection shape is that raising with accuracy of detection, detection efficiency improves.
Wherein, the shape of said ray detection body can be sphere, AABB bounding box or OBB bounding box.
Wherein, Said step 30 is set up each ray detection body and is to use Hash table to set up with the mapping relations of corresponding model of place; The key of Hash table is the memory address of each ray detection body, and value is the memory address of model of place or the file path of model of place.
Be to adopt to line by line scan or undertaken when wherein, said step 70 ray bunch scans by the mode of column scan
The present invention has following advantage: carry out quick ray scanning in the runtime through ray detection body alternative scenario model; Can effectively handle the hiding relation between the model of place; The making phase does not need the model space is cut apart; Thereby efficiently solve the observability decision problem of model of place, and do not receive the restriction of 3D scene layout type, be applicable to most indoor, outdoor 3D scene managements.
[description of drawings]
Combine embodiment that the present invention is further described with reference to the accompanying drawings.
Fig. 1 is the FB(flow block) of the inventive method.
The original 3D scene synoptic diagram that Fig. 2 sets up for the inventive method.
Fig. 3 the present invention is directed among Fig. 1 each model of place of original 3D scene to set up a ray detection body synoptic diagram.
Fig. 4 is a ray of the present invention bunch scanning mode synoptic diagram.
Fig. 5 is the ray of the present invention Principle of Process synoptic diagram of bunch lining by line scan.
[embodiment]
See also Fig. 1 to shown in Figure 5, the present invention provides a kind of 3D scene method of cutting out based on flying spot, comprises the steps:
Step 10, set up original 3D scene, as shown in Figure 2, this 3D scene is made up of a plurality of models of place.
Step 20, set up a ray detection body to each model of place, as shown in Figure 3, this ray detection body is the solid that wraps model of place as far as possible, but should be simple as far as possible; The complexity of said ray detection shape is that the raising with accuracy of detection, detection efficiency improves.In actual use; Different according to application demand with the program run environment; The shape of this solid can be spherical, AABB bounding box or OBB bounding box, in program, can use the mathematical model statement, like ball equation, ellipsoid equation or the polyhedron described by a plurality of plane equations; Also can use the cluster summit, be constructed to a model by DirectX (Direct eXtension is called for short DX) or OpenGL (Open Graphics Library) graphics library.Wherein DirectX is the multimedia DLL of being created by Microsoft, is intended to make computing machine based on windows to become the ideal platform that operation and demonstration have the application program of enriching multimedia element (for example panchromatic figure, video, 3D animation and enrich audio frequency).Application program can visit these functions through using DirectX API.OpenGL is the graphic package interface of a specialty, be one powerful, call bottom shape library easily, be a software interface with hardware independent, can between different platforms such as Windows, Unix, Linux, MacOS, OS/2, transplant.Application program can use the API of DirectX and OpenGL to carry out the drafting of figure and playing up of model.
Step 30, set up the mapping relations of each ray detection body and corresponding model of place; Its mapping relations can use Hash table to set up; The key of Hash table is the memory address of each ray detection body, and the value of Hash table is the memory address of model of place or the file path of model of place.
Step 40, as shown in Figure 4, according to the current coordinate of scene video camera with towards, set up a ray bunch that is uniformly distributed in the scene video camera cone, every ray length is not less than the length of video camera cutting face far away in the ray bunch; Said scene video camera is the virtual video camera that in the 3D scene, is used for photographed scene.Concerning same 3D scene, through the coordinate of adjustment video camera, shooting angle, parameters such as maximum shooting distance can be taken the different piece of 3D scene, and obtain different 3D pictures.DirectX and OpenGL all have corresponding API to obtain and set virtual video camera.The cone is the current cone scope that can take of scene video camera.
Step 50, at present frame; Travel through each the bar ray in the ray bunch in certain sequence, the ray detection bodies is intersected detection, if certain ray detection body is hit by ray; Then this ray detection body is deposited in the container; And to this ray detection body tag current time, this moment, current time was an initial value, was designated as t0; Stipulate that simultaneously this ray detection body does not initiatively remove from container in an activation cycle, be designated as T this activation cycle,, then upgrade the current time of t0 value for hitting for the last time if the detection bodies of being hit is present in the container already; Container of the present invention is the storage organization that is used to store a plurality of program objects in the program design, and the different programming language provides different containers.For example in the C/C++ language, can use an array to deposit a plurality of objects of the same type or type of foundation variable, this array promptly is called container; Also can use and deposit program object of the same type such as multiple storage organizations such as vector, list, hash_map among the STL (STL), these are also referred to as container.
Each ray detection body in step 60, the traversal container if current time t<t0+T then finds the corresponding model of place of this ray detection body according to said mapping relations, calls the API of graph drawing engine, and model of place is played up; The model in container is not participated in and is played up.If current time t>=t0+T thinks that then this ray detection body activated life is overtime, this ray detection body is removed from container;
Step 70, at next frame, ray bunch is scanned to predetermined direction skew certain angle; Can be during scanning according to the emission principle of CRT picture tube electron gun; The emission principle of the electron gun of CRT kinescope: kinescope is a vacuum tube; There is (or a plurality of) electron gun inside; Electron gun is launched electron beam, and when electron beam was mapped to vacuum tube forth screen surface inboard, the inboard luminous paint of screen received impacting of electron beam and luminous generation image.
Step 80, repeating step 50 to 70, up to the ray of the rightmost side reach the cone right margin time finish.Wherein, can adopt during scanning and line by line scan or by column scan, electron gun ejected electron bundle sequentially delegation is followed then carrying out continuously of row of delegation's continuous sweep or row, and direction can not limit, and this scan mode is called lines by line scan or by column scan.As shown in Figure 5, the ray of the present invention Principle of Process synoptic diagram of bunch lining by line scan is during scanning; Every ray scope of a little square frame of all lining by line scan in the ray bunch; Can begin from the position in the upper left corner in each little square frame, scan from left to right, after delegation finishes; Newline finishes up to the position of the last cell of little square frame.
In sum; The present invention carries out quick ray scanning in the runtime through ray detection body alternative scenario model; Can effectively handle the hiding relation between the model of place, the making phase does not need the model space is cut apart, thereby efficiently solves the observability decision problem of model of place; And do not receive the restriction of 3D scene layout type, be applicable to most indoor, outdoor 3D scene managements.
Though more than described embodiment of the present invention; But the technician who is familiar with the present technique field is to be understood that; We described concrete embodiment is illustrative; Rather than being used for qualification to scope of the present invention, those of ordinary skill in the art are in the modification and the variation of the equivalence of doing according to spirit of the present invention, all should be encompassed in the scope that claim of the present invention protects.

Claims (5)

1. the 3D scene method of cutting out based on flying spot is characterized in that: comprise the steps:
Step 10, set up original 3D scene, this 3D scene is made up of a plurality of models of place;
Step 20, set up a ray detection body to each model of place, this ray detection body is the solid that wraps model of place as far as possible;
Step 30, set up the mapping relations of each ray detection body and corresponding model of place;
Step 40, according to the current coordinate of scene video camera with towards, set up a ray bunch that is uniformly distributed in the scene video camera cone, every ray length is not less than the length of video camera cutting face far away in the ray bunch;
Step 50, at present frame; Travel through each the bar ray in the ray bunch in certain sequence, the ray detection bodies is intersected detection, if certain ray detection body is hit by ray; Then this ray detection body is deposited in the container; And to this ray detection body tag current time, this moment, current time was an initial value, was designated as t0; Stipulate that simultaneously this ray detection body does not initiatively remove from container in an activation cycle, be designated as T this activation cycle,, then upgrade the current time of t0 value for hitting for the last time if the detection bodies of being hit is present in the container already;
Each ray detection body in step 60, the traversal container if current time t<t0+T then finds the corresponding model of place of this ray detection body according to said mapping relations, is played up model of place; If current time t>=t0+T thinks that then this ray detection body activated life is overtime, this ray detection body is removed from container;
Step 70, at next frame, ray bunch is scanned to predetermined direction skew certain angle;
Step 80, repeating step 50 to 70, up to the ray of the rightmost side reach the cone right margin time finish.
2. the 3D scene method of cutting out based on flying spot according to claim 1 is characterized in that: the complexity of said ray detection shape is that the raising with accuracy of detection, detection efficiency improves.
3. the 3D scene method of cutting out based on flying spot according to claim 1 is characterized in that: the shape of said ray detection body is sphere, AABB bounding box or OBB bounding box.
4. the 3D scene method of cutting out based on flying spot according to claim 1; It is characterized in that: said step 30 is set up each ray detection body and is to use Hash table to set up with the mapping relations of corresponding model of place; The key of Hash table is the memory address of each ray detection body, and value is the memory address of model of place or the file path of model of place.
5. the 3D scene method of cutting out based on flying spot according to claim 1 is characterized in that: said step 70 ray is to adopt to line by line scan or undertaken by the mode of column scan when bunch scanning.
CN201210044448.4A 2012-02-24 2012-02-24 3D scene cutting method based on scanning ray Expired - Fee Related CN102629389B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210044448.4A CN102629389B (en) 2012-02-24 2012-02-24 3D scene cutting method based on scanning ray

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210044448.4A CN102629389B (en) 2012-02-24 2012-02-24 3D scene cutting method based on scanning ray

Publications (2)

Publication Number Publication Date
CN102629389A true CN102629389A (en) 2012-08-08
CN102629389B CN102629389B (en) 2014-07-30

Family

ID=46587647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210044448.4A Expired - Fee Related CN102629389B (en) 2012-02-24 2012-02-24 3D scene cutting method based on scanning ray

Country Status (1)

Country Link
CN (1) CN102629389B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111210499A (en) * 2020-01-14 2020-05-29 深圳市康拓普信息技术有限公司 Model rendering method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6094200A (en) * 1996-07-26 2000-07-25 Hewlett-Packard Company System and method for accelerated occlusion culling
US20080192046A1 (en) * 2007-02-14 2008-08-14 David Keith Fowler Box Casting Using an Integrated Acceleration Data Structure
CN101281654A (en) * 2008-05-20 2008-10-08 上海大学 Method for processing cosmically complex three-dimensional scene based on eight-fork tree

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6094200A (en) * 1996-07-26 2000-07-25 Hewlett-Packard Company System and method for accelerated occlusion culling
US20080192046A1 (en) * 2007-02-14 2008-08-14 David Keith Fowler Box Casting Using an Integrated Acceleration Data Structure
CN101281654A (en) * 2008-05-20 2008-10-08 上海大学 Method for processing cosmically complex three-dimensional scene based on eight-fork tree

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JINZHU GAO: "《Visibility Culling fot Time-Varying Volume Rendering Using Temporal Occusion Coherence》", 《IEEE VISUALIZATION》 *
季国红: "《三维游戏场景中动态物体的遮挡剔除算法》", 《微计算机信息》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111210499A (en) * 2020-01-14 2020-05-29 深圳市康拓普信息技术有限公司 Model rendering method and device
CN111210499B (en) * 2020-01-14 2023-08-25 南方电网数字平台科技(广东)有限公司 Model rendering method and device

Also Published As

Publication number Publication date
CN102629389B (en) 2014-07-30

Similar Documents

Publication Publication Date Title
US11069124B2 (en) Systems and methods for reducing rendering latency
Kähler et al. Very high frame rate volumetric integration of depth images on mobile devices
US8810590B2 (en) Method and apparatus for spatial binning on a GPU and global path planning to avoid spatially binned objects
US20200043219A1 (en) Systems and Methods for Rendering Optical Distortion Effects
US7940265B2 (en) Multiple spacial indexes for dynamic scene management in graphics rendering
US9177414B2 (en) Apparatus and method for rendering point cloud using voxel grid
US8253730B1 (en) System and method for construction of data structures for ray tracing using bounding hierarchies
CN104331918A (en) Occlusion culling and acceleration method for drawing outdoor ground surface in real time based on depth map
JP2014507723A5 (en)
WO2009145155A1 (en) Cutting process simulation display device, method for displaying cutting process simulation, and cutting process simulation display program
CN104299257B (en) A kind of method that real-time dynamic shadow is realized based on outdoor sunlight
US20190318529A1 (en) Systems and Methods for Rendering Foveated Effects
US20190206119A1 (en) Mixed reality display device
CN103021020A (en) Three-dimensional (3D) rendering method based on multiple light sources
JPH0749964A (en) Three-dimensional dynamic image generating device
JP2010501922A (en) Method and system for partitioning a spatial index
KR102242566B1 (en) Apparatus and method for processing ray tracing
CN101059760A (en) OPENGL to OPENGLIES translator and OPENGLIES emulator
CN110390711A (en) Computer graphical based on layering ray cast
CN107886561A (en) Storage scheduling and display methods based on scene of a crime cloud data
CN107038745A (en) A kind of 3D tourist sights roaming interaction method and device
CN1122945C (en) Image processor and image processing method
CN102831634A (en) Efficient accurate general soft shadow generation method
CN104751506A (en) Cluster rendering method and equipment for realizing three-dimensional graphic and image
CN102629389B (en) 3D scene cutting method based on scanning ray

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140730

Termination date: 20160224

CF01 Termination of patent right due to non-payment of annual fee