当前位置:文档之家› Hierarchies for occlusion culling

Hierarchies for occlusion culling

Hierarchies for occlusion culling
Hierarchies for occlusion culling

Helsinki University of Technology19.4.2003 Telecommunications Software and Multimedia Laboratory

Tik-111.500Seminar on Computer Graphics

Spring2003

Hierarchies for occlusion culling

Ville Helin

46553D

Hierarchies for occlusion culling

Ville Helin

tursas@niksula.hut.fi

Abstract

The computer graphics markets call for evermore complex3D-scenes.The latest video card draws more triangles than the one you bought a year ago as

memory bandwidth and chips’operating frequencies keep on rising.But that is

only one part of the big picture.With clever algorithms one could achieve the

same or even more than by just turbocharging the old hardware and relying on

brute force.Occlusion culling deals with?nding and discarding objects that are

occluded.This paper brie?y explains how object and image-space hierarchies

can be used to enhance the process of?nding occluded objects.

1INTRODUCTION

One just cannot deduce that adding occlusion culling to a3D-engine will save tremen-dous amounts of processing power for other tasks,because the engine does not have to draw the occluded objects any more.Occlusion culling itself can bring the computer to its knees by binding the CPU and GPU(Graphics Processing Unit)to use most of their time trying to?nd the occluded objects.Consider a scene where every surface goes through a series of extremely expensive shading computations.This clearly could bene?t from occlusion culling.Consider a scene with simple geometry and modest ef-fects.Here it might be better to just draw everything instead of spending valuable CPU cycles trying to?nd the occluded objects.In general,if we can?nd the scene’s invisible surfaces faster than drawing them would take,then occlusion culling will be bene?cial.

The minimum requirement for any occlusion culling algorithm to be bene?cial is that the scene is drawn from near-to-far,that is the occluders before the occludees, so you will need to sort your geometry by distance to the camera before drawing it. Sorting the geometry precisely could be expensive,but fortunately there are many approximating algorithms available for the job(see section2for a few of those).

In the section2of this paper we go through the basic techniques required to un-derstand the main focus of this paper,hierarchical Z-buffer visibility(in section3)and hierarchical occlusion maps(in section4).

1

2SPATIAL SUBDIVISION TECHNIQUES

Instead of having all the geometry in one,unbounded space,one might want to sub-divide the space into smaller segments or voxels as they are called(note that here the voxel’s borders are all aligned to the coordinate axes).Consider e.g.,collision check-ing.We are driving a tank in a suburban area and each frame we want to check if the tank crushes a building or a car.Without subdividing the space we would have to go through all the geometry(or at least their bounding volumes)in the scene to?nd potential collisions.But by subdividing the scene into smaller voxels we would have to go through only the geometry enclosed in voxels near the tank.

There are numerous ways to subdivide space,and in this section we go through the most commonly used techniques.Also notice that some algorithms are more suitable for dynamic scenes(e.g.,regular grid)than others(e.g.,octree and BSP-tree),because of the amount of work required to update the data structures(i.e.subdivision)on-the-?y.It should be noted that the subdivision can always be done to the plain geometry (splitting the polygons)or e.g.,bounding boxes(adding the pointer of the object to each voxel it touches),depending on the application and requirements.

Subdividing space also means that the enclosed geometry gets roughly ordered by its location.So after placing a camera and its focus point into the space one can draw the voxels’geometry from near-to-far by travelling from the camera to the focus point and drawing the contents of all encountered voxels.One must note that the geometry inside a voxel is rarely in any useful order,but even having the voxels sorted is a big help.

One should also note that it is possible and often very useful to use multiple and concurrent spatial subdivisions for a scene.E.g.,the static geometry could be placed inside a BSP-tree while a loose octree could be used to store the dynamic objects.In general,one must be careful when selecting a spatial subdivision technique as they all have their good and bad sides.Once again,there is no free lunch.

2.1Bounding volume hierarchy

Steven Rubin and Turner Whitted(1980)surrounded the objects in the scene with bounding boxes,and then proceeded to hierarchically surround multiple bounding boxes with larger bounding boxes until the desired depth of hierarchy was obtained. They used an editor to manually construct the hierarchy,but suggested automating the process by using methods like clustering.It was mentioned that good hierarchies are dif?cult to build automatically.See?gure1for an example of bounding volume hierarchy.

Bounding volume hierarchy is suitable for scenes with dynamic objects,but relo-cating objects in such a hierarchy can be tricky.When does a moving object move to another bounding box of higher level?Or does it just stretch the current parent box? Consider a forest scene with a train and a bird.If the train is not allowed to leave its tracks we know in advance the subspace where the train always is and can surround it

2

with a bounding volume.We also could subdivide this into smaller sections and move the train inside them.But the bird could,in theory,?y to every part of the scene,so it might be impractical to handle the bird like we handled the train.

Figure1:A bounding volume hierarchy.Here the grey rectangles are the objects’bounding rectangles.Other rectangles are the bounding rectangles constructing the hierarchy.

2.2Regular grid

Here we place a regular grid over the scene and assign the geometry to the grid’s voxel that encloses its center point.Afterwards we can?nd all the geometry in voxel n by indexing the grid.One could also clip the polygons to?t perfectly inside the voxels, but this would increase the amount of polygons.Then again,one could assign the polygons to every voxel they intersect.See?gure2for an example of a regular grid.

Regular grids are suitable for dynamic scenes when used with bounding volumes for the objects,because relocating geometry is easy:just remove it from the current voxel and place it into the new one.Regular grids work best when the geometry is uniformly distributed in the scene.Consider a scene from a city.Here a voxel enclosing a shop would contain a lot of geometry while a voxel enclosing a piece of street would contain very little geometry.We might want to subdivide voxels that have a lot of geometry even more,because the handling of such voxels would be expensive afterwards,but cannot do that,because the grid is regular.

Regular grids are not very suitable for dynamic scenes if we use the grid to clip the intersecting polygons.Afterwards,if the object moves,we would need to reassemble it before placing it back into the grid,and might have to clip it again.It should be noted that the object can still be fully dynamic if it never leaves the voxel enclosing it (i.e.piecewise dynamic scene).

3

Figure2:A regular grid

2.3Octree

Unlike regular grids,octree(?rst introduced by Andrew Glassner,1984)is a hierar-chical method for spatial subdivision.To build an octree we initially set one voxel to enclose all the scene’s geometry.Next we recursively subdivide every voxel that encloses too much(a threshold value)geometry into eight subvoxels(octants)of equal size.Every polygon is assigned to the smallest voxel that encloses the polygon com-pletely.The placing of the polygons can also be done as we did with a regular grid in section2.2.

Octree’s subdivision places many(and smaller)voxels into areas with plenty of geometry and less(and larger)voxels into areas with only a little geometry.See?gure 3for an example of an octree.

Octree is not very suitable for dynamic scenes as updating the data structure is not as trivial as in case of a regular grid,especially if we want to rebuild the octree on-the-?y even partially(lots of dynamic objects in the scene might make the old octree obsolete after some time).But octree has one advantage:if a voxel is not visible(or does not take part in collision checks)then all its children are not visible either,so we can use octree to cull away big parts of the scene fast.As with the case of the regular grid,octree can be used in dynamic scenes with less trouble if we store the objects’bounding boxes to the tree instead of raw geometry.

One could always replace the geometry in a leaf voxel(no children)with another geometry as long as the new geometry would stay inside the voxel.This way it would be possible to at least animate objects in an otherwise static scene without altering the octree.

4

Figure3:An octree(the root voxel is subdivided,and so is one of its children)

2.4Loose octree

Loose octree,introduced by Thatcher Ulrich(2000),is like an octree where all the voxels have been subdivided into a certain level.The looseness comes from the fact that the voxels of the same level overlap each other,e.g.,in an octree the voxel size would be N*N*N,but the same voxel in a loose octree would be2N*2N*2N.The objects of the3D-scene are surrounded by a bounding sphere and depending on the sphere’s radius the object is positioned into a voxel on level p(the larger the radius the larger is the voxel’s size on level p).Sphere’s center c indicates the object’s position on the grid.

Loose octree is very suitable for dynamic scenes as moving the object inside the octree is just as easy as it is with a regular grid.Loose octree also has octree’s ability to hierarchically cull away voxels and their children.The only downside is the looseness of the voxels.

2.5Recursive grid

David Jevans and Brian Wyvill(1989)introduced this generalized,adaptive octree method where each voxel can be subdivided into any amount of subvoxels(instead of eight as in the case of octree),depending on the enclosed geometry.By being able to subdivide each voxel into as many subvoxels as we wish we could keep the recursive grid’s hierarchy much?atter than octree’s,if both were used in the same scene.

Jevans and Wyvill’s implementation also did the subdivision on-the-?y,so when their raycaster’s ray hit a voxel,the voxel was subdivided only if it had not been sub-divided before and it needed to be subdivided(and there was some geometry inside).

Recursive grid is not very suitable for dynamic scenes either,because after the subdivision has been completed we have a data structure that is much like that of octree’s.But it subdivides the space better than an octree,because octree’s subdivision

5

is independent of the geometry where only the polygon count inside a voxel determines the need for a new subdivision.See?gure4for an example of a recursive grid.

Figure4:A recursive grid

2.6Hierarchical uniform grid

Hierarchical uniform grid(introduced by Frederic Cazals et al.,1995)has a different kind of approach to the spatial subdivision problem.Instead of starting by subdividing the whole scene we?rst group the scene’s objects by their size.Next we go through all the groups and put neighboring objects of similar size into clusters.Then we use regular grids(where the voxel size depends on the size of the objects inside the cluster) to subdivide the clusters.Finally we construct a hierarchy of these regular grids.See ?gure5for an example of a hierarchical uniform grid.

Hierarchical uniform grids have?atter hierarchy than e.g.,octrees,but they are not very suitable for dynamic scenes either,unless every cluster in the scene moves as one(scaling or adding more objects might require a new subdivision or at least new uniform grids).An example of such a situation could be a scene with numerous schools of?sh.

2.7BSP-tree

Henry Fuchs et al.(1980)developed BSP-tree for solving the hidden surface problem in a static scene.What makes it different from the other spatial subdivision algorithms described in this paper is that here the subdivision can be done using a plane that is not aligned to any of the coordinate axes.The bounding volume initially surrounding the scene is recursively subdivided by picking a polygon and using its plane as the subdivision plane.The subdivision continues until all the polygons have been added

6

Figure5:A hierarchical uniform grid.Here the all objects are on the same level in space with grid n+1,but to emphasize the fact that the grids are not spatially connected they were drawn separately.

to the tree.All the polygons that intersect this plane are split,so generating a BSP-tree may also increase the amount of polygons in the scene.

BSP-tree is not suitable for dynamic scenes,though its axis-aligned version(subdi-vision using only axis-aligned planes)suits dynamic scenes better.Also note that how one selects the subdivision plane affects the BSP-tree’s performance after subdivision. Constructing a BSP-tree is also a time consuming task.Even though BSP-tree requires that the scene is static many recent computer games rely on this80’s algorithm,like Quake III:Arena,Unreal,Half-Life and their derivatives e.g.,Unreal2.Even the forthcoming Doom III is said to use it(Accardo,2002).

3HIERARCHICAL Z-BUFFER VISIBILITY

Ned Greene et al.(1993)introduced a two phased method to accelerate occlusion culling compared to ordinary Z-buffer(Catmull,1974)scan conversion.They used an image-space Z-pyramid to speed up the visibility tests and an object-space octree(see section2.3)to quickly reject occluded geometry.Their implementation also exploited temporal coherence in successive frames to speed up things even more.Hierarchical Z-buffer is suitable for dynamic scenes as it operates only in the image-space,but when using an octree to accelerate the visibility test one might want to force the scene to be static.Here one could always replace octree with another spatial subdivision algorithm if the octree itself would be too constraining.

3.1Z-pyramid

Here the image’s Z-buffer is used as the?nest level in a Z-pyramid.The Z-values in the Z-pyramid’s successive levels are constructed by taking the maximum of four adjacent Z-values(quadrants)from the previous level.This means that a Z-value on level n represents the most distant Z-value of those four quadrants on level n-1,and the only Z-value on the highest level of the Z-pyramid tells us the most distant Z-value in the whole picture.Of course one could stop building the pyramid after few levels, nothing forces the hierarchy to be a complete pyramid.One could also build the next

7

level n+1using blocks of eight Z-values instead of four.Or32,or even more.See ?gure6for an example of a Z-pyramid.

30

73 11 62

03

47

49

54

19

22

14

2118

81

2438

73

6281

21

81

level n+1

level n+2

level n

Figure6:A Z-pyramid

Now updating the Z-buffer means that we must also update the Z-pyramid.This is not as bad as it?rst seems,because we can stop propagating the new Z-value as soon as we reach a level where it is not the highest of the quadrants’Z-values.

To use a Z-pyramid for occlusion culling we create an image-space bounding rect-angle for the polygon(or object,or octree’s voxel like Greene et al.did in their paper) and?nd the lowest level sample s of the Z-pyramid whose corresponding image-space rectangle encloses the bounding rectangle.If s is nearer than the nearest Z-value in the polygon,we know that the polygon is completely occluded.If the test fails we can descend to the lower level of the Z-pyramid,take the four Z-values corresponding to s,and compare them with the closest Z-value of the polygon in the quadrant.This way we?nd the quadrants where the polygon is closer(where the test fails again)to the camera and can continue this recursion until we have done the tests on the Z-pyramid’s lowest level(or all the tests succeed before that).

A cut Z-pyramid(hierarchical Z)has already found its way into some consumer level video cards(ATI’s Radeon family),and the results clearly show that when imple-mented in hardware,even with only three levels of hierarchy like in Radeon9700Pro, the speed boost is measured in hundreds of percents(Barron,2003)when the scene is rendered from front-to-back.See(Baumann,2002)for tests of Radeon8500’s hier-archical Z implementation.Personally I would love to see a full Z-pyramid in every new video card,but even a cut Z-pyramid is very bene?cial.The implementations are transparent to the software using the video card’s3D capabilities,but nowadays it is possible to ask from the video card if a polygon or a group of polygons is visi-ble(Radeon7000+and NVidia’s GeForce3+)and even the amount of visible pixels (Radeon7500+and GeForce3+).The only downside is that getting the information back from the video card can be quite slow,as the video card draws the polygon before it answers the waiting CPU.It would be more sensible if the video card halted the drawing as soon as the?rst visible pixel was encountered as at that point we already know that the polygon is visible.For more details on this see(Rege,2002).

8

3.2Temporal coherence

Ned Greene et al.(1993)reasoned that those voxels of the octree that are visible in frame n are also mostly visible in frame n+1,if you forget camera cuts and scene changes.They collected a list of visible voxels in frame n,and initialized the Z-buffer and Z-pyramid in frame n+1by rendering all these voxels.Still the visibility checks need to be done for every voxel in a reasonable amount of frames as otherwise the list of visible voxels will grow too large in time,and it will include all the seen voxels (so it would decrease the performance).Their tests showed that exploiting temporal coherence accelerated the rendering process very nicely.

One could also extend this reasoning and say that the voxels which are invisible in frame n are also invisible in frame n+1.This would decrease the amount of occlusion tests,but would mean that every voxel that would become visible would become vis-ible one frame too late.If the number of displayed frames per second was high and the camera’s motion was slow the user might not see this popping.If the occlusion test is done to an object’s bounding box only,it is often the case that when the object becomes visible the bounding box becomes visible?rst before the enclosed geome-try.This helps to decrease the popping a little.See(Helin,2003)for an example of this(includes source code).Initial tests showed a considerable increase in fps with heavily occluded scenes(30-40%for a forest scene with500-1000objects,occlusion culling done for each object separately),which means that the occlusion test is quite an expensive operation.

4HIERARCHICAL OCCLUSION MAPS

Hansong Zhang et al.(1997)introduced the idea of a hierarchy of occlusion maps.The lowest level occlusion map corresponds to the framebuffer where all the occluders are rendered using white color and the background is black(here black is0.0(min)and white is1.0(max)).They also clustered many disjoint,but smaller occluders,to group occluders(occluder fusion)instead of using only the largest objects as occluders.The implementation used a precomputed occluder database,which contains a subset of all the objects in the scene.From these objects the algorithm selects heuristically suitable occluders in real time,each frame,depending on the camera’s position,distance to the object and object’s size until the total amount of occluder polygons exceeds a threshold value.Creating the hierarchical occlusion map will not take very long,but it might miss few good occluders.The occlusion map is created only once a frame.

The hierarchy is constructed by creating mipmaps,which often can be done using the video card.A pixel on level n+1is then the average opacity of the corresponding four quadrants on level n.The same freedom that applied to creating a Z-pyramid applies to the creation of hierarchical occlusion maps.See?gure7for an example of a hierarchical occlusion map.

The algorithm also uses a depth estimation buffer,which is almost the same as the nth level of a Z-pyramid,but it records the farthest distances instead of the nearest.

9

Level0(256x216)Level1(64x54)Level2(16x13)

Figure7:A hierarchical occlusion map

The occlusion culling algorithm works in a conservative manner:the tests use only screen-space bounding rectangles for the objects.If any of the tests indicate that the bounding box is partially visible(one pixel is enough),the object is fully rendered. One could use a threshold value for the amount of visible pixels required,before the object is rendered,which is what Zhang et al.did in their tests.This has the downside that objects that become gradually visible might not get rendered in the?rst few frames and then suddenly pop into the screen.In real-time,interactive applications this might not be a problem,but it depends on the occasion.

In the case of the Z-test the nearest Z-value of the object is assigned to the bounding rectangle’s value.First the object’s visibility is hierarchically tested using occlusion maps,just like with hierarchical Z-buffer.Next we execute the Z-test for the object’s bounding box.If either of these tests fails,we render the object.If both succeed conclude that the object is not visible and skip it.

Because of the precomputation of the occluder database hierarchical occlusion maps are not very suitable for dynamic scenes where objects may change shape.Drop-ping the database and using only information obtained in real-time from the scene one would improve the algorithm’s suitability,but this might in turn decrease the overall performance.It should be noted that the algorithm relies completely on the creation of the occlusion maps each frame.If the occlusion maps are bad then the performance is bad.As the creation of the occlusion maps depends on many herustics one might have to tweak lots of parameters to obtain good results.Hansong Zhang et al.(1997) compare hierarchical occlusion maps with hierarchical Z-buffer,but the bene?ts of the former sound cosmetic.No real tests were made,which indicates that hierarchical occlusion map might not perform much better(if all)than hierarchical Z-buffer.

It should be noted that because we do not update the hierarchical occlusion maps after they have been built and because we use bouding rectangles for the visibility test, we often end up drawing many objects that are not visible in the?nal image.This can be a serious problem when the scene consists of a large number of objects.

10

REFERENCES

Accardo Sal.2002.DOOM III:The Very First Look.In: https://www.doczj.com/doc/a416270445.html,/e32002/pc/doom3b/index3.shtml(14-Apr-2003).

Barron Dave.2003.Dissecting The ATI RADEON9700PRO:Part 2.In: http://?https://www.doczj.com/doc/a416270445.html,(14-Apr-2003).

Baumann Dave.2002.ATI Radeon850064MB Review:Part 2.In: https://www.doczj.com/doc/a416270445.html,(14-Apr-2003).

Catmull Edwin.1974.A subdivision algorithm for computer display of curved sur-faces.In:PhD Thesis,University of Utah.

Cazals Frederic,Drettakis George,&Puech Claude.1995.Filtering,Clustering and Hierarchy Construction:a New Solution for Ray Tracing Very Complex Environ-ments.In:Computer Graphics Forum,August1995,pages371-382.

Fuchs Henry,Kedem Zvi,&Naylor Bruce.1980.On visible surface generation by a priori tree structures.In:Proceedings of ACM SIGGRAPH1980,pages124-133. Glassner Andrew.1984.Space subdivision for fast ray tracing.In:IEEE Computer Graphics and Applications,October1984,pages15-22.

Greene Ned,Kass Michael,&Miller Gavin.1993.Hierarchical z-buffer visibility.In: Proceedings of ACM SIGGRAPH1993,pages231-240.

Helin Ville.2003.Project Lecherous Gnomes.In:http://www.hut.?/vhelin/lg.html (14-Apr-2003).

Jevans David,&Wyvill Brian.1989.Adaptive voxel subdivision for ray tracing.In: Proceedings of Graphics Interface1989,pages164-172.

Rege Ashu.2002.Occlusion(HP and NV Extensions).In:Game Developers Confer-ence2002.

Rubin Steven,&Whitted Turner.1980.A3-Dimensional Representation for Fast Rendering of Complex Scenes.In:Proceedings of ACM SIGGRAPH1980,pages 110-116.

Ulrich Thatcher.2000.Spatial partitioning schemes.In:Game Programming Gems, ISBN:1584500492.

Zhang Hansong,Manocha Dinesh,Hudson Tom,&III Kenneth E.Hoff.1997.Vis-ibility culling using hierarchical occlusion maps.In:Proceedings of ACM SIG-GRAPH1997,pages77-88.

11

to与for的用法和区别

to与for的用法和区别 一般情况下, to后面常接对象; for后面表示原因与目的为多。 Thank you for helping me. Thanks to all of you. to sb.表示对某人有直接影响比如,食物对某人好或者不好就用to; for表示从意义、价值等间接角度来说,例如对某人而言是重要的,就用for. for和to这两个介词,意义丰富,用法复杂。这里仅就它们主要用法进行比较。 1. 表示各种“目的” 1. What do you study English for? 你为什么要学英语? 2. She went to france for holiday. 她到法国度假去了。 3. These books are written for pupils. 这些书是为学生些的。 4. hope for the best, prepare for the worst. 作最好的打算,作最坏的准备。 2.对于 1.She has a liking for painting. 她爱好绘画。 2.She had a natural gift for teaching. 她对教学有天赋/ 3.表示赞成同情,用for不用to. 1. Are you for the idea or against it? 你是支持还是反对这个想法? 2. He expresses sympathy for the common people.. 他表现了对普通老百姓的同情。 3. I felt deeply sorry for my friend who was very ill. 4 for表示因为,由于(常有较活译法) 1 Thank you for coming. 谢谢你来。 2. France is famous for its wines. 法国因酒而出名。 5.当事人对某事的主观看法,对于(某人),对…来说(多和形容词连用)用介词to,不用for.. He said that money was not important to him. 他说钱对他并不重要。 To her it was rather unusual. 对她来说这是相当不寻常的。 They are cruel to animals. 他们对动物很残忍。 6.for和fit, good, bad, useful, suitable 等形容词连用,表示适宜,适合。 Some training will make them fit for the job. 经过一段训练,他们会胜任这项工作的。 Exercises are good for health. 锻炼有益于健康。 Smoking and drinking are bad for health. 抽烟喝酒对健康有害。 You are not suited for the kind of work you are doing. 7. for表示不定式逻辑上的主语,可以用在主语、表语、状语、定语中。 1.It would be best for you to write to him. 2.The simple thing is for him to resign at once. 3.There was nowhere else for me to go. 4.He opened a door and stood aside for her to pass.

of与for的用法以及区别

of与for的用法以及区别 for 表原因、目的 of 表从属关系 介词of的用法 (1)所有关系 this is a picture of a classroom (2)部分关系 a piece of paper a cup of tea a glass of water a bottle of milk what kind of football,American of soccer? (3)描写关系 a man of thirty 三十岁的人 a man of shanghai 上海人 (4)承受动作 the exploitation of man by man.人对人的剥削。 (5)同位关系 It was a cold spring morning in the city of London in England. (6)关于,对于 What do you think of Chinese food? 你觉得中国食品怎么样? 介词 for 的用法小结 1. 表示“当作、作为”。如: I like some bread and milk for breakfast. 我喜欢把面包和牛奶作为早餐。What will we have for supper? 我们晚餐吃什么?

2. 表示理由或原因,意为“因为、由于”。如: Thank you for helping me with my English. 谢谢你帮我学习英语。 Thank you for your last letter. 谢谢你上次的来信。 Thank you for teaching us so well. 感谢你如此尽心地教我们。 3. 表示动作的对象或接受者,意为“给……”、“对…… (而言)”。如: Let me pick it up for you. 让我为你捡起来。 Watching TV too much is bad for your health. 看电视太多有害于你的健康。 4. 表示时间、距离,意为“计、达”。如: I usually do the running for an hour in the morning. 我早晨通常跑步一小时。We will stay there for two days. 我们将在那里逗留两天。 5. 表示去向、目的,意为“向、往、取、买”等。如: let’s go for a walk. 我们出去散步吧。 I came here for my schoolbag.我来这儿取书包。 I paid twenty yuan for the dictionary. 我花了20元买这本词典。 6. 表示所属关系或用途,意为“为、适于……的”。如: It’s time for school. 到上学的时间了。 Here is a letter for you. 这儿有你的一封信。 7. 表示“支持、赞成”。如: Are you for this plan or against it? 你是支持还是反对这个计划? 8. 用于一些固定搭配中。如: Who are you waiting for? 你在等谁? For example, Mr Green is a kind teacher. 比如,格林先生是一位心地善良的老师。

延时子程序计算方法

学习MCS-51单片机,如果用软件延时实现时钟,会接触到如下形式的延时子程序:delay:mov R5,#data1 d1:mov R6,#data2 d2:mov R7,#data3 d3:djnz R7,d3 djnz R6,d2 djnz R5,d1 Ret 其精确延时时间公式:t=(2*R5*R6*R7+3*R5*R6+3*R5+3)*T (“*”表示乘法,T表示一个机器周期的时间)近似延时时间公式:t=2*R5*R6*R7 *T 假如data1,data2,data3分别为50,40,248,并假定单片机晶振为12M,一个机器周期为10-6S,则10分钟后,时钟超前量超过1.11秒,24小时后时钟超前159.876秒(约2分40秒)。这都是data1,data2,data3三个数字造成的,精度比较差,建议C描述。

上表中e=-1的行(共11行)满足(2*R5*R6*R7+3*R5*R6+3*R5+3)=999,999 e=1的行(共2行)满足(2*R5*R6*R7+3*R5*R6+3*R5+3)=1,000,001 假如单片机晶振为12M,一个机器周期为10-6S,若要得到精确的延时一秒的子程序,则可以在之程序的Ret返回指令之前加一个机器周期为1的指令(比如nop指令), data1,data2,data3选择e=-1的行。比如选择第一个e=-1行,则精确的延时一秒的子程序可以写成: delay:mov R5,#167 d1:mov R6,#171 d2:mov R7,#16 d3:djnz R7,d3 djnz R6,d2

djnz R5,d1 nop ;注意不要遗漏这一句 Ret 附: #include"iostReam.h" #include"math.h" int x=1,y=1,z=1,a,b,c,d,e(999989),f(0),g(0),i,j,k; void main() { foR(i=1;i<255;i++) { foR(j=1;j<255;j++) { foR(k=1;k<255;k++) { d=x*y*z*2+3*x*y+3*x+3-1000000; if(d==-1) { e=d;a=x;b=y;c=z; f++; cout<<"e="<

常用介词用法(for to with of)

For的用法 1. 表示“当作、作为”。如: I like some bread and milk for breakfast. 我喜欢把面包和牛奶作为早餐。 What will we have for supper? 我们晚餐吃什么? 2. 表示理由或原因,意为“因为、由于”。如: Thank you for helping me with my English. 谢谢你帮我学习英语。 3. 表示动作的对象或接受者,意为“给……”、“对…… (而言)”。如: Let me pick it up for you. 让我为你捡起来。 Watching TV too much is bad for your health. 看电视太多有害于你的健康。 4. 表示时间、距离,意为“计、达”。如: I usually do the running for an hour in the morning. 我早晨通常跑步一小时。 We will stay there for two days. 我们将在那里逗留两天。 5. 表示去向、目的,意为“向、往、取、买”等。如: Let’s go for a walk. 我们出去散步吧。 I came here for my schoolbag.我来这儿取书包。 I paid twenty yuan for the dictionary. 我花了20元买这本词典。 6. 表示所属关系或用途,意为“为、适于……的”。如: It’s time for school. 到上学的时间了。 Here is a letter for you. 这儿有你的一封信。 7. 表示“支持、赞成”。如: Are you for this plan or against it? 你是支持还是反对这个计划? 8. 用于一些固定搭配中。如: Who are you waiting for? 你在等谁? For example, Mr Green is a kind teacher. 比如,格林先生是一位心地善良的老师。 尽管for 的用法较多,但记住常用的几个就可以了。 to的用法: 一:表示相对,针对 be strange (common, new, familiar, peculiar) to This injection will make you immune to infection. 二:表示对比,比较 1:以-ior结尾的形容词,后接介词to表示比较,如:superior ,inferior,prior,senior,junior 2: 一些本身就含有比较或比拟意思的形容词,如equal,similar,equivalent,analogous A is similar to B in many ways.

of和for的用法

of 1....的,属于 One of the legs of the table is broken. 桌子的一条腿坏了。 Mr.Brown is a friend of mine. 布朗先生是我的朋友。 2.用...做成的;由...制成 The house is of stone. 这房子是石建的。 3.含有...的;装有...的 4....之中的;...的成员 Of all the students in this class,Tom is the best. 在这个班级中,汤姆是最优秀的。 5.(表示同位) He came to New York at the age of ten. 他在十岁时来到纽约。 6.(表示宾格关系) He gave a lecture on the use of solar energy. 他就太阳能的利用作了一场讲演。 7.(表示主格关系) We waited for the arrival of the next bus. 我们等待下一班汽车的到来。

I have the complete works of Shakespeare. 我有莎士比亚全集。 8.来自...的;出自 He was a graduate of the University of Hawaii. 他是夏威夷大学的毕业生。 9.因为 Her son died of hepatitis. 她儿子因患肝炎而死。 10.在...方面 My aunt is hard of hearing. 我姑妈耳朵有点聋。 11.【美】(时间)在...之前 12.(表示具有某种性质) It is a matter of importance. 这是一件重要的事。 For 1.为,为了 They fought for national independence. 他们为民族独立而战。 This letter is for you. 这是你的信。

单片机C延时时间怎样计算

C程序中可使用不同类型的变量来进行延时设计。经实验测试,使用unsigned char类型具有比unsigned int更优化的代码,在使用时 应该使用unsigned char作为延时变量。以某晶振为12MHz的单片 机为例,晶振为12M H z即一个机器周期为1u s。一. 500ms延时子程序 程序: void delay500ms(void) { unsigned char i,j,k; for(i=15;i>0;i--) for(j=202;j>0;j--) for(k=81;k>0;k--); } 计算分析: 程序共有三层循环 一层循环n:R5*2 = 81*2 = 162us DJNZ 2us 二层循环m:R6*(n+3) = 202*165 = 33330us DJNZ 2us + R5赋值 1us = 3us 三层循环: R7*(m+3) = 15*33333 = 499995us DJNZ 2us + R6赋值 1us = 3us

循环外: 5us 子程序调用 2us + 子程序返回2us + R7赋值 1us = 5us 延时总时间 = 三层循环 + 循环外 = 499995+5 = 500000us =500ms 计算公式:延时时间=[(2*R5+3)*R6+3]*R7+5 二. 200ms延时子程序 程序: void delay200ms(void) { unsigned char i,j,k; for(i=5;i>0;i--) for(j=132;j>0;j--) for(k=150;k>0;k--); } 三. 10ms延时子程序 程序: void delay10ms(void) { unsigned char i,j,k; for(i=5;i>0;i--) for(j=4;j>0;j--) for(k=248;k>0;k--);

for和to区别

1.表示各种“目的”,用for (1)What do you study English for 你为什么要学英语? (2)went to france for holiday. 她到法国度假去了。 (3)These books are written for pupils. 这些书是为学生些的。 (4)hope for the best, prepare for the worst. 作最好的打算,作最坏的准备。 2.“对于”用for (1)She has a liking for painting. 她爱好绘画。 (2)She had a natural gift for teaching. 她对教学有天赋/ 3.表示“赞成、同情”,用for (1)Are you for the idea or against it 你是支持还是反对这个想法? (2)He expresses sympathy for the common people.. 他表现了对普通老百姓的同情。 (3)I felt deeply sorry for my friend who was very ill. 4. 表示“因为,由于”(常有较活译法),用for (1)Thank you for coming. 谢谢你来。

(2)France is famous for its wines. 法国因酒而出名。 5.当事人对某事的主观看法,“对于(某人),对…来说”,(多和形容词连用),用介词to,不用for. (1)He said that money was not important to him. 他说钱对他并不重要。 (2)To her it was rather unusual. 对她来说这是相当不寻常的。 (3)They are cruel to animals. 他们对动物很残忍。 6.和fit, good, bad, useful, suitable 等形容词连用,表示“适宜,适合”,用for。(1)Some training will make them fit for the job. 经过一段训练,他们会胜任这项工作的。 (2)Exercises are good for health. 锻炼有益于健康。 (3)Smoking and drinking are bad for health. 抽烟喝酒对健康有害。 (4)You are not suited for the kind of work you are doing. 7. 表示不定式逻辑上的主语,可以用在主语、表语、状语、定语中。 (1)It would be best for you to write to him. (2) The simple thing is for him to resign at once.

51单片机延时时间计算和延时程序设计

一、关于单片机周期的几个概念 ●时钟周期 时钟周期也称为振荡周期,定义为时钟脉冲的倒数(可以这样来理解,时钟周期就是单片机外接晶振的倒数,例如12MHz的晶振,它的时间周期就是1/12 us),是计算机中最基本的、最小的时间单位。 在一个时钟周期内,CPU仅完成一个最基本的动作。 ●机器周期 完成一个基本操作所需要的时间称为机器周期。 以51为例,晶振12M,时钟周期(晶振周期)就是(1/12)μs,一个机器周期包 执行一条指令所需要的时间,一般由若干个机器周期组成。指令不同,所需的机器周期也不同。 对于一些简单的的单字节指令,在取指令周期中,指令取出到指令寄存器后,立即译码执行,不再需要其它的机器周期。对于一些比较复杂的指令,例如转移指令、乘法指令,则需要两个或者两个以上的机器周期。 1.指令含义 DJNZ:减1条件转移指令 这是一组把减1与条件转移两种功能结合在一起的指令,共2条。 DJNZ Rn,rel ;Rn←(Rn)-1 ;若(Rn)=0,则PC←(PC)+2 ;顺序执行 ;若(Rn)≠0,则PC←(PC)+2+rel,转移到rel所在位置DJNZ direct,rel ;direct←(direct)-1 ;若(direct)= 0,则PC←(PC)+3;顺序执行 ;若(direct)≠0,则PC←(PC)+3+rel,转移到rel 所在位置 2.DJNZ Rn,rel指令详解 例:

MOV R7,#5 DEL:DJNZ R7,DEL; rel在本例中指标号DEL 1.单层循环 由上例可知,当Rn赋值为几,循环就执行几次,上例执行5次,因此本例执行的机器周期个数=1(MOV R7,#5)+2(DJNZ R7,DEL)×5=11,以12MHz的晶振为例,执行时间(延时时间)=机器周期个数×1μs=11μs,当设定立即数为0时,循环程序最多执行256次,即延时时间最多256μs。 2.双层循环 1)格式: DELL:MOV R7,#bb DELL1:MOV R6,#aa DELL2:DJNZ R6,DELL2; rel在本句中指标号DELL2 DJNZ R7,DELL1; rel在本句中指标号DELL1 注意:循环的格式,写错很容易变成死循环,格式中的Rn和标号可随意指定。 2)执行过程

双宾语 to for的用法

1.两者都可以引出间接宾语,但要根据不同的动词分别选用介词to 或for:(1) 在give, pass, hand, lend, send, tell, bring, show, pay, read, return, write, offer, teach, throw 等之后接介词to。 如: 请把那本字典递给我。 正:Please hand me that dictionary. 正:Please hand that dictionary to me. 她去年教我们的音乐。 正:She taught us music last year. 正:She taught music to us last year. (2) 在buy, make, get, order, cook, sing, fetch, play, find, paint, choose,prepare, spare 等之后用介词for 。如: 他为我们唱了首英语歌。 正:He sang us an English song. 正:He sang an English song for us. 请帮我把钥匙找到。 正:Please find me the keys. 正:Please find the keys for me. 能耽搁你几分钟吗(即你能为我抽出几分钟吗)? 正:Can you spare me a few minutes? 正:Can you spare a few minutes for me? 注:有的动词由于搭配和含义的不同,用介词to 或for 都是可能的。如:do sb a favour=do a favour for sb 帮某人的忙 do sb harm=do harm to sb 对某人有害

双宾语tofor的用法

1. 两者都可以引出间接宾语,但要根据不同的动词分别选用介词to 或for: (1) 在give, pass, hand, lend, send, tell, bring, show, pay, read, return, write, offer, teach, throw 等之后接介词to。 如: 请把那本字典递给我。 正:Please hand me that dictionary. 正:Please hand that dictionary to me. 她去年教我们的音乐。 正:She taught us music last year. 正:She taught music to us last year. (2) 在buy, make, get, order, cook, sing, fetch, play, find, paint, choose,prepare, spare 等之后用介词for 。如: 他为我们唱了首英语歌。 正:He sang us an English song. 正:He sang an English song for us. 请帮我把钥匙找到。 正:Please find me the keys. 正:Please find the keys for me. 能耽搁你几分钟吗(即你能为我抽出几分钟吗)? 正:Can you spare me a few minutes? 正:Can you spare a few minutes for me? 注:有的动词由于搭配和含义的不同,用介词to 或for 都是可能的。如: do sb a favou r do a favour for sb 帮某人的忙 do sb harnn= do harm to sb 对某人有害

for和of的用法

for的用法: 1. 表示“当作、作为”。如: I like some bread and milk for breakfast. 我喜欢把面包和牛奶作为早餐。 What will we have for supper? 我们晚餐吃什么? 2. 表示理由或原因,意为“因为、由于”。如: Thank you for helping me with my English. 谢谢你帮我学习英语。 Thank you for your last letter. 谢谢你上次的来信。 Thank you for teaching us so well. 感谢你如此尽心地教我们。 3. 表示动作的对象或接受者,意为“给……”、“对…… (而言)”。如: Let me pick it up for you. 让我为你捡起来。 Watching TV too much is bad for your health. 看电视太多有害于你的健康。 4. 表示时间、距离,意为“计、达”。如:

I usually do the running for an hour in the morning. 我早晨通常跑步一小时。 We will stay there for two days. 我们将在那里逗留两天。 5. 表示去向、目的,意为“向、往、取、买”等。如: Let’s go for a walk. 我们出去散步吧。 I came here for my schoolbag.我来这儿取书包。 I paid twenty yuan for the dictionary. 我花了20元买这本词典。 6. 表示所属关系或用途,意为“为、适于……的”。如: It’s time for school. 到上学的时间了。 Here is a letter for you. 这儿有你的一封信。 7. 表示“支持、赞成”。如: Are you for this plan or against it? 你是支持还是反对这个计划? 8. 用于一些固定搭配中。如:

英语形容词和of for 的用法

加入收藏夹 主题: 介词试题It’s + 形容词 + of sb. to do sth.和It’s + 形容词 + for sb. to do sth.的用法区别。 内容: It's very nice___pictures for me. A.of you to draw B.for you to draw C.for you drawing C.of you drawing 提交人:杨天若时间:1/23/2008 20:5:54 主题:for 与of 的辨别 内容:It's very nice___pictures for me. A.of you to draw B.for you to draw C.for you drawing C.of you drawing 答:选A 解析:该题考查的句型It’s + 形容词+ of sb. to do sth.和It’s +形容词+ for sb. to do sth.的用法区别。 “It’s + 形容词+ to do sth.”中常用of或for引出不定式的行为者,究竟用of sb.还是用for sb.,取决于前面的形容词。 1) 若形容词是描述不定式行为者的性格、品质的,如kind,good,nice,right,wrong,clever,careless,polite,foolish等,用of sb. 例: It’s very kind of you to help me. 你能帮我,真好。 It’s clever of you to work out the maths problem. 你真聪明,解出了这道数学题。 2) 若形容词仅仅是描述事物,不是对不定式行为者的品格进行评价,用for sb.,这类形容词有difficult,easy,hard,important,dangerous,(im)possible等。例: It’s very dangerous for children to cross the busy street. 对孩子们来说,穿过繁忙的街道很危险。 It’s difficult for u s to finish the work. 对我们来说,完成这项工作很困难。 for 与of 的辨别方法: 用介词后面的代词作主语,用介词前边的形容词作表语,造个句子。如果道理上通顺用of,不通则用for. 如: You are nice.(通顺,所以应用of)。 He is hard.(人是困难的,不通,因此应用for.) 由此可知,该题的正确答案应该为A项。 提交人:f7_liyf 时间:1/24/2008 11:18:42

to和for的用法有什么不同(一)

to和for的用法有什么不同(一) 一、引出间接宾语时的区别 两者都可以引出间接宾语,但要根据不同的动词分别选用介词to 或for,具体应注意以下三种情况: 1. 在give, pass, hand, lend, send, tell, bring, show, pay, read, return, write, offer, teach, throw 等之后接介词to。如: 请把那本字典递给我。 正:Please hand me that dictionary. 正:Please hand that dictionary to me. 她去年教我们的音乐。 正:She taught us music last year. 正:She taught music to us last year. 2. 在buy, make, get, order, cook, sing, fetch, play, find, paint, choose, prepare, spare 等之后用介词for 。如: 他为我们唱了首英语歌。 正:He sang us an English song. 正:He sang an English song for us. 请帮我把钥匙找到。 正:Please find me the keys. 正:Please find the keys for me. 能耽搁你几分钟吗(即你能为我抽出几分钟吗)? 正:Can you spare me a few minutes?

正:Can you spare a few minutes for me? 3. 有的动词由于用法和含义不同,用介词to 或for 都是可能的。如: do sb a favor=do a favor for sb 帮某人的忙 do sb harm=do harm to sb 对某人有害 在有的情况下,可能既不用for 也不用to,而用其他的介词。如: play sb a trick=play a trick on sb 作弄某人 请比较: play sb some folk songs=play some folk songs for sb 给某人演奏民歌 有时同一个动词,由于用法不同,所搭配的介词也可能不同,如leave sbsth 这一结构,若表示一般意义的为某人留下某物,则用介词for 引出间接宾语,即说leave sth for sb;若表示某人死后遗留下某物,则用介词to 引出间接宾语,即说leave sth to sb。如: Would you like to leave him a message? / Would you like to leave a message for him? 你要不要给他留个话? Her father left her a large fortune. / Her father left a large fortune to her. 她父亲死后给她留下了一大笔财产。 二、表示目标或方向的区别 两者均可表示目标、目的地、方向等,此时也要根据不同动词分别对待。如: 1. 在come, go, walk, move, fly, ride, drive, march, return 等动词之后通常用介词to 表示目标或目的地。如: He has gone to Shanghai. 他到上海去了。 They walked to a river. 他们走到一条河边。

延时计算

t=n*(分频/f) t:是你所需的延时时间 f:是你的系统时钟(SYSCLK) n:是你所求,用于设计延时函数的 程序如下: void myDelay30s() reentrant { unsigned inti,k; for(i=0;i<4000;i++) /*系统时钟我用的是24.576MHZ,分频是12分频,达到大约10s延时*/ for(k=0;k<8000;k++); } //n=i*k |评论 2012-2-18 20:03 47okey|十四级 debu(g调试),左侧有运行时间。在你要测试的延时子函数外设一断点,全速运行到此断点。记下时间,再单步运行一步,跳到下一步。再看左侧的运行时间,将这时间减去上一个时间,就是延时子函数的延时时间了。不知能不能上图。 追问 在delayms处设置断点,那么对应的汇编语言LCALL是否被执行呢?还有,问问您,在C8051F020单片机中,MOV指令都是多少指令周期呢?我在KEIL下仿真得出的结果,与我通过相应的汇编语言分析的时间,总是差了很多。 回答 C编译时,编译器都要先变成汇编。只想知道延时时间,汇编的你可以不去理会。只要看运行时间就好了。 at8051单片机12m晶振下,机器周期为1us,而c8051 2m晶振下为1us。keil 调试里频率默认为24m,你要设好晶振频率。

|评论 2012-2-23 11:17 kingranran|一级 参考C8051单片机内部计时器的工作模式,选用合适的计时器进行中断,可获得较高精度的延时 |评论 2012-2-29 20:56 衣鱼ccd1000|一级 要是精确延时的话就要用定时器,但定的时间不能太长,长了就要设一个变量累加来实现了; 要是不要求精确的话就用嵌套for函数延时,比较简单,但是程序复杂了就会增添不稳定因素,所以不推荐。 |评论

202X中考英语:to和for的区别与用法.doc

202X中考英语:to和for的区别与用法中考栏目我为考生们整理了“202X中考英语:to和for的区别与用法”,希望能帮到大家,想了解更多考试资讯,本网站的及时更新哦。 202X中考英语:to和for的区别与用法 to和for的区别与用法是什么 一般情况下, to后面常接对象; for后面表示原因与目的为多。 Thank you for helping me. Thanks to all of you. to sb. 表示对某人有直接影响比如,食物对某人好或者不好就用to; for 表示从意义、价值等间接角度来说,例如对某人而言是重要的,就用for. for和to这两个介词,意义丰富,用法复杂。这里仅就它们主要用法进行比较。 1. 表示各种“目的” 1. What do you study English for? 你为什么要学英语? 2. She went to france for holiday. 她到法国度假去了。 3. These books are written for pupils. 这些书是为学生些的。 4. hope for the best, prepare for the worst. 作最好的打算,作最坏的准备。

2.对于 1.She has a liking for painting. 她爱好绘画。 2.She had a natural gift for teaching. 她对教学有天赋。 3.表示赞成同情,用for不用to. 1. Are you for the idea or against it? 你是支持还是反对这个想法? 2. He expresses sympathy for the common people.. 他表现了对普通老百姓的同情。 3. I felt deeply sorry for my friend who was very ill. 4 for表示因为,由于(常有较活译法) 1.Thank you for coming. 谢谢你来。 2. France is famous for its wines. 法国因酒而出名。 5.当事人对某事的主观看法,对于(某人),对?来说(多和形容词连用)用介词to,不用for.. He said that money was not important to him. 他说钱对他并不重要。 To her it was rather unusual. 对她来说这是相当不寻常的。 They are cruel to animals. 他们对动物很残忍。

keep的用法及of 、for sb.句型区别

keep的用法 1. 用作及物动词 ①意为"保存;保留;保持;保守"。如: Could you keep these letters for me, please? 你能替我保存这些信吗? ②意为"遵守;维护"。如: Everyone must keep the rules. 人人必须遵守规章制度。 The teacher is keeping order in class.老师正在课堂上维持秩序。 ③意为"使……保持某种(状态、位置或动作等)"。这时要在keep的宾语后接补足语,构 成复合宾语。其中宾语补足语通常由形容词、副词、介词短语、现在分词和过去分词等充当。如: 例:We should keep our classroom clean and tidy.(形容词) 我们应保持教室整洁干净。 You'd better keep the child away from the fire.(副词)你最好让孩子离火远一点。 The bad weather keeps us inside the house.(介词短语)坏天气使我们不能出门。 Don't keep me waiting for long.(现在分词)别让我等太久。 The other students in the class keep their eyes closed.(过去分词) 班上其他同学都闭着眼睛。 2. 用作连系动词 构成系表结构:keep+表语,意为"保持,继续(处于某种状态)"。其中表语可用形容词、副词、介词短语等充当。如: 例:You must look after yourself and keep healthy.(形容词) 你必须照顾好自己,保持身体健康。 Keep off the grass.(副词)请勿践踏草地。 Traffic in Britain keeps to the left.(介词短语)英国的交通是靠左边行驶的。 注意:一般情况下,keep后接形容词较为多见。再如: She knew she must keep calm.她知道她必须保持镇静。 Please keep silent in class.课堂上请保持安静。 3. ①keep doing sth. 意为"继续干某事",表示不间断地持续干某事,keep后不 能接不定式或表示静止状态的v-ing形式,而必须接延续性的动词。 例:He kept working all day, because he wanted to finish the work on time. 他整天都在不停地工作,因为他想准时完成工作。 Keep passing the ball to each other, and you'll be OK.坚持互相传球,你们就

to of和for的区别

to , of 和for的区别 1.to有到的意思,常常和go,come,get连用引出地点。Go to school , go to the shop , go to the cinema. 常见的短语:the way to 去---的路 On one’s way to 在某人去---的路上 以上的用法中,当地点是副词home,here,there等是to 要去掉。如:get home,the way here To后跟动词原形,是不定式的标志 It is +形容词+(for/of +人+)to do sth.(括号内部分可以省略) It is easy for me to learn English. It is very kind of you to lend me your money. 当形容词表示人的行为特征时用of表示to do的性质时用for Want, hope ,decide, plan , try , fail等词后跟to do I want to join the swimming club. Would like to do I’d like to play basketball with them. It is time to have a break. Next to , close to , from ---to--- 2.for 为,表示目的。 Thank you for Buy sth for sb =buy sb sth It is time for bed. Here is a letter for you.

I will study for our country. 3.of表示所属关系意思是:---的 a map of the world a friend of mine

for和of引导的不定式结构的区别

for和of引导的不定式结构的区别 不定式是一种非谓语动词,不能单独作谓语,因此没有语法上的主语。但由于不定式表示的是动作,在意义上可以有它的主体。我们称之为逻辑主语。 提起不定式逻辑主语,人们首先想到的会是“for+名词(宾格代词)+不定式”的复合结构。如:It is important for us to study English well.然而,有时不定式的逻辑主语须要用“of+名词(代词宾格)”才行。例如:It is kind of you to help me.而不能说:It is kind for you to help me.在选择介词“for”还是“of”时,人们往往总是凭感觉而定。有时受习惯影响,多选介词“for”。于是常出现这样的错误:It was careless for him to lose his way.It is cruel for you to do so.由于众多语法书对这种结构中使用“for”与“of”的区别介绍甚少,一些人对其概念认识尚不完全清楚,笔者认为有必要就这一问题作些探讨与介绍。 一、在句中的语法作用不同 a.不定式for结构在句中可以作主、宾、表、定、状、同位语: 1.It is easy for Tom to do this work.(主语)汤姆做此工作是容易的。 2.I'd like for him to come here.(宾语)我喜欢他来这里。 3.His idea is for us to travel in two different groups.(表语)他的想法是:我们分成两组旅行。 4.Have you heard about the plan for you to go abroad.(定语)你听到让你出国的计划吗? 5.The word is too difficult for him to pronounce well.(状语)这单词太难,他念不准。 6.In the most schools,it is the custom for the headmaster to declare the newterm start.在大部分学校,校长宣布新学期开始是一个习惯。 b.不定式of结构只能在句中作主语。 1.It was careless of him to leave his umbrella in the train.他把伞丢在火车上真是太粗心了。 2.It is awfully good of you to come to see me off at the station.谢谢你来车站送我。 二、逻辑主语的名词有所不同

相关主题
文本预览
相关文档 最新文档